fdisk -l

fdisk -l

我正在尝试重新格式化驱动器。最初是为 Solaris 格式化的,使用 ZFS 文件系统。我正在为我的 Linux (debian) 重新格式化。

我使用 fdisk 删除了所有现有分区。尝试创建新分区时,fdisk 和 cfdisk 都挂起了。

fdisk -l

Disk /dev/sdb: 68.4 GiB, 73407865856 bytes, 143374738 sectors
Disk model: ST973402SSUN72G 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: DB83FA41-8BEC-C84A-9DF1-8EC1CCDB776F

fdisk /dev/sdb

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition number (1-9, default 1): 

(点击回车,挂断)

cfdisk /dev/sdb

                                    Disk: /dev/sdb
                           Size: 68.4 GiB, 73407865856 bytes, 143374738 sectors
                       Label: gpt, identifier: DB83FA41-8BEC-C84A-9DF1-8EC1CCDB776F

    Device                      Start               End           Sectors          Size Type
>>  Free space                   2048         143374704         143372657         68.4G                   


                  May be followed by M for MiB, G for GiB, T for TiB, or S for sectors.

(输入分区大小,挂起)

fsck /dev/sdb

fsck from util-linux 2.33.1
e2fsck 1.44.5 (15-Dec-2018)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdb

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

Found a gpt partition table in /dev/sdb

为什么会挂起?我做错了什么?

答案1

我使用 fdisk g 命令创建了一个新的空 GPT 分区表。此后,新的分区命令起作用了。不确定为什么需要这样做,因为磁盘已经标记为 Disklabel 类型:gpt。但此后它起作用了。

相关内容