0

I've been struggling with this couple of hours now.

Deleted all existing partitions and created a new one on (virtually unmounted) removable USB media using:

$ 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.

and then changed partition type using:

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

applied changes:

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

informing kernel for changes:

$ sudo partprobe

So far so good. After that, i've created FAT32 filesystem on the new partition:

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

mounting the device to virtual directory:

$ sudo mount /dev/sdb1 /media/xxx

Everything seems to be okay but when i want to check partitions on the device again using fdisk utility:

$ 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

ends up with strange disk identifier and no partition table at all (why?). But when i run this command:

$ 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

yep, partition table is here but partition type is W95 FAT32 instead of W95 FAT32 (LBA). so what am i doing wrong? is this behaviour normal?

  • fdisk operates on the disk as a whole, and not the individual partotions. I.e., use fdisk -l /dev/sdb. – Ralph Rönnquist Sep 8 at 10:50
  • i am an idiot. thanks for correctly pointing out. this should be the correct answer. post this. – linx Sep 10 at 8:00
0

fdisk operates on the disk as a whole, and not the individual partitions. I.e., use fdisk -l /dev/sdb.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.