The generic format of the
fsck [-F FSType] [-V] [-m] [special . . . ]
fsck [-F FSType] [-V] [current_options] [-o specific_options] [special . . . ]
fsck [-F FSType] [-V] [-PLbyw] [special . . .]
The -F option specifies the FSType on which the command must act. If FSType is not specified it is determined from /etc/vfstab by matching an entry in that file with the special specified. If this fails, heuristics similiar to those used by fstyp(1M) are used to determine the file system type.
The -V option causes the command to echo the completed command line. The echoed line will include additional information derived from /etc/vfstab. This option can be used to verify and validate the command line. It does not cause the command to execute.
The -m option performs a sanity check only. This option is usually used before mounting filesystems because it lets the administrator know whether the file system needs to be checked.
current_options are options supported by the s5-specific module of fsck.
The -o option specifies FSType-specific options if any. specific_options are options specified in a comma-separated list of keywords and/or keyword-attribute pairs for interpretation by the FSType-specific module of the command.
A fast fsck(1M) is becoming increasingly desirable because of the growing need for online transaction processing and for quick filesystem recovery. Implementing a parallel fsck causes concern about maximizing the speed and efficiency of the command while avoiding collision and synchronization problems. An example of a bad collision would be the simultaneous checking of several filesystems that lie on the same disk.
Parallelism is implemented via a new -P option. The gain in speed from fsck -P depends on the number and size of the filesystems and disks being checked, as well as on the distribution of these different filesystems and filesystem types on the available disks.
The -P option automatically audits and interactively repairs inconsistent conditions for all filesystems in /etc/vfstab in parallel. It uses the ``fsckpass'' field of /etc/vfstab to create a list of filesystems that need checking on separate disks. This field indicates on which spindle a filesystem resides. The filesystems are then scheduled for checking such that each disk has one filesystem being checked on that disk at a given time. A check on one filesystem does not depend on a check of another filesystem executing on another disk to complete.
``-'' in the filesystem's ``fsckpass'' field indicates that it is not checked. All other pass numbers are at the system administrator's discretion. The ``fsckpass'' field is initially filled in at installation time by an architecture-dependent routine, setvfspass. The system administrator can tune the algorithm that setvfspass employs by altering the ``fsckpass'' if necessary.
After all the files in /etc/vfstab have been checked, the parent fsck process spawns single-threaded fscks interactively on each individual filesystem that could not be fixed through the standard procedures.
The -P option supports these suboptions:
The next topics describe how to use fsck to check s5, ufs, sfs, vxfs, and bfs filesystems. The information is presented separately for each filesystem type. Although this arrangement results in a certain amount of repetition, we hope it will prevent confusion.