Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ xfsck(1M) — Interactive 3.2r4.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fsck(1M)

XFSCK(1M)  —  

NAME

xfsck − check and repair XENIX filesystems

SYNOPSIS

/bin/xfsck [options] [filesystem] ... 

DESCRIPTION

The xfsck command audits and interactively repairs inconsistent conditions for XENIX System V filesystems.  If the filesystem is consistent, then xfsck reports number of files, number of blocks used, and number of blocks free.  If the filesystem is inconsistent, the user is prompted whether or not xfsck should proceed with each correction.  It should be noted that most corrective actions result in some loss of data.  The amount and severity of the loss can be determined from the diagnostic output.  If the user does not have write permission, xfsck defaults to the  action of the −n option. 

The xfsck options are:

-y Assumes a response to all questions asked by xfsck. 

-n Assumes a response to all questions asked by xfsck.  This option does not open the filesystem for writing. 

-s b:c 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. 

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

  -s
  -sBlocks-per-cylinder:Blocks-to-skip (filesystem interleave)

If b:c is not given, then the values that were used when the filesystem was created are used again.  If these values were not specified, then the default value is used. 

-S Conditionally reconstructs the free list. This option is similar to -s b:c above, except that the free list is rebuilt only if there are no discrepancies discovered in the filesystem. The -S option forces a “no” response to all questions asked by xfsck.  This option is useful for forcing free-list reorganization on uncontaminated filesystems. 

-t Causes xfsck to use the next argument as the scratch file, if needed. A scratch file is used if xfsck cannot obtain enough memory to keep its tables.  Without the -t flag, xfsck prompts the user for the name of the scratch file.  The file chosen should not be on the filesystem being checked. In addition, if the scratch file is not a special file or did not already exist, it is removed when xfsck completes.  Note that 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 disk drive, use a blank, formatted floppy disk in the floppy disk drive with (for example) /dev/fd0 specified as the scratch file. 

-q Causes xfsck to perform a quiet check.  Does not print size-check messages in Phase 1.  Unreferenced fifo5 files are selectively removed.  If xfsck requires it, counts in the superblock are automatically fixed and the free list salvaged. 

-D Checks directories for bad blocks.  Use this option after the system crashes. 

-f Causes xfsck to perform a fast check.  xfsck checks block and sizes (Phase 1) and checks the free list (Phase 5).  The free list is reconstructed (Phase 6), if necessary. 

-rr Recovers the root filesystem.  The required filesystem argument must refer to the root filesystem, and preferably to the block device (normally /dev/root).  This switch implies -y (yes) and overrides -n (no).  If any modifications to the filesystem are required, the system will be automatically shutdown to ensure the integrity of the filesystem. 

-c Causes any supported filesystem to be converted to the current filesystem type. The user is prompted to verify the conversion of each filesystem, unless the -y option is specified.  It is recommended that every filesystem be checked with this option while unmounted if it is to be used with the current version of XENIX.  To update the active root filesystem, check it with the following command line:

xfsck -c −rr /dev/root

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

The following are some of the inconsistencies xfsck checks for:

− Blocks claimed by more than one inode or the free list

− Blocks claimed by an inode or the free list outside the range of the filesystem

− Incorrect link counts

− Size checks:

Incorrect number of blocks
Directory size not 16-byte aligned

− Bad inode format

− Blocks not accounted for anywhere

− Directory checks:

File pointing to unallocated inode
Inode number out of range

− Super block checks:

More than 65536 inodes
More blocks for inodes than there are in the filesystem

− Bad free block list format

− Total free block or free inode count incorrect

With the user’s consent, xfsck reconnects orphaned (allocated, but unreferenced) files and directories by placing them in the lost+found directory.  The file’s (or directory’s) inode number then becomes its name.  Note that the lost+found directory must already exist in the root of the filesystem being checked and must have empty slots in which entries can be made.  To create the lost+found directory, copy a few files to the directory, then remove them (before executing xfsck).

FILES

/etc/checklistContains default list of filesystems to check
/etc/default/bootContains flags for automatic boot control

SEE ALSO

fsck(1M). 

NOTES

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

WARNINGS

xfsck does not support filesystems created under XENIX-86 version 3.0 because the word order in type long variables has changed.  However, xfsck is capable of auditing and repairing XENIX version 3.0 filesystems if the word ordering is correct. 

Run xfsck -rr /dev/root for the root filesystem. Run xfsck /dev/?? on the unmounted block device for all other filesystems. 

It is not recommended that users use xfsck on raw devices. Although checking a raw device is almost always faster, there is no way to tell if the filesystem is mounted.  If the filesystem is mounted, cleaning it will almost certainly result in an inconsistent superblock. 

\*U  —  Version 1.0

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