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