253 lines
7.4 KiB
HTML
253 lines
7.4 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of FSCK.FAT</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>FSCK.FAT</H1>
|
|
Section: Maintenance Commands (8)<BR>Updated: 2015-04-16<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
<B>fsck.fat</B> - check and repair MS-DOS filesystems
|
|
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>fsck.fat</B> [<I>OPTIONS</I>] <I>DEVICE</I>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<B>fsck.fat</B> verifies the consistency of MS-DOS filesystems and optionally
|
|
tries to repair them.
|
|
<P>
|
|
|
|
The following filesystem problems can be corrected (in this order):
|
|
<DL COMPACT>
|
|
<DT id="1">*<DD>
|
|
FAT contains invalid cluster numbers.
|
|
Cluster is changed to EOF.
|
|
<DT id="2">*<DD>
|
|
File's cluster chain contains a loop.
|
|
The loop is broken.
|
|
<DT id="3">*<DD>
|
|
Bad clusters (read errors).
|
|
The clusters are marked bad and they are removed from files owning them.
|
|
This check is optional.
|
|
<DT id="4">*<DD>
|
|
Directories with a large number of bad entries (probably corrupt).
|
|
The directory can be deleted.
|
|
<DT id="5">*<DD>
|
|
Files . and .. are non-directories.
|
|
They can be deleted or renamed.
|
|
<DT id="6">*<DD>
|
|
Directories . and .. in root directory.
|
|
They are deleted.
|
|
<DT id="7">*<DD>
|
|
Bad filenames.
|
|
They can be renamed.
|
|
<DT id="8">*<DD>
|
|
Duplicate directory entries.
|
|
They can be deleted or renamed.
|
|
<DT id="9">*<DD>
|
|
Directories with non-zero size field.
|
|
Size is set to zero.
|
|
<DT id="10">*<DD>
|
|
Directory . does not point to parent directory.
|
|
The start pointer is adjusted.
|
|
<DT id="11">*<DD>
|
|
Directory .. does not point to parent of parent directory.
|
|
The start pointer is adjusted.
|
|
<DT id="12">*<DD>
|
|
Start cluster number of a file is invalid.
|
|
The file is truncated.
|
|
<DT id="13">*<DD>
|
|
File contains bad or free clusters.
|
|
The file is truncated.
|
|
<DT id="14">*<DD>
|
|
File's cluster chain is longer than indicated by the size fields.
|
|
The file is truncated.
|
|
<DT id="15">*<DD>
|
|
Two or more files share the same cluster(s).
|
|
All but one of the files are truncated.
|
|
If the file being truncated is a directory file that has already been read, the
|
|
filesystem check is restarted after truncation.
|
|
<DT id="16">*<DD>
|
|
File's cluster chain is shorter than indicated by the size fields.
|
|
The file is truncated.
|
|
<DT id="17">*<DD>
|
|
Clusters are marked as used but are not owned by a file.
|
|
They are marked as free.
|
|
</DL>
|
|
<P>
|
|
|
|
Additionally, the following problems are detected, but not repaired:
|
|
<DL COMPACT>
|
|
<DT id="18">*<DD>
|
|
Invalid parameters in boot sector
|
|
<DT id="19">*<DD>
|
|
Absence of . and .. entries in non-root directories
|
|
</DL>
|
|
<P>
|
|
|
|
When <B>fsck.fat</B> checks a filesystem, it accumulates all changes in memory
|
|
and performs them only after all checks are complete.
|
|
This can be disabled with the <B>-w</B> option.
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="20"><B>-a</B><DD>
|
|
Automatically repair the filesystem.
|
|
No user intervention is necessary.
|
|
Whenever there is more than one method to solve a problem, the least
|
|
destructive approach is used.
|
|
<DT id="21"><B>-A</B><DD>
|
|
Use Atari variation of the MS-DOS filesystem.
|
|
This is default if <B>fsck.fat</B> is run on an Atari, then this option turns
|
|
off Atari format.
|
|
There are some minor differences in Atari format:
|
|
Some boot sector fields are interpreted slightly different, and the special FAT
|
|
entries for end-of-file and bad cluster can be different.
|
|
Under MS-DOS 0xfff8 is used for EOF and Atari employs 0xffff by default, but
|
|
both systems recognize all values from 0xfff8...0xffff as end-of-file.
|
|
MS-DOS uses only 0xfff7 for bad clusters, where on Atari values 0xfff0...0xfff7
|
|
are for this purpose (but the standard value is still 0xfff7).
|
|
<DT id="22"><B>-b</B><DD>
|
|
Make read-only boot sector check.
|
|
<DT id="23"><B>-c</B> <I>PAGE</I><DD>
|
|
Use DOS codepage <I>PAGE</I> to decode short file names.
|
|
By default codepage 437 is used.
|
|
<DT id="24"><B>-d</B> <I>PATH</I><DD>
|
|
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.
|
|
<DT id="25"><B>-f</B><DD>
|
|
Salvage unused cluster chains to files.
|
|
By default, unused clusters are added to the free disk space except in auto mode
|
|
(<B>-a</B>).
|
|
<DT id="26"><B>-l</B><DD>
|
|
List path names of files being processed.
|
|
<DT id="27"><B>-n</B><DD>
|
|
No-operation mode: non-interactively check for errors, but don't write
|
|
anything to the filesystem.
|
|
<DT id="28"><B>-p</B><DD>
|
|
Same as <B>-a</B>, for compatibility with other *fsck.
|
|
<DT id="29"><B>-r</B><DD>
|
|
Interactively repair the filesystem.
|
|
The user is asked for advice whenever there is more than one approach to fix an
|
|
inconsistency.
|
|
This is the default mode and the option is only retained for backwards
|
|
compatibility.
|
|
<DT id="30"><B>-t</B><DD>
|
|
Mark unreadable clusters as bad.
|
|
<DT id="31"><B>-u</B> <I>PATH</I><DD>
|
|
Try to undelete the specified file.
|
|
<B>fsck.fat</B> tries to allocate a chain of contiguous unallocated clusters
|
|
beginning with the start cluster of the undeleted file.
|
|
This option can be given more than once.
|
|
<DT id="32"><B>-v</B><DD>
|
|
Verbose mode.
|
|
Generates slightly more output.
|
|
<DT id="33"><B>-V</B><DD>
|
|
Perform a verification pass.
|
|
The filesystem check is repeated after the first run.
|
|
The 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.
|
|
<DT id="34"><B>-w</B><DD>
|
|
Write changes to disk immediately.
|
|
<DT id="35"><B>-y</B><DD>
|
|
Same as <B>-a</B> (automatically repair filesystem) for compatibility with other
|
|
fsck tools.
|
|
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>EXIT STATUS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="36">0<DD>
|
|
No recoverable errors have been detected.
|
|
<DT id="37">1<DD>
|
|
Recoverable errors have been detected or <B>fsck.fat</B> has discovered an
|
|
internal inconsistency.
|
|
<DT id="38">2<DD>
|
|
Usage error.
|
|
<B>fsck.fat</B> did not access the filesystem.
|
|
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>FILES</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="39">fsck0000.rec, fsck0001.rec, ...<DD>
|
|
When recovering from a corrupted filesystem, <B>fsck.fat</B> dumps recovered data
|
|
into files named 'fsckNNNN.rec' in the top level directory of the filesystem.
|
|
|
|
</DL>
|
|
<A NAME="lbAH"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
Does not create . and .. files where necessary.
|
|
Does not remove entirely empty directories.
|
|
Should give more diagnostic messages.
|
|
Undeleting files should use a more sophisticated algorithm.
|
|
|
|
<A NAME="lbAI"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+fatlabel">fatlabel</A></B>(8)
|
|
<BR>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+mkfs.fat">mkfs.fat</A></B>(8)
|
|
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>HOMEPAGE</H2>
|
|
|
|
The home for the <B>dosfstools</B> project is its
|
|
|
|
GitHub project page
|
|
|
|
|
|
<A NAME="lbAK"> </A>
|
|
<H2>AUTHORS</H2>
|
|
|
|
<B>dosfstools</B> were written by
|
|
|
|
Werner Almesberger
|
|
|
|
|
|
Roman Hodek
|
|
|
|
and others.
|
|
The current maintainer is
|
|
|
|
Andreas Bombe
|
|
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="40"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="41"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="42"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="43"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="44"><A HREF="#lbAF">EXIT STATUS</A><DD>
|
|
<DT id="45"><A HREF="#lbAG">FILES</A><DD>
|
|
<DT id="46"><A HREF="#lbAH">BUGS</A><DD>
|
|
<DT id="47"><A HREF="#lbAI">SEE ALSO</A><DD>
|
|
<DT id="48"><A HREF="#lbAJ">HOMEPAGE</A><DD>
|
|
<DT id="49"><A HREF="#lbAK">AUTHORS</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:12 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|