1FSCK.FAT(8)                 System Manager's Manual                FSCK.FAT(8)
2
3
4

NAME

6       fsck.fat - check and repair MS-DOS filesystems
7

SYNOPSIS

9       fsck.fat [OPTIONS] DEVICE
10

DESCRIPTION

12       fsck.fat  verifies the consistency of MS-DOS filesystems and optionally
13       tries to repair them.
14
15       The following filesystem problems can be corrected (in this order):
16
17       *   FAT contains invalid cluster numbers.  Cluster is changed to EOF.
18
19       *   File's cluster chain contains a loop.  The loop is broken.
20
21       *   Bad clusters (read errors).  The clusters are marked bad  and  they
22           are removed from files owning them.  This check is optional.
23
24       *   Directories  with a large number of bad entries (probably corrupt).
25           The directory can be deleted.
26
27       *   Files . and  ..  are  non-directories.   They  can  be  deleted  or
28           renamed.
29
30       *   Directories . and .. in root directory.  They are deleted.
31
32       *   Bad filenames.  They can be renamed.
33
34       *   Duplicate directory entries.  They can be deleted or renamed.
35
36       *   Directories with non-zero size field.  Size is set to zero.
37
38       *   Directory  . does not point to parent directory.  The start pointer
39           is adjusted.
40
41       *   Directory .. does not point to parent  of  parent  directory.   The
42           start pointer is adjusted.
43
44       *   Start cluster number of a file is invalid.  The file is truncated.
45
46       *   File contains bad or free clusters.  The file is truncated.
47
48       *   File's  cluster  chain is longer than indicated by the size fields.
49           The file is truncated.
50
51       *   Two or more files share the same cluster(s).  All but  one  of  the
52           files  are  truncated.   If the file being truncated is a directory
53           file that has already been read, the filesystem check is  restarted
54           after truncation.
55
56       *   File's  cluster chain is shorter than indicated by the size fields.
57           The file is truncated.
58
59       *   Clusters are marked as used but are not owned by a file.  They  are
60           marked as free.
61
62       Additionally, the following problems are detected, but not repaired:
63
64       *   Invalid parameters in boot sector
65
66       *   Absence of . and .. entries in non-root directories
67
68       When fsck.fat checks a filesystem, it accumulates all changes in memory
69       and performs them only after all checks are complete.  This can be dis‐
70       abled with the -w option.
71

OPTIONS

73       -a  Automatically  repair the filesystem.  No user intervention is nec‐
74           essary.  Whenever there is more than one method to solve a problem,
75           the least destructive approach is used.
76
77       -A  Use  Atari  variation of the MS-DOS filesystem.  This is default if
78           fsck.fat is run on an Atari, then this option turns off Atari  for‐
79           mat.   There  are some minor differences in Atari format: Some boot
80           sector fields are interpreted slightly different, and  the  special
81           FAT  entries  for  end-of-file  and  bad  cluster can be different.
82           Under MS-DOS 0xfff8 is used for EOF and  Atari  employs  0xffff  by
83           default, but both systems recognize all values from 0xfff8...0xffff
84           as end-of-file.  MS-DOS uses only 0xfff7 for bad clusters, where on
85           Atari values 0xfff0...0xfff7 are for this purpose (but the standard
86           value is still 0xfff7).
87
88       -b  Make read-only boot sector check.
89
90       -c PAGE
91           Use DOS codepage PAGE to decode short file names.  By default code‐
92           page 437 is used.
93
94       -d PATH
95           Delete  the  specified  file.  If more than one file with that name
96           exist, the first one is deleted.  This option  can  be  given  more
97           than once.
98
99       -f  Salvage  unused  cluster chains to files.  By default, unused clus‐
100           ters are added to the free disk space except in auto mode (-a).
101
102       -l  List path names of files being processed.
103
104       -n  No-operation mode: non-interactively check for  errors,  but  don't
105           write anything to the filesystem.
106
107       -p  Same as -a, for compatibility with other *fsck.
108
109       -r  Interactively  repair the filesystem.  The user is asked for advice
110           whenever there is more than one approach to fix  an  inconsistency.
111           This  is the default mode and the option is only retained for back‐
112           wards compatibility.
113
114       -t  Mark unreadable clusters as bad.
115
116       -u PATH
117           Try to undelete the specified file.  fsck.fat tries to  allocate  a
118           chain  of  contiguous unallocated clusters beginning with the start
119           cluster of the undeleted file.  This option can be given more  than
120           once.
121
122       -v  Verbose mode.  Generates slightly more output.
123
124       -V  Perform  a  verification  pass.   The  filesystem check is repeated
125           after the first run.  The second pass should never report any  fix‐
126           able  errors.  It may take considerably longer than the first pass,
127           because the first pass may have generated long  list  of  modifica‐
128           tions that have to be scanned for each disk read.
129
130       -w  Write changes to disk immediately.
131
132       -y  Same as -a (automatically repair filesystem) for compatibility with
133           other fsck tools.
134

EXIT STATUS

136       0   No recoverable errors have been detected.
137
138       1   Recoverable errors have been detected or fsck.fat has discovered an
139           internal inconsistency.
140
141       2   Usage error.  fsck.fat did not access the filesystem.
142

FILES

144       fsck0000.rec, fsck0001.rec, ...
145           When  recovering from a corrupted filesystem, fsck.fat dumps recov‐
146           ered data into files named 'fsckNNNN.rec' in the top  level  direc‐
147           tory of the filesystem.
148

BUGS

150       Does  not  create  .  and  ..  files  where necessary.  Does not remove
151       entirely empty directories.   Should  give  more  diagnostic  messages.
152       Undeleting files should use a more sophisticated algorithm.
153

SEE ALSO

155       fatlabel(8)
156       mkfs.fat(8)
157

HOMEPAGE

159       The  home  for  the  dosfstools  project  is  its  GitHub  project page
160https://github.com/dosfstools/dosfstools⟩.
161

AUTHORS

163       dosfstools were  written  by  Werner  Almesberger  ⟨werner.almesberger@
164       lrc.di.epfl.ch⟩,  Roman Hodek ⟨Roman.Hodek@informatik.uni-erlangen.de⟩,
165       and others.  The current maintainer is Andreas Bombe ⟨aeb@debian.org⟩.
166
167
168
169dosfstools 4.1                    2015-04-16                       FSCK.FAT(8)
Impressum