Typical layoutof a FAT32partitionSizeProposeBoot sectorStore FS-specific parameters1 sector,512bytesFSINFOFree-spacemanagement1sector,512bytesReservedDon'taskme,askMicrosoft!Variable,can bechanged during format.sectorsArobustdesign:if"FAT1"isVariable.dependsondisksizeancFAT (2pieces)corrupted or containing bad sectors,clustersize.then"FAT2"canactasa backupAtleastonecluster,dependontheRoot directoryStart of the directory tree.numberof director entries.RootBootFAT1FAT2FSINFODirectorySector6
Typical layout of a FAT32 partition 6 Root Directory FAT1 FAT2 Boot Sector FSINFO Propose Size Boot sector Store FS-specific parameters 1 sector, 512 bytes FSINFO Free-space management 1 sector, 512 bytes Reserved sectors Don’t ask me, ask Micro$oft! Variable, can be changed during format. FAT (2 pieces) A robust design: if “FAT 1” is corrupted or containing bad sectors, then “FAT 2” can act as a backup. Variable, depends on disk size and cluster size. Root directory Start of the directory tree. At least one cluster, depend on the number of director entries
Typical layout of a FAT32partition$sudo mkfs.vfat-F32/dev/ramoFormatthedisk,"-F32"meansFAT32mkfs.fat3.0.28(2015-05-16)$sudodosfsck-v/dev/rameRead the informationstored inthe boot sectorRunning"dosfsck",DOsfilesystemcheck,onaFAT32FS.ThisprogramreadsdetailsfromtheBootSector.BootRootFAT1FAT2FSINFODirectorySector
Typical layout of a FAT32 partition 7 $ sudo mkfs.vfat -F32 /dev/ram0 mkfs.fat 3.0.28 (2015-05-16) . $ sudo dosfsck -v /dev/ram0 Root Directory FAT1 FAT2 Boot Sector FSINFO Format the disk, “-F32” means FAT32. Read the information stored in the boot sector. Running “dosfsck”, DOS file system check, on a FAT32 FS. This program reads details from the Boot Sector
Typical layout of a FAT32 partition$ sudo mkfs.vfat-F32/dev/ramemkfs.fat 3.0.28(2015-05-16)DetailsoftheBootSector$ sudo dosfsck-v /dev/ramefsck.fat3.0.28(2015-05-16)Checking we can access the last sector of the filesystemBoot sector contents:System ID "mkfs.fat"Media byte oxf8(hard disk)512 bytes per logical sectorThebootsectorsays:512 bytesper clusterAclusterismadeof1sector.32reserved sectorsFirst FAT starts at byte 16384 (sector 32)2 FATs, 32 bit entries516608 bytesperFAT (=1009sectors)Root directory start at cluster 2 (arbitrary size)Data area starts at byte 1049600(sector 2050)Oneclustersize:512129022data clusters(66059264bytes)bytesinthiscase卡RootBootFAT1FAT2FSINFODirectorySector32sectors8
Typical layout of a FAT32 partition 8 Root Directory FAT1 FAT2 Boot Sector FSINFO $ sudo mkfs.vfat -F32 /dev/ram0 mkfs.fat 3.0.28 (2015-05-16) . $ sudo dosfsck -v /dev/ram0 fsck.fat 3.0.28 (2015-05-16) Checking we can access the last sector of the filesystem Boot sector contents: System ID "mkfs.fat" Media byte 0xf8 (hard disk) 512 bytes per logical sector 512 bytes per cluster 32 reserved sectors First FAT starts at byte 16384 (sector 32) 2 FATs, 32 bit entries 516608 bytes per FAT (= 1009 sectors) Root directory start at cluster 2 (arbitrary size) Data area starts at byte 1049600 (sector 2050) 129022 data clusters (66059264 bytes) . The boot sector says: A cluster is made of 1 sector. One cluster size: 512 bytes in this case Details of the Boot Sector 32 sectors
Typical layoutof aFAT32partition$ sudo mkfs.vfat-F32/dev/ramemkfs.fat3.0.28(2015-05-16)$ sudo dosfsck-v /dev/ramefsck.fat3.0.28(2015-05-16)Checking we can access the last sector of the filesystemBoot sector contents:System ID "mkdosfs"Media byte xf8 (hard disk)Thebootsectorsays:512 bytes per logical sector2FATsandeachof themisof512 bytes per cluster32reserved sectorssize516,608bytes.FirstFATstarts atbyte 16384 (sector 32)2FATs, 32 bit entries516608bytesperFAT(=1009sectors)NumberofFATsandtheRoot directory start at cluster 2 (arbitrary size)lengthofeachentryinaFAT.Data area starts at byte 1049600 (sector 2050)129022dataclusters(66059264bytes)Good!Noslackspace betweenreserved sectorsofthefirstFATRootBootFAT1FAT2FSINFODirectorySector32sectors100910099
Typical layout of a FAT32 partition 9 Root Directory FAT1 FAT2 Boot Sector FSINFO $ sudo mkfs.vfat -F32 /dev/ram0 mkfs.fat 3.0.28 (2015-05-16) . $ sudo dosfsck -v /dev/ram0 fsck.fat 3.0.28 (2015-05-16) Checking we can access the last sector of the filesystem Boot sector contents: System ID "mkdosfs" Media byte 0xf8 (hard disk) 512 bytes per logical sector 512 bytes per cluster 32 reserved sectors First FAT starts at byte 16384 (sector 32) 2 FATs, 32 bit entries 516608 bytes per FAT (= 1009 sectors) Root directory start at cluster 2 (arbitrary size) Data area starts at byte 1049600 (sector 2050) 129022 data clusters (66059264 bytes) . The boot sector says: 2 FATs and each of them is of size 516,608 bytes. 32 sectors 1009 1009 Number of FATs and the length of each entry in a FAT. Good! No slack space between reserved sectors of the first FAT
Typical layoutof a FAT32partition$sudomkfs.vfat-F32/dev/ramemkfs.fat3.0.28(2015-05-16)$ sudodosfsck-v /dev/ramefsck.fat3.0.28(2015-05-16)The first data cluster isChecking we can access the last sector of the filesystemCluster#2and it isusually,Boot sector contents:notalways,therootSystem ID "mkdosfs"Media byte xf8 (hard disk)directory.512 bytes per logical sector512 bytes per clusterCluster#0 are32 reserved sectorsreserved.First FAT startsat byte 16384 (sector32)2FATs,32 bit entries516608 bytes perFAT (=1009sectors)Root directory start at cluster 2 (arbitrary size)Data area starts at byte 1049600(sector 2050)32+1009x2=2050129022 data clusters(66059264 bytes)BootRootFAT1FAT2FSINFODirectorySector1009100932sectors2050 and beyond...10
Typical layout of a FAT32 partition 10 Root Directory FAT1 FAT2 Boot Sector FSINFO $ sudo mkfs.vfat -F32 /dev/ram0 mkfs.fat 3.0.28 (2015-05-16) . $ sudo dosfsck -v /dev/ram0 fsck.fat 3.0.28 (2015-05-16) Checking we can access the last sector of the filesystem Boot sector contents: System ID "mkdosfs" Media byte 0xf8 (hard disk) 512 bytes per logical sector 512 bytes per cluster 32 reserved sectors First FAT starts at byte 16384 (sector 32) 2 FATs, 32 bit entries 516608 bytes per FAT (= 1009 sectors) Root directory start at cluster 2 (arbitrary size) Data area starts at byte 1049600 (sector 2050) 129022 data clusters (66059264 bytes) . The first data cluster is Cluster #2 and it is usually, not always, the root directory. Cluster #0 & #1 are reserved. 32 sectors 1009 1009 2050 and beyond. 32 + 1009 x 2 = 2050