fsck [-p][-f] [-m mode]
fsck [-b block# ]
[-c level]
[-l maxparallel]
[-q]
[-y ]
[-n ]
[-m mode]
[filesystem] ...
During boot, /etc/rc ( launchd on Mac OSx 10.5) specifies filesystems to be checked.
In addition the filesystems in /etc/fstab which are not marked clean are checked.
(Filesystems are marked clean when they are unmounted (as in shutdown),
have been mounted read-only, or when fsck runs on them successfully).
-p
During processing, the filesystem, the corrective action, and the nature of the correction are displayed.
After successfully correcting a filesystem, fsck displays the
number of files on that filesystem, the number of used and free blocks, and the percentage of fragmentation.
If sent a QUIT signal, fsck completes the checks but then exits
with an abnormal return status which causes boot to fail. Used to prevent starting multiuser mode.
Without -p, fsck audits and interactively repairs inconsistent
conditions. The user is prompted for permission before each correction is attempted (unless -y or -n is specified).
Some of the corrective actions , not correctable under -p, will result in some loss of data.
The amount and severity of data lost is displayed .
If the user does not have write permission on the filesystem no action is taken.
| -p | preen |
| -f | Force ie include clean filesystems when preening.
|
| -m rwxrwxrwx | If a lost+found directory is created, use the mode specified in octal as the permission bits rather than 1777 which is a security risk, 700 is suggested.
|
| ‑b alt‑super‑block | Block 32 is usually an alternate super block. |
| -l p | Limit the number of parallel checks. By default, the limit is the number of disks, running one process per disk. If a smaller limit is given, the disks are checked round-robin, one filesystem at a time. |
| -q | quickly determine if filesystem was unmounted cleanly. |
| -y | Supply a yes response to all questions ; this should be used with great caution |
| -n | Supply a no response to all questions except for `CONTINUE?', which is assumed to be affirmative; do not open the filesystem for writing. |
| -c level | Convert the filesystem to a higher level.
If a negative answer is given, no further operations are done on the filesystem. In preen mode, the conversion is listed and done if possible without user interaction. Conversion in preen mode is best used when all the filesystems are being converted at once. The format of a filesystem can be determined from the first line of output from dumpfs(8). |
/etc/fstab.
lost+found
directory. The name assigned is the inode number. If the lost+found
directory does not exist, it is created. If there is insufficient space
its size is increased.
FILES
/etc/fstab contains default list of filesystems to check.
Appendix A of Fsck - The UNIX File System Check Program.
Fsck has more consistency checks than its predecessors check, dcheck, fcheck, and icheck combined.
see fs(5), fstab(5), newfs(8), reboot(8)
FSCK(8) BSD System Manager's Manual
4th Berkeley Distribution May 9, 1995