{
    "mode": "man",
    "parameter": "dosfsck",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/dosfsck/8/json",
    "generated": "2026-06-02T21:26:40Z",
    "synopsis": "fsck.fat [OPTIONS] DEVICE",
    "sections": {
        "NAME": {
            "content": "fsck.fat - check and repair MS-DOS FAT filesystems\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "fsck.fat [OPTIONS] DEVICE\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "fsck.fat verifies the consistency of MS-DOS filesystems and optionally tries to repair them.\n\nThe following filesystem problems can be corrected (in this order):\n\n•   FAT contains invalid cluster numbers.  Cluster is changed to EOF.\n\n•   File's cluster chain contains a loop.  The loop is broken.\n\n•   Bad  clusters (read errors).  The clusters are marked bad and they are removed from files\nowning them.  This check is optional.\n\n•   Directories with a large number of bad entries (probably corrupt).  The directory can  be\ndeleted.\n\n•   Files . and .. are non-directories.  They can be deleted or renamed.\n\n•   Directories . and .. in root directory.  They are deleted.\n\n•   Bad filenames.  They can be renamed.\n\n•   Duplicate directory entries.  They can be deleted or renamed.\n\n•   Directories with non-zero size field.  Size is set to zero.\n\n•   Directory . does not point to parent directory.  The start pointer is adjusted.\n\n•   Directory  ..  does  not  point  to parent of parent directory.  The start pointer is ad‐\njusted.\n\n•   . and .. are not the two first entries in a non-root directory.  The entries are created,\nmoving occupied slots if necessary.\n\n•   Start cluster number of a file is invalid.  The file is truncated.\n\n•   File contains bad or free clusters.  The file is truncated.\n\n•   File's cluster chain is longer than indicated by the size fields.  The file is truncated.\n\n•   Two or more files share the same cluster(s).  All but one of the files are truncated.  If\nthe file being truncated is a directory file that has already been read,  the  filesystem\ncheck is restarted after truncation.\n\n•   File's  cluster  chain  is  shorter than indicated by the size fields.  The file is trun‐\ncated.\n\n•   Volume label in root directory or label in boot sector is invalid.   Invalid  labels  are\nremoved.\n\n•   Volume label in root directory and label in boot sector are different.  Volume label from\nroot directory is copied to boot sector.\n\n•   Clusters are marked as used but are not owned by a file.  They are marked as free.\n\nAdditionally, the following problems are detected, but not repaired:\n\n•   Invalid parameters in boot sector\n\nWhen fsck.fat checks a filesystem, it accumulates all changes in  memory  and  performs  them\nonly after all checks are complete.  This can be disabled with the -w option.\n\nTwo different variants of the FAT filesystem are supported.  Standard is the FAT12, FAT16 and\nFAT32 filesystems as defined by Microsoft and widely used on hard disks and  removable  media\nlike USB sticks and SD cards.  The other is the legacy Atari variant used on Atari ST.\n\nThere  are  some  minor  differences in Atari format: Some boot sector fields are interpreted\nslightly different, and the special FAT entries for end-of-file and bad cluster can  be  dif‐\nferent.   Under  MS-DOS  0xfff8 is used for EOF and Atari employs 0xffff by default, but both\nsystems recognize all values from 0xfff8–0xffff as end-of-file.  MS-DOS uses only 0xfff7  for\nbad  clusters,  where  on  Atari  values 0xfff0–0xfff7 are for this purpose (but the standard\nvalue is still 0xfff7).\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-a",
                    "content": "is more than one method to solve a problem, the least destructive approach is used.\n",
                    "flag": "-a"
                },
                {
                    "name": "-A",
                    "content": "erwise select standard FAT filesystem.  This is selected by default if mkfs.fat is run on\n68k Atari Linux.\n",
                    "flag": "-A"
                },
                {
                    "name": "-b",
                    "content": "",
                    "flag": "-b"
                },
                {
                    "name": "-c",
                    "content": "Use DOS codepage PAGE to decode short file names.  By default codepage 850 is used.\n",
                    "flag": "-c"
                },
                {
                    "name": "-d",
                    "content": "Delete  the specified file.  If more than one file with that name exist, the first one is\ndeleted.  This option can be given more than once.\n",
                    "flag": "-d"
                },
                {
                    "name": "-f",
                    "content": "free disk space except in auto mode (-a).\n",
                    "flag": "-f"
                },
                {
                    "name": "-F",
                    "content": "Specify  FAT table NUM for filesystem access.  By default value 0 is assumed and then the\nfirst uncorrupted FAT table is chosen.  Uncorrupted means that FAT table has valid  first\ncluster.  If default value 0 is used and all FAT tables are corrupted then fsck.fat gives\nup and does not try to repair FAT filesystem.  If non-zero NUM value  is  specified  then\nfsck.fat uses FAT table NUM for repairing FAT filesystem.  If FAT table NUM has corrupted\nfirst cluster then fsck.fat will repair it.  In any case, if FAT filesystem has more  FAT\ntables  then  repaired content of chosen FAT table is copied to other FAT tables.  To re‐\npair corrupted first cluster it is required to call fsck.fat with non-zero NUM value.\n",
                    "flag": "-F"
                },
                {
                    "name": "-l",
                    "content": "",
                    "flag": "-l"
                },
                {
                    "name": "-n",
                    "content": "filesystem.\n",
                    "flag": "-n"
                },
                {
                    "name": "-p -a",
                    "content": "",
                    "flag": "-a"
                },
                {
                    "name": "-r",
                    "content": "than one approach to fix an inconsistency.  This is the default mode and  the  option  is\nonly retained for backwards compatibility.\n",
                    "flag": "-r"
                },
                {
                    "name": "-S",
                    "content": "versions of this program did.  While such file names are not forbidden by the FAT  speci‐\nfication,  and were never treated as errors by Microsoft file system checking tools, many\nDOS programs are unable to handle files with such names.  Using this option can make them\naccessible to these programs.\n\nShort  file  names which start with a space are considered invalid regardless of this op‐\ntion's setting.\n\nPrevious versions of this program exceptionally treated EA DATA. SF and WP  ROOT.  SF  as\nvalid short names; using this option does not preserve that exception.\n",
                    "flag": "-S"
                },
                {
                    "name": "-t",
                    "content": "",
                    "flag": "-t"
                },
                {
                    "name": "-u",
                    "content": "Try to undelete the specified file.  fsck.fat tries to allocate a chain of contiguous un‐\nallocated clusters beginning with the start cluster of the undeleted file.   This  option\ncan be given more than once.\n",
                    "flag": "-u"
                },
                {
                    "name": "-U",
                    "content": "Such labels are forbidden by the FAT specification, but they are  widely  used  by  Linux\ntools.  Moreover MS-DOS and Windows systems do not have problems to read them.  Therefore\nvolume and boot labels with lowercase characters are by default permitted.\n",
                    "flag": "-U"
                },
                {
                    "name": "-v",
                    "content": "",
                    "flag": "-v"
                },
                {
                    "name": "-V",
                    "content": "second pass should never report any fixable errors.  It may take considerably longer than\nthe first pass, because the first pass may have generated long list of modifications that\nhave to be scanned for each disk read.\n\n--variant TYPE\nCreate  a  filesystem  of variant TYPE.  Acceptable values are standard and atari (in any\ncombination of upper/lower case).  See above under DESCRIPTION for the differences.\n",
                    "flag": "-V"
                },
                {
                    "name": "-w",
                    "content": "",
                    "flag": "-w"
                },
                {
                    "name": "-y -a",
                    "content": "",
                    "flag": "-a"
                },
                {
                    "name": "--help",
                    "content": "Display help message describing usage and options then exit.\n",
                    "long": "--help"
                }
            ]
        },
        "EXIT STATUS": {
            "content": "0   No recoverable errors have been detected.\n\n1   Recoverable errors have been detected or fsck.fat has discovered  an  internal  inconsis‐\ntency.\n\n2   Usage error.  fsck.fat did not access the filesystem.\n",
            "subsections": []
        },
        "FILES": {
            "content": "fsck0000.rec, fsck0001.rec, ...\nWhen  recovering  from  a  corrupted filesystem, fsck.fat dumps recovered data into files\nnamed fsckNNNN.rec in the top level directory of the filesystem.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "•   Does not remove entirely empty directories.\n\n•   Should give more diagnostic messages.\n\n•   Undeleting files should use a more sophisticated algorithm.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "fatlabel(8), mkfs.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@lrc.di.epfl.ch⟩, Roman\nHodek ⟨Roman.Hodek@informatik.uni-erlangen.de⟩, and others.  Current maintainers are  Andreas\nBombe ⟨aeb@debian.org⟩ and Pali Rohár ⟨pali.rohar@gmail.com⟩.\n\n\n\ndosfstools 4.2                               2021-01-31                                  FSCK.FAT(8)",
            "subsections": []
        }
    },
    "summary": "fsck.fat - check and repair MS-DOS FAT filesystems",
    "flags": [
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "is more than one method to solve a problem, the least destructive approach is used."
        },
        {
            "flag": "-A",
            "long": null,
            "arg": null,
            "description": "erwise select standard FAT filesystem. This is selected by default if mkfs.fat is run on 68k Atari Linux."
        },
        {
            "flag": "-b",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "Use DOS codepage PAGE to decode short file names. By default codepage 850 is used."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "Delete the specified file. If more than one file with that name exist, the first one is deleted. This option can be given more than once."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "free disk space except in auto mode (-a)."
        },
        {
            "flag": "-F",
            "long": null,
            "arg": null,
            "description": "Specify FAT table NUM for filesystem access. By default value 0 is assumed and then the first uncorrupted FAT table is chosen. Uncorrupted means that FAT table has valid first cluster. If default value 0 is used and all FAT tables are corrupted then fsck.fat gives up and does not try to repair FAT filesystem. If non-zero NUM value is specified then fsck.fat uses FAT table NUM for repairing FAT filesystem. If FAT table NUM has corrupted first cluster then fsck.fat will repair it. In any case, if FAT filesystem has more FAT tables then repaired content of chosen FAT table is copied to other FAT tables. To re‐ pair corrupted first cluster it is required to call fsck.fat with non-zero NUM value."
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "filesystem."
        },
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-r",
            "long": null,
            "arg": null,
            "description": "than one approach to fix an inconsistency. This is the default mode and the option is only retained for backwards compatibility."
        },
        {
            "flag": "-S",
            "long": null,
            "arg": null,
            "description": "versions of this program did. While such file names are not forbidden by the FAT speci‐ fication, and were never treated as errors by Microsoft file system checking tools, many DOS programs are unable to handle files with such names. Using this option can make them accessible to these programs. Short file names which start with a space are considered invalid regardless of this op‐ tion's setting. Previous versions of this program exceptionally treated EA DATA. SF and WP ROOT. SF as valid short names; using this option does not preserve that exception."
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-u",
            "long": null,
            "arg": null,
            "description": "Try to undelete the specified file. fsck.fat tries to allocate a chain of contiguous un‐ allocated clusters beginning with the start cluster of the undeleted file. This option can be given more than once."
        },
        {
            "flag": "-U",
            "long": null,
            "arg": null,
            "description": "Such labels are forbidden by the FAT specification, but they are widely used by Linux tools. Moreover MS-DOS and Windows systems do not have problems to read them. Therefore volume and boot labels with lowercase characters are by default permitted."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": "second pass should never report any fixable errors. It may take considerably longer than the first pass, because the first pass may have generated long list of modifications that have to be scanned for each disk read. --variant TYPE Create a filesystem of variant TYPE. Acceptable values are standard and atari (in any combination of upper/lower case). See above under DESCRIPTION for the differences."
        },
        {
            "flag": "-w",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": "--help",
            "arg": null,
            "description": "Display help message describing usage and options then exit."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "fatlabel",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/fatlabel/8/json"
        },
        {
            "name": "mkfs.fat",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/mkfs.fat/8/json"
        }
    ]
}