fsck(ADM)


fsck, p_fsck -- check and repair filesystems

Syntax

/etc/fsck [ options ] [ filesystem ] ...

/etc/p_fsck [ -- options ]

Description

fsck audits and repairs inconsistent conditions for all supported filesystems.

If the filesystem is consistent, the number of files, number of blocks used, and number of blocks free are reported. If the filesystem is inconsistent, fsck prompts you for confirmation before each correction is attempted. It should be noted that most corrective actions result in some loss of data. The amount and severity of the loss may be determined from the diagnostic output. (If you are experienced and fully understand the organization of filesystems, you can resolve discrepancies manually using the filesystem debugger, fsdb(ADM).)

The default action for each correction is to wait for you to respond ``y'' for ``yes'' or ``n'' for ``no''. If you reply ``y!'' to any question, fsck assumes that the response to all subsequent questions is ``y'' (see also the description of the -y option). If you do not have write permission, fsck defaults to the action of the -n option.

If fsck finds that the root filesystem has been modified, it will either remount the root filesystem or reboot the system automatically. The root filesystem is only remounted if the damage to it is minor.

If you check the root filesystem manually using fsck, you should first unmount all other filesystems using the umount command (see mount(ADM)).

The following options are interpreted by fsck:


-a
When called with this option, (autoboot), fsck examines the FSCKFIX flag in the /etc/default/boot file. If FSCKFIX is set to YES, fsck behaves as if it had been called with the -y flag.

If the -a option is set, fsck writes all its output to /dev/recover as well as to the standard output. The /etc/rc2 scripts mail the contents of /dev/recover to root when the system goes to multiuser mode.

This option does not apply to dosfs and VxFS filesystems.


-C[clustersize]
This option (for S51K filesystems only) converts the named S51K filesystem into an AFS (Acer Fast Filesystem). The -s option must also be present. The clustersize argument must be one of 1, 2, 4, 8, or 16 (16 is the recommended and default value). The increase in speed that is possible with a fast filesystem will not be immediately apparent; it will take effect only with the new files added to the filesystem.

There is little or no benefit in transforming a filesystem that is nearly full; if it is within a few blocks of being full, the conversion will not work.


-d
This option turns on debugging. It allows additional information to be printed during filesystem checking.

This option does not apply to dosfs and VxFS filesystems.


-D
This option checks directories for bad blocks. This is useful after system crashes.

This option does not apply to dosfs, HTFS(TM), and VxFS filesystems.


-E
This option converts the named AFS filesystem to Extended Acer Fast Filesystem (EAFS), which includes support for long filenames and symbolic links. It can be combined with the -C option to convert an S51K filesystem to EAFS.

-f
This option performs a fast check which checks block, sizes (Phase 1) and the free list (Phase 5). The free list is reconstructed (Phase 6) if necessary.

For VxFS filesystems, -f performs log recovery. This option is ignored for HTFS and dosfs filesystems.


-F fstyp
This option should be used if fsck cannot determine the filesystem type. fstyp can be one of AFS, dosfs (includes VFAT support), DOS (provides OSR5 compatibility), EAFS, HTFS, or S51K. There must be a space between the -F and fstyp. The fstyp(ADM) command can be used to determine the type of a mounted filesystem. A comma-separated list of further options can follow fstyp:

compact
Compact directories if possible.

force
Proceed with checking the filesystem.

full
For HTFS, EAFS and AFS, perform a full filesystem check (rather than a fast filesystem check). S51K filesystems do not use the intentlog, so fsck can only execute the full option functionality.

-n
This option assumes a ``no'' response to all questions asked by fsck; the filesystem is not opened for writing.

-ofull
This option forces a ``full'' filesystem check. This is necessary for hard disk errors such as bad sectors. Filesystem transaction logging is enabled by default; if the log shows incomplete transactions, a ``fast'' check is performed. If not, the filesystem will be marked as clean. If logging was disabled, a ``full'' filesystem check will always be performed.

Note that -o nolog is accepted for VxFS filesystems.


-q
This option performs a quiet fsck. Size-check messages are not printed in Phase 1. Unreferenced FIFO files are selectively removed. If fsck requires it, counts in the super-block are automatically fixed and the free list is salvaged.

-s[b:c]
This option ignores the actual free list and (unconditionally) reconstructs a new one by rewriting the super-block of the filesystem. The filesystem must be unmounted while this is done.

The -s option allows for creating an optimal free-list organization. The following forms are supported:


-s
Uses the default values from when the filesystem was created.

-sBlocks-per-cylinder:Blocks-to-skip
Uses the specified values.

This option is applicable for S51K filesystems only.

-S
This option conditionally reconstructs the free list. This option is like -sb:c above except that the free list is rebuilt only if there are no discrepancies discovered in the filesystem. Using -S forces a ``no'' response to all questions asked by fsck. This option is useful for forcing free list reorganization on uncontaminated filesystems.

This option has no effect on an HTFS filesystem.


-t filename
If fsck cannot obtain enough memory to keep its tables, it uses a scratch file. If the -t option is specified, the file named in the next argument is used as the scratch file, if needed. Make certain you leave a space between the -t and the filename, or fsck will use the entire filesystem as a scratch file and erase the entire disk. If you created a scratch filesystem during installation then you can use /dev/scratch as the filename, provided that the filesystem being checked is no larger than the root filesystem. Without the -t flag, fsck prompts you for the name of the scratch file. The file chosen should not be on the filesystem being checked, and if it is not a special file, it is removed when fsck completes. If the system has a large hard disk, there may not be enough space on another filesystem for the scratch file. In such cases, if the system has a floppy drive, use a blank, formatted floppy in the floppy drive with (for example) /dev/fd0 specified as the scratch file.

-y
This option assumes a ``yes'' response to all questions asked by fsck.

If no filesystems are specified, fsck reads a list of default filesystems from the file /etc/checklist.

Inconsistencies checked are as follows:

Orphaned files and directories (allocated but unreferenced) are, with your agreement, reconnected by being placed in the lost+found directory. The name assigned is the inode number. The only restriction is that the directory lost+found must pre-exist in the root of the filesystem being checked and must have empty slots in which entries can be made.

Parallel fsck

p_fsck allows several filesystems to be checked in parallel by running a number of fsck processes simultaneously. When the system goes to multiuser mode, mountall(ADM) uses p_fsck to check the filesystems before mounting them.

p_fsck never checks two filesystems on the same disk at the same time; this would require time-consuming seek operations by the drive heads. These filesystems are checked in sequence instead. There is virtually no limit to the number of filesystems on different disks that p_fsck can repair in parallel.

Options to be passed to the underlying fsck processes are specified after the -- option. These options are applied to all the filesystems checked.

Since p_fsck is intended for non-interactive use, one of the options -y or -n should always be given.

p_fsck reads the filesystems to be checked from its standard input, for example:

   /etc/p_fsck -- -y <<%%
   /dev/u
   /dev/v
   /dev/w
   %%
The file /etc/checklist can be used to generate a list of filesystems to check:

cat /etc/checklist | /etc/p_fsck -- -n

Do not use p_fsck to check the root filesystem.

Diagnostics

The following sections apply to S51K, AFS, EAFS and HTFS filesystems only.

Initialization phase

Command syntax is checked. Before the filesystem check can be performed, fsck sets up certain tables and opens some files. The fsck terminates on initialization errors.

General errors

Three error messages may appear in any phase. While they seem to offer the option to continue, it is generally best to regard them as fatal, end the run, and investigate what may have caused the problem.

CAN NOT SEEK: BLK B (CONTINUE?)
The request to move to a specified block number B in the filesystem failed. The occurrence of this error condition indicates a serious problem (probably a hardware failure) that may require additional help.

CAN NOT READ: BLK B (CONTINUE?)
The request for reading a specified block number B in the filesystem failed. The occurrence of this error condition indicates a serious problem (probably a hardware failure) that may require additional help.

CAN NOT WRITE: BLK B (CONTINUE?)
The request for writing a specified block number B in the filesystem failed. The disk may be write-protected.

Additional HTFS-only diagnostics:


CAN'T CHECK FILESYSTEM
An error during fsck initialization means that checking cannot proceed. This will usually be accompanied by a more detailed description of the problem.

INCORRECT VERSION NUMBER
The version number in the superblock is not the same as the one expected by fsck. It is possible that you are not executing the correct version of fsck for your installation.

INODE GROUP COUNT INCORRECT
The number of inode groups held in the superblock is not valid for the filesystem being examined.

INODE GROUP SUMMARY INCORRECT
The inode group summary information is not valid.

Meaning of yes/no responses

Prompt n(no) y(yes)
CONTINUE? Terminates program.
(This is the recommended response.)
Attempts to continue to run filesystem check.
Often, however, the problem persists. The error condition does not allow a complete check of the filesystem. A second run of fsck should be made to re-check this filesystem.

 +----------+-----------------+---------------------+
 |Prompt    | n(no)           | y(yes)              |
 +----------+-----------------+---------------------+
 |CONTINUE? | Terminates      | Attempts to         |
 |          | program.        | continue to run     |
 |          | (This is the    | filesystem check.   |
 |          | recommended     | Often, however, the |
 |          | response.)      | problem persists.   |
 |          |                 | The error condition |
 |          |                 | does not allow a    |
 |          |                 | complete check of   |
 |          |                 | the filesystem.  A  |
 |          |                 | second run of fsck  |
 |          |                 | should be made to   |
 |          |                 | re-check this       |
 |          |                 | filesystem.         |
 +----------+-----------------+---------------------+

Phase 1: check blocks and sizes

This phase checks the inode list.

Meaning of yes/no responses -- Phase 1

Prompt n(no) y(yes)
CONTINUE? Terminates the program.
(This is the recommended response.)
Continues with the program.
This error condition means that a complete check of the filesystem is not possible. A second run of fsck should be made to re-check this filesystem.
CLEAR? Ignores the error condition.
A ``no'' response is only appropriate if you intend to take other measures to fix the problem.
De-allocates i-node I by zeroing its contents.
This may invoke the UNALLOCATED error condition in Phase 2 for each directory entry pointing to this i-node.

 +----------+-----------------+---------------------+
 |Prompt    | n(no)           | y(yes)              |
 +----------+-----------------+---------------------+
 |CONTINUE? | Terminates the  | Continues with the  |
 |          | program.        | program.            |
 |          | (This is the    | This error          |
 |          | recommended     | condition means     |
 |          | response.)      | that a complete     |
 |          |                 | check of the        |
 |          |                 | filesystem is not   |
 |          |                 | possible.  A second |
 |          |                 | run of fsck should  |
 |          |                 | be made to re-check |
 |          |                 | this filesystem.    |
 +----------+-----------------+---------------------+
 |CLEAR?    | Ignores the     | De-allocates i-node |
 |          | error           | I by zeroing its    |
 |          | condition.      | contents.           |
 |          | A ``no''        | This may invoke the |
 |          | response is     | UNALLOCATED error   |
 |          | only            | condition in Phase  |
 |          | appropriate if  | 2 for each          |
 |          | you intend to   | directory entry     |
 |          | take other      | pointing to this i- |
 |          | measures to fix | node.               |
 |          | the problem.    |                     |
 +----------+-----------------+---------------------+

Phase 1 error messages


EMPTY SYMLINK (CLEAR?)
There is no pathname associated with a symbolic link.

UNKNOWN FILE TYPE I=I (CLEAR?)
The mode word of the i-node I suggests that the i-node is not a pipe, device special i-node, regular i-node, or directory i-node. This is also displayed when a non-EAFS version of fsck is run on a filesystem containing symbolic links.

LINK COUNT TABLE OVERFLOW (CONTINUE?)
An internal table for fsck containing allocated i-nodes with a link count of zero has no more room.

B BAD I=I
I-node I contains block number B with a number lower than the number of the first data block in the filesystem or greater than the number of the last block in the filesystem. This error condition may invoke the EXCESSIVE BAD BLKS error condition in Phase 1 if i-node I has too many block numbers outside the filesystem range. This error condition invokes the BAD/DUP error condition in Phase 2 and Phase 4.

EXCESSIVE BAD BLOCKS I=I (CONTINUE?)
There is more than a tolerable number of blocks (usually 10) with a number lower than the number of the first data block in the filesystem or greater than the number of the last block in the filesystem associated with i-node I.

B DUP I=I
I-node I contains block number B, which is already claimed by another i-node. This error condition may invoke the EXCESSIVE DUP BLKS error condition in Phase 1 if i-node I has too many block numbers claimed by other i-nodes. This error condition invokes Phase 1B and the BAD/DUP error condition in Phase 2 and Phase 4.

EXCESSIVE DUP BLKS I=I (CONTINUE?)
There is more than a tolerable number of blocks (usually 10) claimed by other i-nodes.

DUP TABLE OVERFLOW (CONTINUE?)
An internal table in fsck containing duplicate block numbers has no more room.


POSSIBLE FILE SIZE ERROR I=I

TOO FEW BLOCKS ALLOCATED
The i-node I size is greater than the actual number of blocks used by the i-node. If the -q option is used, this message is not printed.

DIRECTORY MISALIGNED I=I
The size of a directory i-node is not aligned properly. This is only a warning. If the -q option is used, this message is not printed.

PARTIALLY ALLOCATED INODE I=I (CLEAR?)
I-node I is neither allocated nor unallocated.

Phase 1B: re-scan for more DUPS

When a duplicate block is found in the filesystem, the filesystem is re-scanned to find the i-node that previously claimed that block. When the duplicate block is found, the following information message is printed:

B DUP I=I
I-node I contains block number B, which is already claimed by another i-node. This error condition invokes the BAD/DUP error condition in Phase 2. I-nodes with overlapping blocks may be determined by examining this error condition and the DUP error condition in Phase 1.

Additional HTFS-only diagnostics:


DUP TABLE OVERFLOW
An internal table describing blocks that are claimed by more than one inode is out of space.

NO VALID '.' in DIR I = I
An entry for ``.'' has been found but is incorrect.

NO VALID '..' in DIR I = I
An entry for ``..'' has been found but is incorrect.

MISSING '.' or '..' in DIR I = I
One or both of these required directory entries is missing from the current directory.

BAD DIR ENTRY I = I
The directory structure is incorrect. Either ``.'' does not reference the current directory, ``..'' points to inode 0, or a directory entry is badly formed.

FREE INODE COUNT WRONG IN GROUP - g
The free inode count in the group summary of the given inode group does not match the actual number of free inodes.

Additional HTFS-only diagnostics:


DUP TABLE OVERFLOW
An internal table describing blocks that are claimed by more than one inode is out of space.

NO VALID '.' in DIR I = I
An entry for ``.'' has been found but is incorrect.

NO VALID '..' in DIR I = I
An entry for ``..'' has been found but is incorrect.

MISSING '.' or '..' in DIR I = I
One or both of these required directory entries is missing from the current directory.

BAD DIR ENTRY I = I
The directory structure is incorrect. Either ``.'' does not reference the current directory, ``..'' points to inode 0, or a directory entry is badly formed.

FREE INODE COUNT WRONG IN GROUP - g
The free inode count in the group summary of the given inode group does not match the actual number of free inodes.

Phase 2: check pathnames

This phase removes directory entries pointing to bad i-nodes found in Phase 1 and Phase 1B.

Meaning of yes/no responses -- Phase 2

Prompt n(no) y(yes)
FIX? Terminates the program since fsck will be unable to continue. In Phase 2, a ``yes'' response to the FIX? prompt will perform the fixes as necessary.
CONTINUE? Terminates the program. Ignores DUPS/BAD error condition in root i-node and attempts to continue to run the filesystem check.
If root i-node is not correct, then this may result in a large number of other error conditions.

   
REMOVE? Ignores the error condition. A ``no'' response is only appropriate if you intend to take other measures to fix the problem. Removes duplicate or unallocated blocks.

 +----------+-----------------+---------------------+
 |Prompt    | n(no)           | y(yes)              |
 +----------+-----------------+---------------------+
 |FIX?      | Terminates the  | In Phase 2, a       |
 |          | program since   | ``yes'' response to |
 |          | fsck will be    | the FIX? prompt     |
 |          | unable to       | will perform the    |
 |          | continue.       | fixes as necessary. |
 +----------+-----------------+---------------------+
 |CONTINUE? | Terminates the  | Ignores DUPS/BAD    |
 |          | program.        | error condition in  |
 |          |                 | root i-node and     |
 |          |                 | attempts to         |
 |          |                 | continue to run the |
 |          |                 | filesystem check.   |
 |          |                 | If root i-node is   |
 |          |                 | not correct, then   |
 |          |                 | this may result in  |
 |          |                 | a large number of   |
 |          |                 | other error         |
 |          |                 | conditions.         |
 +----------+-----------------+---------------------+
 |REMOVE?   | Ignores the     | Removes duplicate   |
 |          | error           | or unallocated      |
 |          | condition.  A   | blocks.             |
 |          | ``no'' response |                     |
 |          | is only         |                     |
 |          | appropriate if  |                     |
 |          | you intend to   |                     |
 |          | take other      |                     |
 |          | measures to fix |                     |
 |          | the problem.    |                     |
 +----------+-----------------+---------------------+

Phase 2 error messages


ROOT INODE UNALLOCATED. TERMINATING
The root i-node (always i-node number 2) has no allocated mode bits. The occurrence of this error condition indicates a serious problem. The program stops.

ROOT INODE NOT DIRECTORY (FIX?)
The root i-node (usually i-node number 2) is not directory i-node type.

DUPS/BAD IN ROOT INODE (CONTINUE?)
Phase 1 or Phase 1B found duplicate blocks or bad blocks in the root i-node (usually i-node number 2) for the filesystem.

I OUT OF RANGE I=I NAME=F (REMOVE?)
A directory entry F has an i-node number I that is greater than the end of the i-node list.

UNALLOCATED I=I OWNER=O MODE=M SIZE=S MTIME=T NAME=F (REMOVE?)
A directory entry F has an i-node I without allocated mode bits. The owner O, mode M, size S, modification time T, and filename F are printed. If the filesystem is not mounted and the -n option was not specified, the entry is removed automatically if the i-node it points to is character size 0.

DUP/BAD I=I OWNER=O MODE=M SIZE=S MTIME=T DIR=F (REMOVE?)
Phase 1 or Phase 1B found duplicate blocks or bad blocks associated with directory entry F, directory i-node I. The owner O, mode M, size S, modification time T, and directory name F are printed.

DUP/BAD I=I OWNER=O MODE=M SIZE=S MTIME=T FILE=F (REMOVE?)
Phase 1 or Phase 1B found duplicate blocks or bad blocks associated with file entry F, i-node I. The owner O, mode M, size S, modification time T, and filename F are printed.

BAD BLK B IN DIR I=I OWNER=O MODE=M SIZE=S MTIME=T
This message only occurs when the -D option is used. A bad block was found in DIR i-node I. Error conditions looked for in directory blocks are non-zero padded entries, inconsistent ``.'' and ``..'' entries, and embedded slashes in the name field. This error message means that you should at a later time either remove the directory i-node if the entire block looks bad or change (or remove) those directory entries that look bad.
Additional HTFS-only messages:

DIRECTORY TOO SHORT
The length of the directory being checked is below the minimum.

BAD INODE NUMBER FOR '.'

BAD INODE NUMBER FOR '..'
The directory entry for one of the required entries (``.'' or ``..'' is invalid).

EXTRA '.' ENTRY

EXTRA '..' ENTRY
An additional ``.'' or ``..'' entry has been found in the directory.

DIRECTORY d: LENGTH l NOT MULTIPLE OF m
The length of the directory is incorrect and is not a multiple of the block size.

MISSING '.'

MISSING '..'
One of the required directory entries ``.'' or ``..'' is missing. If the directory structure does not allow this to be fixed then additional messages may be produced describing the problem in more detail.

l IS AN EXTRANEOUS HARD LINK TO DIRECTORY
Hard links to directories are not supported by HTFS and may be the result of an upgrade from another filesystem where directory hard links were permitted. If possible such links should be removed before upgrading.

DIRECTORY CORRUPTED
A directory has been found that is incorrectly formed. A number of checks will be carried out to make sure that the directory is valid.

PARTIALLY TRUNCATED INODE I= i
Inode i has been found and is found to be truncated without the inode being updated.

Phase 3: check connectivity

This phase is concerned with the directory connectivity seen in Phase 2.

Meaning of yes/no responses -- Phase 3

Prompt n(no) y(yes)
RECONNECT? Ignores the error condition.
This invokes the UNREF error condition in Phase 4.
A ``no'' response is only appropriate if you intend to take other measures to fix the problem.
Reconnects directory i-node I to the filesystem in directory for lost files (usually lost+found).
This may invoke a lost+found error condition if there are problems connecting directory i-node I to lost+found.
This invokes CONNECTED information message if link was successful.

 +-----------+-----------------+---------------------+
 |Prompt     | n(no)           | y(yes)              |
 +-----------+-----------------+---------------------+
 |RECONNECT? | Ignores the     | Reconnects          |
 |           | error           | directory i-node I  |
 |           | condition.      | to the filesystem   |
 |           | This invokes    | in directory for    |
 |           | the UNREF error | lost files (usually |
 |           | condition in    | lost+found).        |
 |           | Phase 4.        | This may invoke a   |
 |           | A ``no''        | lost+found error    |
 |           | response is     | condition if there  |
 |           | only            | are problems        |
 |           | appropriate if  | connecting          |
 |           | you intend to   | directory i-node I  |
 |           | take other      | to lost+found.      |
 |           | measures to fix | This invokes        |
 |           | the problem.    | CONNECTED           |
 |           |                 | information message |
 |           |                 | if link was         |
 |           |                 | successful.         |
 +-----------+-----------------+---------------------+

Phase 3 error messages


UNREF DIR I=I OWNER=O MODE=M SIZE=S MTIME=T (RECONNECT?)
The directory i-node I was not connected to a directory entry when the filesystem was traversed. The owner O, mode M, size S, and modification time T of directory i-node I are printed. The fsck program forces the reconnection of a non-empty directory.

SORRY. NO lost+found DIRECTORY
There is no lost+found directory in the root directory of the filesystem; fsck ignores the request to link a directory in lost+found. HTFS fsck will prompt you if lost+found should be created. This invokes the UNREF error condition in Phase 4. Possible problem with access modes of lost+found.

SORRY. NO SPACE IN lost+found DIRECTORY
There is no space to add another entry to the lost+found directory in the root directory of the filesystem; fsck ignores the request to link a directory in lost+found. This invokes the UNREF error condition in Phase 4. Clean out unnecessary entries in lost+found or make lost+found larger by creating empty files in lost+found and then removing them.

DIR I=I1 CONNECTED. PARENT WAS I=I2
This is an advisory message indicating a directory i-node I1 was successfully connected to the lost+found directory. The parent i-node I2 of the directory i-node I1 is replaced by the i-node number of the lost+found directory.

Phase 4: check reference counts

This phase checks the link count information seen in Phases 2 and 3.

Meaning of yes/no responses -- Phase 4

Prompt n(no) y(yes)
RECONNECT? Ignores this error condition.
This invokes a CLEAR error condition later in Phase 4.
Reconnects i-node I to filesystem in the directory for lost files (usually lost+found).
This can cause a lost+found error condition in this phase if there are problems connecting i-node I to lost+found.
CLEAR? Ignores the error condition.
A ``no'' response is only appropriate if you intend to take other measures to fix the problem.
Deallocates the i-node by zeroing its contents.
ADJUST? Ignores the error condition.
A ``no'' response is only appropriate if you intend to take other measures to fix the problem.
Replaces link count of file i-node I with Y.
FIX? Ignores the error condition.
A ``no'' response is only appropriate if you intend to take other measures to fix the problem.
Replaces count in super-block by actual count.

 +-----------+-----------------+---------------------+
 |Prompt     | n(no)           | y(yes)              |
 +-----------+-----------------+---------------------+
 |RECONNECT? | Ignores this    | Reconnects i-node I |
 |           | error           | to filesystem in    |
 |           | condition.      | the directory for   |
 |           | This invokes a  | lost files (usually |
 |           | CLEAR error     | lost+found).        |
 |           | condition later | This can cause a    |
 |           | in Phase 4.     | lost+found error    |
 |           |                 | condition in this   |
 |           |                 | phase if there are  |
 |           |                 | problems connecting |
 |           |                 | i-node I to         |
 |           |                 | lost+found.         |
 +-----------+-----------------+---------------------+
 |CLEAR?     | Ignores the     | Deallocates the i-  |
 |           | error           | node by zeroing its |
 |           | condition.      | contents.           |
 |           | A ``no''        |                     |
 |           | response is     |                     |
 |           | only            |                     |
 |           | appropriate if  |                     |
 |           | you intend to   |                     |
 |           | take other      |                     |
 |           | measures to fix |                     |
 |           | the problem.    |                     |
 +-----------+-----------------+---------------------+
 |ADJUST?    | Ignores the     | Replaces link count |
 |           | error           | of file i-node I    |
 |           | condition.      | with Y.             |
 |           | A ``no''        |                     |
 |           | response is     |                     |
 |           | only            |                     |
 |           | appropriate if  |                     |
 |           | you intend to   |                     |
 |           | take other      |                     |
 |           | measures to fix |                     |
 |           | the problem.    |                     |
 +-----------+-----------------+---------------------+
 |FIX?       | Ignores the     | Replaces count in   |
 |           | error           | super-block by      |
 |           | condition.      | actual count.       |
 |           | A ``no''        |                     |
 |           | response is     |                     |
 |           | only            |                     |
 |           | appropriate if  |                     |
 |           | you intend to   |                     |
 |           | take other      |                     |
 |           | measures to fix |                     |
 |           | the problem.    |                     |
 +-----------+-----------------+---------------------+

Phase 4 error messages


UNREF FILE I=I OWNER=O MODE=M SIZE=S MTIME=T (RECONNECT?)
I-node I was not connected to a directory entry when the filesystem was traversed. The owner O, mode M, size S, and modification time T of i-node I are printed. If the -n option is omitted and the filesystem is not mounted, empty files are cleared automatically. Non-empty files are not cleared.

SORRY. NO lost+found DIRECTORY
There is no lost+found directory in the root directory of the filesystem; fsck ignores the request to link a file in lost+found. This invokes the CLEAR error condition later in Phase 4.

SORRY. NO SPACE IN lost+found DIRECTORY
There is no space to add another entry to the lost+found directory in the root directory of the filesystem; fsck ignores the request to link a file in lost+found. This invokes the CLEAR error condition later in Phase 4. Check size and contents of lost+found.

(CLEAR)
The i-node mentioned in the immediately previous UNREF error condition cannot be reconnected.

LINK COUNT FILE I=I OWNER=O MODE=M SIZE=S MTIME=T COUNT=X

SHOULD BE Y (ADJUST?)
The link count for i-node I, which is a file, is X but should be Y. The owner O, mode M, size S, and modification time T are printed.

LINK COUNT DIR I=I OWNER=O MODE=M SIZE=S MTIME=T COUNT=X

SHOULD BE Y (ADJUST?)
The link count for i-node I, which is a directory, is X but should be Y. The owner O, mode M, size S, and modification time T of directory i-node I are printed.

UNREF FILE I=I OWNER=O MODE=M SIZE=S MTIME=T (CLEAR?)
I-node I, which is a file, was not connected to a directory entry when the filesystem was traversed. The owner O, mode M, size S, and modification time T of i-node I are printed. If the -n option is omitted and the filesystem is not mounted, empty files are cleared automatically. Non-empty directories are not cleared.

UNREF DIR I=I OWNER=O MODE=M SIZE=S MTIME=T (CLEAR?)
I-node I, which is a directory, was not connected to a directory entry when the filesystem was traversed. The owner O, mode M, size S, and modification time T of i-node I are printed. If the -n option is omitted and the filesystem is not mounted, empty directories are cleared automatically. Non-empty directories are not cleared.

BAD/DUP FILE I=I OWNER=O MODE=M SIZE=S MTIME=T (CLEAR?)
Phase 1 or Phase 1B found duplicate blocks or bad blocks associated with file i-node I. The owner O, mode M, size S, and modification time T of i-node I are printed.

BAD/DUP DIR I=I OWNER=O MODE=M SIZE=S MTIME=T (CLEAR?)
Phase 1 or Phase 1B found duplicate blocks or bad blocks associated with directory i-node I. The owner O, mode M, size S, and modification time T of i-node I are printed.

FREE INODE COUNT WRONG IN SUPERBLK (FIX?)
The actual count of the free i-nodes does not match the count in the super-block of the filesystem. If the -q option is specified, the count will be fixed automatically in the super-block.

Phase 5: check free list

This phase checks the free-block list.

Meaning of yes/no responses -- Phase 5

Prompt n(no) y(yes)
CONTINUE? Terminates the program. Ignores rest of the free-block list and continues execution of fsck.
This error condition will always invoke BAD BLKS IN FREE LIST error condition later in Phase 5.
FIX? Ignores the error condition.
A ``no'' response is only appropriate if you intend to take other measures to fix the problem.
Replaces count in super-block by actual count.
SALVAGE? Ignores the error condition.
A ``no'' response is only appropriate if you intend to take other measures to fix the problem.
Replaces actual free-block list with a new free-block list.
The new free-block list will be ordered according to the gap and cylinder specs of the -s or -S option to reduce time spent waiting for the disk to rotate into position.

 +----------+-----------------+---------------------+
 |Prompt    | n(no)           | y(yes)              |
 +----------+-----------------+---------------------+
 |CONTINUE? | Terminates the  | Ignores rest of the |
 |          | program.        | free-block list and |
 |          |                 | continues execution |
 |          |                 | of fsck.            |
 |          |                 | This error          |
 |          |                 | condition will      |
 |          |                 | always invoke BAD   |
 |          |                 | BLKS IN FREE LIST   |
 |          |                 | error condition     |
 |          |                 | later in Phase 5.   |
 +----------+-----------------+---------------------+
 |FIX?      | Ignores the     | Replaces count in   |
 |          | error           | super-block by      |
 |          | condition.      | actual count.       |
 |          | A ``no''        |                     |
 |          | response is     |                     |
 |          | only            |                     |
 |          | appropriate if  |                     |
 |          | you intend to   |                     |
 |          | take other      |                     |
 |          | measures to fix |                     |
 |          | the problem.    |                     |
 +----------+-----------------+---------------------+
 |SALVAGE?  | Ignores the     | Replaces actual     |
 |          | error           | free-block list     |
 |          | condition.      | with a new free-    |
 |          | A ``no''        | block list.         |
 |          | response is     | The new free-block  |
 |          | only            | list will be        |
 |          | appropriate if  | ordered according   |
 |          | you intend to   | to the gap and      |
 |          | take other      | cylinder specs of   |
 |          | measures to fix | the -s or -S option |
 |          | the problem.    | to reduce time      |
 |          |                 | spent waiting for   |
 |          |                 | the disk to rotate  |
 |          |                 | into position.      |
 +----------+-----------------+---------------------+

Phase 5 error messages


EXCESSIVE BAD BLKS IN FREE LIST (CONTINUE?)
The free-block list contains more than a tolerable number of blocks (usually 10) with a value less than the first data block in the filesystem or greater than the last block in the filesystem.

EXCESSIVE DUP BLKS IN FREE LIST (CONTINUE?)
The free-block list contains more than a tolerable number of blocks (usually 10) claimed by i-nodes or earlier parts of the free-block list.

BAD FREEBLK COUNT
The count of free blocks in a free-list block is greater than 50 or less than 0. This error condition will always invoke the BAD FREE LIST condition later in Phase 5.

X BAD BLKS IN FREE LIST
X blocks in the free-block list have a block number lower than the first data block in the filesystem or greater than the last block in the filesystem. This error condition will always invoke the BAD FREE LIST condition later in Phase 5.

X DUP BLKS IN FREE LIST
X blocks claimed by i-nodes or earlier parts of the free-block list were found in the free-block list. This error condition will always invoke the BAD FREE LIST condition later in Phase 5.

X BLK(S) MISSING
X blocks unused by the filesystem were not found in the free-block list. This error condition will always invoke the BAD FREE LIST condition later in Phase 5.

FREE BLK COUNT WRONG IN SUPERBLOCK (FIX?)
The actual count of free blocks does not match the count in the super-block of the filesystem.

BAD FREE LIST (SALVAGE?)
This message is always preceded by one or more of the Phase 5 information messages. If the -q option is specified, the free-block list will be salvaged automatically.
Additional HTFS-only messages:

DUPLICATE BLOCK IN INODE SUMMARY
A block referenced in the inode group summary is already referenced by something else. A new block will be allocated to resolve the contention.

bad indirect bitmap block n
The structure used to keep track of allocated blocks on the filesystem has referenced a block that lies outside the filesystem. Under these circumstances fsck will try to locate the bitmap blocks directly.

corrupted bitmap block n
The structure used to keep track of allocated blocks on the filesystem has referenced an unexpected block.

Phase 6: salvage free list

This phase reconstructs the free-block list. It has one possible error condition that results from bad blocks-per-cylinder and gap values.

Phase 6 error messages


DEFAULT FREE LIST SPACING ASSUMED
This is an advisory message indicating the blocks-to-skip (gap) is greater than the blocks-per-cylinder, the blocks-to-skip is less than 1, the blocks-per-cylinder is less than 1, or the blocks-per-cylinder is greater than 500. The default values of 7 blocks-to-skip and 400 blocks-per-cylinder are used.

Cleanup phase

Once a filesystem has been checked, a few cleanup functions are performed. The cleanup phase displays advisory messages about the filesystem and status of the filesystem.

Cleanup phase messages


X files Y blocks Z free
This is an advisory message indicating that the filesystem checked contained X files using Y blocks leaving Z blocks free in the filesystem.

***** FILE SYSTEM WAS MODIFIED *****
This is an advisory message indicating that the current filesystem was modified by fsck.

Warning

If HTFS filesystems are being used, filesystem metadata may be lost if both of the following conditions are true: If the system with such a hardware combination crashes, run fsck with the -ofull option specified for all the filesystems at risk. You can protect the integrity of the metadata by using a battery backup power supply with the host adapter cache.

This only happens with write-back caches; write-through caches do not have this problem.

Limitations

When checking the root filesystem, fsck automatically remounts it if the damage is minor, or reboots the system. This behavior is now mandatory.

fsck will not run on a mounted non-raw filesystem unless the filesystem is the root filesystem or unless the -n option is specified and no writing out of the filesystem will take place. If any such attempt is made, a warning is displayed and no further processing of the filesystem is done for the specified device.

Files


/etc/fscmd.d/fstyp
directory containing programs for each filesystem type; each of these programs applies some appropriate heuristic to determine whether the supplied special file is of the type for which it checks

/etc/checklist
contains default list of filesystems to check

/etc/default/boot
automatic boot control

See also

checklist(F), filesystem(FP), fsck_vxfs(ADM), fsdb(ADM), init(M), mount(ADM)

Standards conformance

fsck is conformant with AT&T SVID Issue 2.

Notices

A version of fsck for use with dosfs and VxFS filesystems is available in /u95/bin. This command can handle files greater than 2GB. See fsck(1M) for more information.
© 2007 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 05 June 2007