- Create a 10MB file filled with NULL bytes
$ dd if=/dev/zero of=/tmp/blank_fat.img bs=512 count=20480
20480+0 records in
20480+0 records out
10485760 bytes (10 MB, 10 MiB) copied, 0.100005 s, 105 MB/s
- Create a FAT16 filesystem inside that blank file (other options could be specified).
$ mkfs.fat -F 16 /tmp/blank_fat.img
mkfs.fat 3.0.28 (2015-05-16)
$ file -k /tmp/blank_fat.img
/tmp/blank_fat.img: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "mkfs.fat", sectors/cluster 4, root entries 512, sectors 20480 (volumes <=32 MB) , Media descriptor 0xf8, sectors/FAT 20, sectors/track 32, heads 64, serial number 0xc48dae45, unlabeled, FAT (16 bit)\012- DOS/MBR boot sector, mkdosfs boot message display "This is not a bootable disk. Please insert a bootable floppy a" DOS/MBR boot sector DOS executable (COM), boot code\012- data
$ fsstat /tmp/blank_fat.img
FILE SYSTEM INFORMATION
--------------------------------------------
File System Type: FAT16
OEM Name: mkfs.fat
Volume ID: 0xc48dae45
Volume Label (Boot Sector): NO NAME
Volume Label (Root Directory):
File System Type Label: FAT16
Sectors before file system: 0
File System Layout (in sectors)
Total Range: 0 - 20479
* Reserved: 0 - 0
** Boot Sector: 0
* FAT 0: 1 - 20
* FAT 1: 21 - 40
* Data Area: 41 - 20479
** Root Directory: 41 - 72
** Cluster Area: 73 - 20476
** Non-clustered: 20477 - 20479
METADATA INFORMATION
--------------------------------------------
Range: 2 - 327030
Root Directory: 2
CONTENT INFORMATION
--------------------------------------------
Sector Size: 512
Cluster Size: 2048
Total Cluster Range: 2 - 5102
FAT CONTENTS (in sectors)
--------------------------------------------