1

If i want to create fat16 partition, what i have to do is:

fdisk command

  1. Create partition
  2. Change the partition type to FAT16 by selecting t for ‘type’ and e for ‘W95 FAT16 (LBA)’.

mkfs.vfat command

  1. Format partition by: mkfs.vfat /dev/sdX1

Q1) Why wouldn't I write mkfs.vfat -F16 /dev/sdX1
Q2) What is the difference between step 2 and step 3? Are both mandatory? For example, can we do step2 by adding extra parameters in step3?
Q3) Is there a command that shows the partitions are made correctly in linux?

MC68020
  • 6,281
  • 2
  • 13
  • 44
Qwe Qwe
  • 113
  • 3
  • 1
    @MC68020 Can we say that "partition type" is only hint about "file system". Even linux doesn't even look at partition type.(So step 3 mandotary for linux but step 2 not) Right? – Qwe Qwe Nov 08 '22 at 12:57
  • 1
    @MC68020 Also i have to mention the file system type with -F16 parameter. Because If nothing is specified, mkdosfs will automatically select between 12, 16 and 32 bit according to doc. – Qwe Qwe Nov 08 '22 at 12:59
  • 1
    Yes indeed! Step 3 is mandatory and not only for Linux. For whatever OS willing to use that filesystem. For what concerns the "partition type" it serves no other purpose that what is stated as part of the man fdisk ( https://man7.org/linux/man-pages/man8/fdisk.8.html ) description of the **-t** option. – MC68020 Nov 08 '22 at 13:02
  • 1
    Regarding your last comment : Yes indeed you must specify the -F parameter unless you accept letting mkfs choosing what it thinks being the "best option" between 12, 16 and 32. Best choice being based on the logical sector size and the number of sectors in the partition. – MC68020 Nov 08 '22 at 13:10
  • @MC68020 if i select partition type in fdisk command as a W95 FAT16 and select fs type as a fat32 in mkfs.vfat, Does an error occur or is fat32 accepted for linux systems? probably an error occurs for windows systems. – Qwe Qwe Nov 08 '22 at 13:14
  • @MC68020 for example https://www.redips.net/linux/create-fat32-usb-drive/ in that tutorial, author didnt specify fat bit in mkfs.vfat command – Qwe Qwe Nov 08 '22 at 13:17
  • 1
    I can't tell what would happen under window systems since I don't use any. I would only presume that it could cause some problem if that partition is made bootable since the MBR would be impacted. Nothing wrong would happen under Linux. What modern OS would like to resort on such undocumented and non standard information ? See the overview in https://en.wikipedia.org/wiki/Partition_type – MC68020 Nov 08 '22 at 13:37

1 Answers1

2

Only answering Q3 since Q1 and Q2 are answered in Why do we need to specify partition type in fdisk and later again in mkfs?

Is there an command that shows the partitions are made correctly in linux?

fdisk, parted or whatever utility used for partitioning will always either fail creating the partition or succeed in that operation.

If they succeed then, the partition has necessarily been created "correctly" (understood as according to the ranges of blocks you had specified.)

Depending on the starting block you specified. Its alignment might not enable optimized disk accesses. This potentially degrading performances.

You can actually check for that using parted align-check command.

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
MC68020
  • 6,281
  • 2
  • 13
  • 44