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