---
name: "fsck_msdos"
section: "8"
platform: "macos"
package: "msdosfs"
version: "788.100.31"
release: "macOS 26.5"
platforms: ["openbsd", "macos"]
url: "https://new.carta.tech/fsck_msdos"
---

# fsck\_msdos(8)

DOS/Windows (FAT) file system consistency check

## NAME

**fsck\_msdos** – DOS/Windows (FAT) file system consistency check

## SYNOPSIS

**fsck\_msdos** **-q** *special* *...*

**fsck\_msdos** **-p** \[**-f**\] *special* *...*

**fsck\_msdos** \[**-fny**\] *special* *...*

## DESCRIPTION

The **fsck\_msdos** utility verifies and repairs FAT file systems (more commonly known as DOS file systems).

The first form of **fsck\_msdos** quickly checks the specified file systems to determine whether they were cleanly unmounted.

The second form of **fsck\_msdos** preens the specified file systems. It is normally started by [fsck(8)](/fsck/8.md) run from */etc/rc.boot* during automatic reboot, when a FAT file system is detected. When preening file systems, **fsck\_msdos** will fix common inconsistencies non-interactively.  If more serious problems are found, **fsck\_msdos** does not try to fix them, indicates that it was not successful, and exits.

The third form of **fsck\_msdos** checks the specified file systems and tries to repair all detected inconsistencies, requesting confirmation before making any changes.  The default behavior is to always ask for confirmation of each change.  Use the -n or -y options to override this default behavior.

The options are as follows:

- **-q**

  Causes **fsck\_msdos** to quickly check whether the volume was unmounted cleanly. If the volume was unmounted cleanly, then the exit status is 0. If the volume was not unmounted cleanly, then the exit status will be non-zero.  In either case, a message is printed to standard output describing whether the volume was clean or dirty.

- **-f**

  This option is ignored by **fsck\_msdos** and is present only for compatibility with programs that check other file system types for consistency.

- **-n**

  Causes **fsck\_msdos** to assume no as the answer to all operator questions, except “CONTINUE?”.

- **-p**

  Preen the specified file systems.

- **-y**

  Causes **fsck\_msdos** to assume yes as the answer to all operator questions.

- **-M**

  Limits the amount of memory used by **fsck\_msdos**.

- **-S** *directory*

  Causes **fsck\_msdos** to create a shadow file containing all metadata read from the device in the given directory. This functionality is intended for inclusion with bug reports regarding excpetional problems. One file is created for each checked device. **fsck\_msdos** may re-read metadata from disk at different phases of the repair process. If the repair process has repaired the metadata, the shadow file will capture its state as last read from disk. For optimal debug value, the shadow file should be captured in conjunction with the -n option. The shadow file's name will be shadow-diskXsY or shadow-fd\<X\>, depends on the information given to **fsck\_msdos**. If this file already exists, **fsck\_msdos** will attempt to add a counter postfix to the name. The resulting shadow file can be mounted by diskimagetool. Failure to generate or write to the shadow file will not affect the behavior of **fsck\_msdos**.

## EXIT VALUES

**fsck\_msdos** exits with a value of 0 when the filesystem is clean (or has been repaired), and 8 otherwise.

## SEE ALSO

[fsck(8)](/fsck/8.md)
