Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

checklist(4)

crash(1M)

fs(4)

mkfs(1M)

ncheck(1M)

uadmin(2)

FSCK(1M)  —  Stardent Computer Inc. (Essential Utilities)

NAME

fsck − check and repair file systems

SYNOPSIS

/etc/fsck [−y] [−n] [−sX] [−SX] [−t file] [−q] [−D] [−f] [−b] [file-systems]

DESCRIPTION

fsck audits and interactively repairs inconsistent conditions for file systems.  If the file system is found to be consistent, the number of files, blocks used, and blocks free are reported.  If the file system is inconsistent the user is prompted for concurrence before each correction is attempted.  It should be noted that some corrective actions result in loss of some data.  The amount and severity of data loss may 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 −n action. 

The following options are accepted by fsck.

−y Assume a yes response to all questions asked by fsck.

−n Assume a no response to all questions asked by fsck; do not open the file system for writing.

−sX Ignore the actual free list and (unconditionally) reconstruct a new one by rewriting the super-block of the file system.  The file system should be unmounted while this is done; if this is not possible, care should be taken that the system is quiescent and that it is rebooted immediately afterwards.  This precaution is necessary so that the old, bad, in-core copy of the superblock will not continue to be used, or written on the file system. 

The −sX option allows for creating an optimal free-list organization. 

If X is not given, the values used when the file system was created are used.  The format of X is cylinder size:gap size. 

NOTE: This option has no effect on the Fast File System. 

−SX Conditionally reconstruct the free list. This option is like −sX above except that the free list is rebuilt only if there were no discrepancies discovered in the file system. Using −S will force a no response to all questions asked by fsck. This option is useful for forcing free list reorganization on uncontaminated file systems.

NOTE: This option has no effect on the Fast File System. 

−t 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. Without the −t flag, fsck will prompt the user for the name of the scratch file. The file chosen should not be on the file system being checked, and if it is not a special file or did not already exist, it is removed when fsck completes. 

−q Quiet fsck. Do not print size-check messages.  Unreferenced fifos will silently be removed.  If fsck requires it, counts in the superblock will be automatically fixed and the free list salvaged. 

−D Directories are checked for bad blocks.  Useful after system crashes. 

−f Fast check.  Check block and sizes and check the free list.  The free list will be reconstructed if it is necessary. 

−b Reboot.  If the file system being checked is the root file system and modifications have been made, then either remount the root file system or reboot the system.  A remount is done only if there was minor damage. 

If no file-systems are specified, fsck will read a list of default file systems from the file /etc/checklist. 

Inconsistencies checked are as follows:

1.  Blocks claimed by more than one i-node or the free list. 

2.  Blocks claimed by an i-node or the free list outside the range of the file system. 

3.  Incorrect link counts. 

4.  Size checks:

Incorrect number of blocks. 
Directory size not 16-byte aligned.

5.  Bad i-node format. 

6.  Blocks not accounted for anywhere. 

7.  Directory checks:

File pointing to unallocated i-node. 
I-node number out of range.

8.  Super Block checks:

More than 65536 i-nodes. 
More blocks for i-nodes than there are in the file system.

9.  Bad free block list format. (System V file system only.) 

10.  Total free block and/or free i-node count incorrect. 

Orphaned files and directories (allocated but unreferenced) are, with the user’s concurrence, reconnected by placing them in the lost+found directory, if the files are nonempty.  The user will be notified if the file or directory is empty or not.  Empty files or directories are removed, as long as the −n option is not specified.  fsck will force the reconnection of nonempty directories.  The name assigned is the i-node number.  The only restriction is that the directory lost+found must preexist in the root of the file system being checked and must have empty slots in which entries can be made.  This is accomplished by making lost+found, copying a number of files to the directory, and then removing them (before fsck is executed). 

Checking the raw device is almost always faster and should be used with everything but the root file system. 

WARNING Do not use the raw device on the root file system or serious damage to the file system will result. 

FILES

/etc/checklist contains default list of file systems to check. 

SEE ALSO

checklist(4), crash(1M), fs(4), mkfs(1M), ncheck(1M), uadmin(2). 

BUGS

I-node numbers for .  and .. in each directory are not checked for validity. 

September 29, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026