Wrong filesystem when formatting a USB stick (linux)

2

I used a USB stick to install a Linux distribution. Then i wanted to re-used this usb for personal data. I remove the iso signature with

wipefs -a /dev/sdb

then

fdisk /dev/sdb

I typed o to create a new empty DOS partition

I typed n to add a new partition, with the following options: primary, partition number 1, first/last sector as default

Finally I typed

mkdosfs -F 32 /dev/sdb1

However the command

fdisk -l /deb/sdb

gives

Disk /dev/sdb: 1,9 GiB, 2004877312 bytes, 3915776 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: 0x674f2fa6

Device     Boot  Start  End      Sectors  Size  Id  Type 
/dev/sdb1        2048   3915775  3913728  1,9G  83  Linux

Why is the type Linux and not FAT 32?

user631800

Posted 2016-08-19T13:48:49.993

Reputation:

Answers

1

The type you observe in fdisk output is set in the partition table and is independent to the actual filesystem. Tools like mkdosfs do not touch partition table. It is a good thing, it corresponds to the Unix Philosophy where one tool should do one job and do it well. The target of mkfs.* may be a whole device or even a regular file; there is no partition table in these cases. The tool doesn't wander and seek partition table to update.

The type should match with actual filesystem on partition but it's the user's (root's, admin's) job to match them.

Invoke fdisk /dev/sdb, give the command t and follow instructions. At some point you will be able to check all available types by typing L. I believe you should choose c (or equivalent 0C) for FAT32 partition.

Kamil Maciorowski

Posted 2016-08-19T13:48:49.993

Reputation: 38 429