fdiskユーティリティにパーティションが表示されない

fdiskユーティリティにパーティションが表示されない

私はここ数時間で苦労しました。

次のコマンドを使用して既存のパーティションをすべて削除し(ほぼマウント解除されている)、リムーバブルUSBメディアに新しいパーティションを作成します。

$ sudo fdisk /dev/sdb1

Command (m for help): n

Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-30296063, default 2048): 2048
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-30296063, default 30296063): 30296063
Created a new partition 1 of type 'Linux' and of size 14,5 GiB.

次に、次のコマンドを使用してパーティションのタイプを変更します。

Command (m for help): t
Hex code (type L to list all codes): c
Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

適用された変更:

Command (m for help): w
The partition table has been altered.
Syncing disks.

カーネルに変更を通知します。

$ sudo partprobe

今まではそんなに良くなった。その後、新しいパーティションにFAT32ファイルシステムを作成しました。

$ sudo mkfs -t vfat /dev/sdb1
mkfs.fat 4.1 (2017-01-24)

デバイスを仮想ディレクトリにマウントします。

$ sudo mount /dev/sdb1 /media/xxx

すべてが問題ないようですが、fdiskユーティリティを使用してデバイスのパーティションを再確認したい場合:

$ sudo fdisk /dev/sdb1
Disk /dev/sdb1: 14,5 GiB, 15511584768 bytes, 30296064 sectors
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: dos
Disk identifier: 0x00000000

奇妙なディスク識別子とパーティションテーブルはまったくありません(なぜ?)。しかし、このコマンドを実行すると:

$ sudo fdisk -l
Disk /dev/sdb: 14,5 GiB, 15518924800 bytes, 30310400 sectors
Disk model: TransMemory     
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: dos
Disk identifier: 0x03eba3c3

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdb1        2048 30298111 30296064 14,5G  b W95 FAT32

はい、パーティションテーブルはここにありますが、パーティションタイプはW95 FAT32(LBA)ではなくW95 FAT32です。それでは、私が何を間違っているのでしょうか?この動作は正常ですか?

ベストアンサー1

fdisk個々のパーティションではなくディスク全体で動作します。つまり、 を使用しますfdisk -l /dev/sdb

おすすめ記事