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