1DOSFSCK(8) MAINTENANCE COMMANDS DOSFSCK(8)
2
3
4
6 dosfsck - check and repair MS-DOS file systems
7
9 dosfsck [-aAflnrtvVwy] [-d path -d ...] [-u path -u ...] device
10
12 dosfsck verifies the consistency of MS-DOS file systems and optionally
13 tries to repair them. The following file system problems can be cor‐
14 rected (in this order):
15
16 - FAT contains invalid cluster numbers. Cluster is changed to EOF.
17 - File's cluster chain contains a loop. The loop is broken.
18 - Bad clusters (read errors). The clusters are marked bad and they
19 are removed from files owning them. This check is optional.
20 - Directories with a large number of bad entries (probably cor‐
21 rupt). The directory can be dropped.
22 - Files . and .. are non-directories. They can be dropped or
23 renamed.
24 - Directories . and .. in root directory. They are dropped.
25 - Bad file names. They can be renamed.
26 - Duplicate directory entries. They can be dropped or renamed.
27 - Directories with non-zero size field. Size is set to zero.
28 - Directory . does not point to parent directory. The start
29 pointer is adjusted.
30 - Directory .. does not point to parent of parent directory. The
31 start pointer is adjusted.
32 - Start cluster number of a file is invalid. The file is trun‐
33 cated.
34 - File contains bad or free clusters. The file is truncated.
35 - File's cluster chain is longer than indicated by the size
36 fields. The file is truncated.
37 - Two or more files share the same cluster(s). All but one of the
38 files are truncated. If the file being truncated is a directory
39 file that has already been read, the file system check is
40 restarted after truncation.
41 - File's cluster chain is shorter than indicated by the size
42 fields. The file is truncated.
43 - Clusters are marked as used but are not owned by a file. They
44 are marked as free.
45
46 Additionally, the following problems are detected, but not repaired:
47
48 - Invalid parameters in boot sector.
49 - Absence of . and .. entries in non-root directories
50
51 When dosfsck checks a file system, it accumulates all changes in memory
52 and performs them only after all checks are complete. This can be dis‐
53 abled with the -w option.
54
56 -a Automatically repair the file system. No user intervention is
57 necessary. Whenever there is more than one method to solve a
58 problem, the least destructive approach is used.
59
60 -A Use Atari variation of the MS-DOS filesystem. This is default if
61 dosfsck is run on an Atari, then this option turns off Atari
62 format. There are some minor differences in Atari format: Some
63 boot sector fields are interpreted slightly different, and the
64 special FAT entries for end-of-file and bad cluster can be dif‐
65 ferent. Under MS-DOS 0xfff8 is used for EOF and Atari employs
66 0xffff by default, but both systems recognize all values from
67 0xfff8...0xffff as end-of-file. MS-DOS uses only 0xfff7 for bad
68 clusters, where on Atari values 0xfff0...0xfff7 are for this
69 purpose (but the standard value is still 0xfff7).
70
71 -d Drop the specified file. If more that one file with that name
72 exists, the first one is dropped.
73
74 -f Salvage unused cluster chains to files. By default, unused clus‐
75 ters are added to the free disk space except in auto mode (-a).
76
77 -l List path names of files being processed.
78
79 -n No-operation mode: non-interactively check for errors, but don't
80 write anything to the filesystem.
81
82 -r Interactively repair the file system. The user is asked for
83 advice whenever there is more than one approach to fix an incon‐
84 sistency.
85
86 -t Mark unreadable clusters as bad.
87
88 -u Try to undelete the specified file. dosfsck tries to allocate a
89 chain of contiguous unallocated clusters beginning with the
90 start cluster of the undeleted file.
91
92 -v Verbose mode. Generates slightly more output.
93
94 -V Perform a verification pass. The file system check is repeated
95 after the first run. The second pass should never report any
96 fixable errors. It may take considerably longer than the first
97 pass, because the first pass may have generated long list of
98 modifications that have to be scanned for each disk read.
99
100 -w Write changes to disk immediately.
101
102 -y Same as -a (automatically repair filesystem) for compatibility
103 with other fsck tools.
104
105 If -a and -r are absent, the file system is only checked, but not
106 repaired.
107
109 0 No recoverable errors have been detected.
110
111 1 Recoverable errors have been detected or dosfsck has discovered
112 an internal inconsistency.
113
114 2 Usage error. dosfsck did not access the file system.
115
117 Does not create . and .. files where necessary. Does not remove
118 entirely empty directories. Should give more diagnostic messages.
119 Undeleting files should use a more sophisticated algorithm.
120
122 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch> Extensions
123 (FAT32, VFAT) by and current maintainer: Roman Hodek <roman@hodek.net>
124
125
126
127Linux December 31 1997 DOSFSCK(8)