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(1M) command follows:

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.


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

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.

Parallel filesystem checking

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:


-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.

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.


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 22 April 2004