{
    "content": [
        {
            "type": "text",
            "text": "# MKFS.FAT (info)\n\n## NAME\n\nmkfs.fat - create an MS-DOS FAT filesystem\n\n## SYNOPSIS\n\nmkfs.fat [OPTIONS] DEVICE [BLOCK-COUNT]\n\n## DESCRIPTION\n\nmkfs.fat  is used to create a FAT filesystem on a device or in an image\nfile.  DEVICE is the special file corresponding  to  the  device  (e.g.\n/dev/sdXX) or the image file (which does not need to exist when the op-\ntion -C is given).  BLOCK-COUNT is the number of blocks on  the  device\nand size of one block is always 1024 bytes, independently of the sector\nsize or the cluster size.   Therefore  BLOCK-COUNT  specifies  size  of\nfilesystem  in  KiB unit and not in the number of sectors (like for all\nother mkfs.fat options).  If omitted, mkfs.fat automatically chooses  a\nfilesystem size to fill the available space.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (3 subsections)\n- **BUGS**\n- **SEE ALSO**\n- **HOMEPAGE**\n- **AUTHORS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "MKFS.FAT",
        "section": "",
        "mode": "info",
        "summary": "mkfs.fat - create an MS-DOS FAT filesystem",
        "synopsis": "mkfs.fat [OPTIONS] DEVICE [BLOCK-COUNT]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Fill (fake) MBR table with disk signature one partition which starts at sector 0 (includes MBR itself) and spans whole disk de- vice. It is needed only for non-removable disks used on Microsoft Windows systems and only when formatting whole unpartitioned disk. Location of the disk signature and partition table overlaps with the end of the first FAT sector (boot code location), therefore there is no additional space usage. Default is auto mode in which mkfs.fat put MBR table only for non-removable disks when formatting whole unpartitioned disk. -n VOLUME-NAME Sets the volume name (label) of the filesystem. The volume name can be up to 11 characters long. Supplying an empty string, a string consisting only of white space or the string \"NO NAME\" as VOLUME-NAME has the same effect as not giving the -n option. The default is no label. --codepage=PAGE Use DOS codepage PAGE to encode label. By default codepage 850 is used. -r ROOT-DIR-ENTRIES Select the minimal number of entries available in the root direc- tory. The default is 112 or 224 for floppies and 512 for hard disks. Note that this is minimal number and it may be increased by mkfs.fat due to alignment of structures. See also mkfs.fat option -a. -R NUMBER-OF-RESERVED-SECTORS Select the minimal number of reserved sectors. With FAT32 format at least 2 reserved sectors are needed, the default is 32. Other- wise the default is 1 (only the boot sector). Note that this is minimal number and it may be increased by mkfs.fat due to alignment of structures. See also mkfs.fat option -a. -s SECTORS-PER-CLUSTER Specify the number of disk sectors per cluster. Must be a power of 2, i.e. 1, 2, 4, 8, ... 128. -S LOGICAL-SECTOR-SIZE Specify the number of bytes per logical sector. Must be a power of 2 and greater than or equal to 512, i.e. 512, 1024, 2048, 4096, 8192, 16384, or 32768. Values larger than 4096 are not conforming to the FAT file system specification and may not work everywhere. -v Verbose execution. --offset SECTOR Write the filesystem at a specific sector into the device file. This is useful for creating a filesystem in a partitioned disk im- age without having to set up a loop device. --variant TYPE Create a filesystem of variant TYPE. Acceptable values are stan- dard and atari (in any combination of upper/lower case). See above under DESCRIPTION for the differences."
            },
            {
                "flag": "",
                "long": "--help",
                "arg": null,
                "description": "Display option summary and exit."
            },
            {
                "flag": "",
                "long": "--invariant",
                "arg": null,
                "description": "Use constants for normally randomly generated or time based data such as volume ID and creation time. Multiple runs of mkfs.fat on the same device create identical results with this option. Its main purpose is testing mkfs.fat."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "fatlabel",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/fatlabel/8/json"
            },
            {
                "name": "fsck.fat",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/fsck.fat/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 26,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 106,
                "subsections": [
                    {
                        "name": "--mbr[=y|yes|n|no|a|auto]",
                        "lines": 57
                    },
                    {
                        "name": "--help",
                        "lines": 2,
                        "long": "--help"
                    },
                    {
                        "name": "--invariant",
                        "lines": 5,
                        "long": "--invariant"
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "HOMEPAGE",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "mkfs.fat - create an MS-DOS FAT filesystem\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "mkfs.fat [OPTIONS] DEVICE [BLOCK-COUNT]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "mkfs.fat  is used to create a FAT filesystem on a device or in an image\nfile.  DEVICE is the special file corresponding  to  the  device  (e.g.\n/dev/sdXX) or the image file (which does not need to exist when the op-\ntion -C is given).  BLOCK-COUNT is the number of blocks on  the  device\nand size of one block is always 1024 bytes, independently of the sector\nsize or the cluster size.   Therefore  BLOCK-COUNT  specifies  size  of\nfilesystem  in  KiB unit and not in the number of sectors (like for all\nother mkfs.fat options).  If omitted, mkfs.fat automatically chooses  a\nfilesystem size to fill the available space.\n\nTwo  different  variants of the FAT filesystem are supported.  Standard\nis the FAT12, FAT16 and FAT32 filesystems as defined by  Microsoft  and\nwidely  used  on  hard disks and removable media like USB sticks and SD\ncards.  The other is the legacy Atari variant used on Atari ST.\n\nIn Atari mode, if not directed otherwise by the user, mkfs.fat will al-\nways  use 2 sectors per cluster, since GEMDOS doesn't like other values\nvery much.  It will also obey the maximum number of sectors GEMDOS  can\nhandle.   Larger  filesystems are managed by raising the logical sector\nsize.  An Atari-compatible serial number for the filesystem  is  gener-\nated,  and  a  12 bit FAT is used only for filesystems that have one of\nthe usual floppy sizes (720k, 1.2M, 1.44M, 2.88M), a 16 bit FAT  other-\nwise.   This  can  be  overridden with the -F option.  Some PC-specific\nboot sector fields aren't written, and a boot message  (option  -m)  is\nignored.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "-a  Normally,  for any filesystem except very small ones, mkfs.fat will\nalign all the data structures to cluster size, to make sure that as\nlong  as  the  partition  is properly aligned, so will all the data\nstructures in the filesystem.  This option disables alignment; this\nmay  provide a handful of additional clusters of storage at the ex-\npense of a significant performance degradation on RAIDs, flash  me-\ndia or large-sector hard disks.\n\n-A  Select  using  the  Atari  variation  of the FAT filesystem if that\nisn't active already, otherwise  select  standard  FAT  filesystem.\nThis is selected by default if mkfs.fat is run on 68k Atari Linux.\n\n-b SECTOR-OF-BACKUP\nSelects  the location of the backup boot sector for FAT32.  Default\ndepends on number of reserved sectors, but usually is sector 6.  If\nthere  is  a free space available after the backup boot sector then\nbackup of the FAT32 info sector is put after the backup  boot  sec-\ntor,  usually  at sector 7.  The backup must be within the range of\nreserved sectors.  Value 0 completely disables creating  of  backup\nboot and info FAT32 sectors.\n\n-c  Check the device for bad blocks before creating the filesystem.\n\n-C  Create  the file given as DEVICE on the command line, and write the\nto-be-created filesystem to it.  This can be used to create the new\nfilesystem  in a file instead of on a real device, and to avoid us-\ning dd in advance to create a file of appropriate size.  With  this\noption,  the  BLOCK-COUNT  must be given, because otherwise the in-\ntended size of the filesystem wouldn't be known.  The file  created\nis  a sparse file, which actually only contains the meta-data areas\n(boot sector, FATs, and root directory).  The data  portions  won't\nbe stored on the disk, but the file nevertheless will have the cor-\nrect size.  The resulting file can be copied later to a floppy disk\nor other device, or mounted through a loop device.\n\n-D DRIVE-NUMBER\nSpecify  the BIOS drive number to be stored in the FAT boot sector.\nFor hard disks and removable medias it is usually  0x80-0xFF  (0x80\nis  first  hard  disk  C:,  0x81  is second hard disk D:, ...), for\nfloppy devices or partitions to be used for floppy emulation it  is\n0x00-0x7F (0x00 is first floppy A:, 0x01 is second floppy B:).\n\n-f NUMBER-OF-FATS\nSpecify  the  number  of  file allocation tables in the filesystem.\nThe default is 2.\n\n-F FAT-SIZE\nSpecifies the type of file allocation tables used  (12,  16  or  32\nbit).   If nothing is specified, mkfs.fat will automatically select\nbetween 12, 16 and 32 bit, whatever fits better for the  filesystem\nsize.\n\n-g HEADS/SECTORS-PER-TRACK\nSpecify  HEADS  and SECTORS-PER-TRACK numbers which represents disk\ngeometry of DEVICE.  Both numbers are stored into the FAT boot sec-\ntor.   Number SECTORS-PER-TRACK is used also for aligning the total\ncount of FAT sectors.  By default disk geometry is read from DEVICE\nitself.   If  it  is  not available then LBA-Assist Translation and\ntranslation table from the SD Card Part 2 File System Specification\nbased on total number of disk sectors is used.\n\n-h NUMBER-OF-HIDDEN-SECTORS\nSpecify  the  number  of so-called hidden sectors, as stored in the\nFAT boot sector: this number represents the beginning sector of the\npartition  containing  the file system.  Normally this is an offset\n(in sectors) relative to the start of the disk,  although  for  MBR\nlogical  volumes contained in an extended partition of type 0x05 (a\nnon-LBA extended partition), a quirk in the  MS-DOS  implementation\nof FAT requires it to be relative to the partition's immediate con-\ntaining Extended Boot Record.  Boot code and  other  software  han-\ndling  FAT  volumes  may  also rely on this field being set up cor-\nrectly; most modern FAT implementations will  ignore  it.   By  de-\nfault, if the DEVICE is a partition block device, mkfs.fat uses the\npartition offset relative to disk start.  Otherwise,  mkfs.fat  as-\nsumes zero.  Use this option to override this behaviour.\n\n-i VOLUME-ID\nSets  the volume ID of the newly created filesystem; VOLUME-ID is a\n32-bit hexadecimal number (for example, 2e24ec82).  The default  is\na number which depends on the filesystem creation time.\n\n-I  Ignore  and  disable safety checks.  By default mkfs.fat refuses to\ncreate a filesystem on a device with partitions or virtual mapping.\nmkfs.fat  will complain and tell you that it refuses to work.  This\nis different when using MO disks.  One doesn't always  need  parti-\ntions  on  MO  disks.   The filesystem can go directly to the whole\ndisk.  Under other OSes this is known as  the  superfloppy  format.\nThis switch will force mkfs.fat to work properly.\n\n-l FILENAME\nRead the bad blocks list from FILENAME.\n\n-m MESSAGE-FILE\nSets  the  message  the  user  receives  on  attempts  to boot this\nfilesystem without having properly installed an  operating  system.\nThe  message  file  must  not exceed 418 bytes once line feeds have\nbeen converted to carriage return-line feed combinations, and  tabs\nhave  been  expanded.  If the filename is a hyphen (-), the text is\ntaken from standard input.\n\n-M FAT-MEDIA-TYPE\nSpecify the media type to be stored in the FAT boot  sector.   This\nvalue  is  usually  0xF8 for hard disks and is 0xF0 or a value from\n0xF9 to 0xFF for floppies or partitions to be used for floppy  emu-\nlation.\n",
                "subsections": [
                    {
                        "name": "--mbr[=y|yes|n|no|a|auto]",
                        "content": "Fill  (fake)  MBR  table  with  disk  signature one partition which\nstarts at sector 0 (includes MBR itself) and spans whole  disk  de-\nvice.   It is needed only for non-removable disks used on Microsoft\nWindows systems and only when formatting whole unpartitioned  disk.\nLocation  of  the  disk signature and partition table overlaps with\nthe end of the first FAT sector  (boot  code  location),  therefore\nthere  is no additional space usage.  Default is auto mode in which\nmkfs.fat put MBR table only for non-removable disks when formatting\nwhole unpartitioned disk.\n\n-n VOLUME-NAME\nSets  the  volume  name (label) of the filesystem.  The volume name\ncan be up to 11 characters long.   Supplying  an  empty  string,  a\nstring  consisting  only  of white space or the string \"NO NAME\" as\nVOLUME-NAME has the same effect as not giving the -n  option.   The\ndefault is no label.\n\n--codepage=PAGE\nUse  DOS codepage PAGE to encode label.  By default codepage 850 is\nused.\n\n-r ROOT-DIR-ENTRIES\nSelect the minimal number of entries available in the  root  direc-\ntory.   The  default  is  112  or 224 for floppies and 512 for hard\ndisks.  Note that this is minimal number and it may be increased by\nmkfs.fat  due to alignment of structures.  See also mkfs.fat option\n-a.\n\n-R NUMBER-OF-RESERVED-SECTORS\nSelect the minimal number of reserved sectors.  With  FAT32  format\nat  least 2 reserved sectors are needed, the default is 32.  Other-\nwise the default is 1 (only the boot sector).  Note  that  this  is\nminimal number and it may be increased by mkfs.fat due to alignment\nof structures.  See also mkfs.fat option -a.\n\n-s SECTORS-PER-CLUSTER\nSpecify the number of disk sectors per cluster.  Must be a power of\n2, i.e. 1, 2, 4, 8, ... 128.\n\n-S LOGICAL-SECTOR-SIZE\nSpecify the number of bytes per logical sector.  Must be a power of\n2 and greater than or equal to 512, i.e.  512,  1024,  2048,  4096,\n8192,  16384, or 32768.  Values larger than 4096 are not conforming\nto the FAT file system specification and may not work everywhere.\n\n-v  Verbose execution.\n\n--offset SECTOR\nWrite the filesystem at a specific sector  into  the  device  file.\nThis  is useful for creating a filesystem in a partitioned disk im-\nage without having to set up a loop device.\n\n--variant TYPE\nCreate a filesystem of variant TYPE.  Acceptable values  are  stan-\ndard and atari (in any combination of upper/lower case).  See above\nunder DESCRIPTION for the differences.\n"
                    },
                    {
                        "name": "--help",
                        "content": "Display option summary and exit.\n",
                        "long": "--help"
                    },
                    {
                        "name": "--invariant",
                        "content": "Use constants for normally randomly generated or  time  based  data\nsuch  as volume ID and creation time.  Multiple runs of mkfs.fat on\nthe same device create identical results  with  this  option.   Its\nmain purpose is testing mkfs.fat.\n",
                        "long": "--invariant"
                    }
                ]
            },
            "BUGS": {
                "content": "mkfs.fat  can  not create boot-able filesystems.  This isn't as easy as\nyou might think at first glance for various reasons and has  been  dis-\ncussed a lot already.  mkfs.fat simply will not support it ;)\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "fatlabel(8), fsck.fat(8)\n",
                "subsections": []
            },
            "HOMEPAGE": {
                "content": "The  home  for  the  dosfstools  project  is  its  GitHub  project page\n<https://github.com/dosfstools/dosfstools>.\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "dosfstools were  written  by  Werner  Almesberger  <werner.almesberger@\nlrc.di.epfl.ch>,  Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>,\nand others.  Current maintainers are Andreas Bombe <aeb@debian.org> and\nPali Rohar <pali.rohar@gmail.com>.\n\ndosfstools 4.2                    2021-01-31                       MKFS.FAT(8)",
                "subsections": []
            }
        }
    }
}