32

I read in an Internet article to format a partition to FAT32 with the following command:

sudo mkfs.vfat -F 32 /dev/sdXn

Now I read the man page for mkfs.vfat and it shows mkfs.fat as the name of the command without the v. After that I tried formatting a partition without the v and expectedly it worked. Why is there a synonymous command called mkfs.vfat instead of just mkfs.fat?

Edit: Oh, and in man mkfs mkfs.vfat is listed instead of mkfs.fat in "SEE ALSO".

mkdrive2
  • 662
  • 2
    https://en.wikipedia.org/wiki/File_Allocation_Table#VFAT - this has nothing to do with Unix or Linux. – Mat Feb 16 '16 at 12:47
  • vfat filesystem are used in linux world (for instance, I create vfat floppy image to transmit information/files to a system with no network and ILO/ILOM interface, or tu use kickstart file for redhat installation). – Archemar Feb 16 '16 at 13:22
  • @Archemar: Uh, from the Wiki article above it seems VFAT is a Microsoft invention and Linux only supports it... – mkdrive2 Feb 16 '16 at 13:27
  • 1
    http://stackoverflow.com/questions/11928982/what-is-the-difference-between-vfat-and-fat32-file-systems – Ciro Santilli OurBigBook.com Oct 14 '16 at 22:10

1 Answers1

35

FAT is a family of filesystems, comprising at least, in chronological order:

  • FAT12, a filesystem used on floppies since the late 1980s, in particular by MS-DOS;
  • FAT16, a small modification of FAT12 supporting larger media, introduced to support hard disks;
  • vFAT, which is backward compatible with FAT, but allows files to have longer names which only vFAT-aware applications running on vFAT-aware operating systems can see;
  • FAT32, another modification of FAT16 designed to support larger disk sizes. In practice FAT32 is almost always used with vFAT long file name support, but technically 16/32 and long-file-names-yes/no are independent.

Because those filesystems are very similar, they're usually handled by the same drivers and tools. mkfs.vfat and mkfs.fat are the same tool; an empty FAT16 filesystem and an empty vFAT filesystem look exactly the same, so mkfs doesn't need to distinguish between them. (You can think of FAT16 and vFAT as two different ways of seeing the same filesystem rather than two separate filesystem formats.)

  • Did I understand it right that in vFAT additional hidden files are added and the filenames are concatenated for the longer filenames? – mkdrive2 Feb 17 '16 at 09:30
  • 2
    @mkdrive2 Yes (well, more precisely, these are hidden directory entries that FAT16-only systems treat as unused and vFAT systems treat as giving a long file name to a file in that directory). – Gilles 'SO- stop being evil' Feb 17 '16 at 09:57