DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Solving filesystem problems

Generic fsck and its options

The generic format of the fsck(ADM) command follows:

fsck [-F fstyp] [-V] [-m] [special . . . ]

fsck [-F fstyp] [-V] [-o specific_options] [special . . . ]

fsck [-F fstyp] [-V] [-PLbyw] [special . . .]

The -F option specifies the fstyp on which the command must act. If fstyp is not specified it is determined from /etc/default/filesys by matching an entry in that file with the special specified. If this fails, heuristics similiar to those used by fstyp(ADM) are used to determine the filesystem type.


NOTE: If the fstyp is known beforehand, use the -F option. Commands execute faster if they are not required to autodetect filesystem types.

The -V option causes the command to echo the completed command line. The echoed line will include additional information derived from /etc/default/filesys. 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.

The -o option specifies fstyp-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 fstyp-specific module of the command.

Parallel filesystem checking

A fast fsck(ADM) 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 the -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/default/filesys in parallel. It uses the ``fsckpass'' field of /etc/default/filesys 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 necessar y.

After all the files in /etc/default/filesys 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:


-L
Requests that the output be arranged in order by filesystem.

-b
Prints the filesystem output in a brief terse format. When successfully completed, the command prints one line per filesystem, which is a summary of fsck information.

-y
Assumes a yes response to all questions, and the interactive mode is circumvented.

-w
Averts confusion stemming from several different filesystems requesting interactive responses. It runs as expected upon successful completion (either verbose or brief). If it fails, the parent fsck process collects the failure information, but defers any corrections until the rest of the filesystems have been checked.
If the filesystem is inconsistent the user is prompted for concurrence before each correction is attempted. Note that some corrective actions will result in some loss of data. The amount and severity of data loss can be determined from the diagnostic output. The default action for each correction is to wait for the user to respond yes or no. If the user does not have write permission, fsck defaults to a no action.

See also:


Previous topic: Checking filesystems with fsck

© 2007 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 05 June 2007