blob: 869b806a860a744d7d1640fb579ac4e5f3931187 [file] [log] [blame]
Matt Mower18794c82015-11-11 16:22:45 -06001.\" fsck.fat.8 - manpage for fsck.fat
2.\"
3.\" Copyright (C) 2006-2014 Daniel Baumann <daniel@debian.org>
4.\"
5.\" This program is free software: you can redistribute it and/or modify
6.\" it under the terms of the GNU General Public License as published by
7.\" the Free Software Foundation, either version 3 of the License, or
8.\" (at your option) any later version.
9.\"
10.\" This program is distributed in the hope that it will be useful,
11.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
12.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13.\" GNU General Public License for more details.
14.\"
15.\" You should have received a copy of the GNU General Public License
16.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
17.\"
18.\" The complete text of the GNU General Public License
19.\" can be found in /usr/share/common-licenses/GPL-3 file.
20.\"
21.\"
22.\"*******************************************************************
23.\"
24.\" This file was generated with po4a. Translate the source file.
25.\"
26.\"*******************************************************************
27.TH FSCK.FAT 8 2015\-05\-16 3.0.28 dosfstools
28.SH NAME
29.\" ----------------------------------------------------------------------------
30\fBfsck.fat\fP \- check and repair MS\-DOS filesystems
31.SH SYNOPSIS
32.\" ----------------------------------------------------------------------------
33\fBfsck.fat\fP [\fIOPTIONS\fP] \fIDEVICE\fP
34.SH DESCRIPTION
35\fBfsck.fat\fP verifies the consistency of MS\-DOS filesystems and optionally
36tries to repair them.
37.PP
38The following filesystem problems can be corrected (in this order):
39.IP * 4
40FAT contains invalid cluster numbers. Cluster is changed to EOF.
41.IP * 4
42File's cluster chain contains a loop. The loop is broken.
43.IP * 4
44Bad clusters (read errors). The clusters are marked bad and they are
45removed from files owning them. This check is optional.
46.IP * 4
47Directories with a large number of bad entries (probably corrupt). The
48directory can be deleted.
49.IP * 4
50Files . and .. are non\-directories. They can be deleted or renamed.
51.IP * 4
52Directories . and .. in root directory. They are deleted.
53.IP * 4
54Bad filenames. They can be renamed.
55.IP * 4
56Duplicate directory entries. They can be deleted or renamed.
57.IP * 4
58Directories with non\-zero size field. Size is set to zero.
59.IP * 4
60Directory . does not point to parent directory. The start pointer is
61adjusted.
62.IP * 4
63Directory .. does not point to parent of parent directory. The start
64pointer is adjusted.
65.IP * 4
66Start cluster number of a file is invalid. The file is truncated.
67.IP * 4
68File contains bad or free clusters. The file is truncated.
69.IP * 4
70File's cluster chain is longer than indicated by the size fields. The file
71is truncated.
72.IP * 4
73Two or more files share the same cluster(s). All but one of the files are
74truncated. If the file being truncated is a directory file that has already
75been read, the filesystem check is restarted after truncation.
76.IP * 4
77File's cluster chain is shorter than indicated by the size fields. The file
78is truncated.
79.IP * 4
80Clusters are marked as used but are not owned by a file. They are marked as
81free.
82.PP
83Additionally, the following problems are detected, but not repaired:
84.IP * 4
85Invalid parameters in boot sector
86.IP * 4
87Absence of . and .. entries in non\-root directories
88.PP
89.\" ----------------------------------------------------------------------------
90When \fBfsck.fat\fP checks a filesystem, it accumulates all changes in memory
91and performs them only after all checks are complete. This can be disabled
92with the \fB\-w\fP option.
93.SH OPTIONS
94.IP \fB\-a\fP 4
95Automatically repair the filesystem. No user intervention is necessary.
96Whenever there is more than one method to solve a problem, the least
97destructive approach is used.
98.IP \fB\-A\fP 4
99Use Atari variation of the MS\-DOS filesystem. This is default if
100\fBfsck.fat\fP is run on an Atari, then this option turns off Atari format.
101There are some minor differences in Atari format: Some boot sector fields
102are interpreted slightly different, and the special FAT entries for
103end\-of\-file and bad cluster can be different. Under MS\-DOS 0xfff8 is used
104for EOF and Atari employs 0xffff by default, but both systems recognize all
105values from 0xfff8...0xffff as end\-of\-file. MS\-DOS uses only 0xfff7 for bad
106clusters, where on Atari values 0xfff0...0xfff7 are for this purpose (but
107the standard value is still 0xfff7).
108.IP \fB\-b\fP 4
109Make read\-only boot sector check.
110.IP "\fB\-d\fP \fIPATH\fP" 4
111Delete the specified file. If more than one file with that name exist, the
112first one is deleted. This option can be given more than once.
113.IP \fB\-f\fP 4
114Salvage unused cluster chains to files. By default, unused clusters are
115added to the free disk space except in auto mode (\fB\-a\fP).
116.IP \fB\-l\fP 4
117List path names of files being processed.
118.IP \fB\-n\fP 4
119No\-operation mode: non\-interactively check for errors, but don't write
120anything to the filesystem.
121.IP \fB\-p\fP 4
122Same as \fB\-a\fP, for compatibility with other *fsck.
123.IP \fB\-r\fP 4
124Interactively repair the filesystem. The user is asked for advice whenever
125there is more than one approach to fix an inconsistency. This is the
126default mode and the option is only retained for backwards compatibility.
127.IP \fB\-t\fP 4
128Mark unreadable clusters as bad.
129.IP "\fB\-u\fP \fIPATH\fP" 4
130Try to undelete the specified file. \fBfsck.fat\fP tries to allocate a chain
131of contiguous unallocated clusters beginning with the start cluster of the
132undeleted file. This option can be given more than once.
133.IP \fB\-v\fP 4
134Verbose mode. Generates slightly more output.
135.IP \fB\-V\fP 4
136Perform a verification pass. The filesystem check is repeated after the
137first run. The second pass should never report any fixable errors. It may
138take considerably longer than the first pass, because the first pass may
139have generated long list of modifications that have to be scanned for each
140disk read.
141.IP \fB\-w\fP 4
142Write changes to disk immediately.
143.IP \fB\-y\fP 4
144.\" ----------------------------------------------------------------------------
145Same as \fB\-a\fP (automatically repair filesystem) for compatibility with other
146fsck tools.
147.SH "EXIT STATUS"
148.IP 0 4
149No recoverable errors have been detected.
150.IP 1 4
151Recoverable errors have been detected or \fBfsck.fat\fP has discovered an
152internal inconsistency.
153.IP 2 4
154.\" ----------------------------------------------------------------------------
155Usage error. \fBfsck.fat\fP did not access the filesystem.
156.SH FILES
157.IP "fsck0000.rec, fsck0001.rec, ..." 4
158.\" ----------------------------------------------------------------------------
159When recovering from a corrupted filesystem, \fBfsck.fat\fP dumps recovered
160data into files named 'fsckNNNN.rec' in the top level directory of the
161filesystem.
162.SH BUGS
163.\" ----------------------------------------------------------------------------
164Does not create . and .. files where necessary. Does not remove entirely
165empty directories. Should give more diagnostic messages. Undeleting files
166should use a more sophisticated algorithm.
167.SH "SEE ALSO"
168\fBfatlabel\fP(8)
169.br
170.\" ----------------------------------------------------------------------------
171\fBmkfs.fat\fP(8)
172.SH HOMEPAGE
173.\" ----------------------------------------------------------------------------
174The home for the \fBdosfstools\fP project is its
175.UR https://github.com/dosfstools/dosfstools
176GitHub project page
177.UE .
178.SH AUTHORS
179\fBdosfstools\fP were written by
180.MT werner.almesberger@\:lrc.di.epfl.ch
181Werner Almesberger
182.ME ,
183.MT Roman.Hodek@\:informatik.\:uni-erlangen.de
184Roman Hodek
185.ME ,
186and others. The current maintainer is
187.MT aeb@\:debian.org
188Andreas Bombe
189.ME .