Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fsck(1M) — A/UX 2.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

clri(1M)

fsirand(1M)

mkfs(1M)

ncheck(1M)

newfs(1M)

typefs(1M)

fstab(4)

fs(4)




fsck(1M) fsck(1M)
NAME fsck - check file-system consistency and interactively repair SYNOPSIS /etc/fsck -T 5.2 [-y] [-n] [-mtimeout] [-sX] [-SX] [-tfile] [-q] [-Doptions...] [-f] [-ppasstostart] [svfs-filesystem...] /etc/fsck [-bblock-number] [-y] [-n] [-mtimeout] -T 4.2 [- ppasstostart] [ufs-filesystem...] DESCRIPTION fsck audits and interactively repairs inconsistent condi- tions for A/UX(Reg.) file systems. If filesystem is not specified, fsck reads a list of default file systems from the file /etc/fstab. If the file system is consistent, then only the number of files, number of blocks used, and number of blocks free are reported. If the file system is incon- sistent, the operator is prompted for confirmation to proceed before each corrective action is attempted. Fre- quently corrective actions result in some loss of data. The amount and severity of data lost may be determined by exa- mining various parameters such as non-zero filesize. Typi- cally, each consistency correction is gated by the operator's yes or no response. However, if the operator does not have write permission for filesystem, fsck merely indicates corrective actions needed. fsck has more consistency checks than its predecessors check, dcheck, fcheck, and icheck combined. Checking the raw device is almost always faster and should be used with everything but the root file system. In addi- tion, any file system other than the root file system should be unmounted at the time that it is checked with fsck. (It is not possible to unmount the root file system.) FLAG OPTIONS The flag options for the fsck command differ depending on the type of file system. The following flag options apply to both System V file sys- tems (SVFS) and Berkeley 4.2 file systems (UFS): -Tfile-system-type Indicate the file-system type, for example, 4.2 for a Berkeley 4.2 file system (UFS) or 5.2 for a SVFS file system. If this option is not used, fsck attempts to determine the type. -y Assume a yes response to all questions asked by fsck. April, 1990 1



fsck(1M) fsck(1M)
-n Assume a no response to all questions asked by fsck. This flag option does not open the file system for writing. -mtimeout Use a Macintosh(Reg.) user interface. This causes the StartMonitor to move the progress bar forward periodi- cally during the boot sequence. In addition, if fsck finds a problem with a file system, it calls /etc/macquery to post a Macintosh alert box asking the user if he or she would like to repair the file sys- tem. If the user clicks the default Repair button in the alert box, fsck assumes a yes response to all further questions regarding that file system. If the user clicks Don't Repair, fsck assumes a no response to all further questions regarding that file system. If a timeout value greater than 0 is given, the dialog automatically selects the default button after that number of seconds. If timeout is not given, the de- fault is 0, indicating that the alert should not au- tomatically time out. -ppasstostart Similar to the -q option, but mid-progress phase mes- sages are also suppressed. Besides quietly fixing (``preening'') certain file-system inconsistencies, the -p flag option and passtostart number provide another way to specify which file systems to check. passtostart specifies a threshold value that triggers the checking of a file system depending on its passno field in /etc/fstab (see fstab(4)). The default passtostart number is 1. If the value of the pass number is 2, as it normally is for the fsck in /etc/bcheckrc, only those file systems in /etc/fstab with pass numbers of 2 or greater are checked. Only partitions in fstab that are mounted rw or ro are sub- ject to being checked this way. If the superblock state field indicates that the file system was proper- ly unmounted, it is skipped. The following options are interpreted by fsck for a SVFS file system: -sX Ignore the actual free list and (unconditionally) reconstruct a new one by rewriting the superblock of the file system. The file system should be unmounted during this operation, and if this is not possible, care should be taken that the system is quiescent and that it is rebooted immediately afterward. This pre- caution is necessary so that the obsolete main memory copy of the superblock does not continue to be used, or to be written onto the file system. 2 April, 1990



fsck(1M) fsck(1M)
The -sX flag option allows for creating an optimal free-list organization. The argument X should be in the format blocks-per-cylinder:blocks-to-skip. If X is not given, the values used when the file system was created are used. If these values were not specified, then the value 400:7 is used. -SX Conditionally reconstruct the free list. This flag op- tion is like -sX except that the free list is rebuilt only if no discrepancies were discovered in the file system. Using -S forces a no response to all questions asked by fsck. This flag option is useful for forcing free-list reorganization on uncontaminated file sys- tems. -tfile Use a scratch file if fsck cannot obtain enough memory to maintain its tables. If the -t option is specified, file is used, if needed, as the scratch file. Without the -t flag, fsck prompts the operator for the name of a scratch file. The file, when 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 Suppress progress messages as well as eliminate the need to confim certain corrective actions. Unrefer- enced fifos are silently removed. If fsck detects in- consistencies, counts in the superblock are automati- cally fixed, and the free list salvaged. Inconsisten- cies other than these still require confirmation. -Doptions Check directories for bad blocks. If options is empty, the directories are merely checked. The B option checks for and clears parity bits in filenames, C checks whether all trailing characters in the filename are null, and CZ checks and writes nulls to all trail- ing characters in the filename. -f Use a fast check to check blocks and sizes (Phase 1) and the free list (Phase 5). The free list is recon- structed (Phase 6) if necessary. The following flag option is unique to fsck for a Berkeley 4.2 (UFS) file system: -bblock-number Use the block specified immediately after the flag as the superblock for the file system. Block 16 is al- ways an alternate superblock. April, 1990 3



fsck(1M) fsck(1M)
Consistency Checks Performed Inconsistencies checked are as follows: 1. Blocks claimed by more than one inode or the free list are checked. 2. Blocks claimed by an inode or the free list outside the range of the file system are checked. 3. Incorrect link counts are checked. 4. Size checks are performed to check for: incorrect number of blocks directory size not correctly aligned 5. Checks for bad inode format are performed. 6. Checks for blocks not accounted for anywhere are per- formed. 7. Directory checks are performed to find: files pointing to unallocated inodes inode numbers out of range 8. Superblock checks are performed for: more than the maximum number of inodes. more blocks for inodes than there are in the file system 9. Checks for a bad free-block list format are performed. 10. Checks for incorrect total free block or free inode count, or both, are performed. Reconnection of dislocated files Orphaned files and directories (allocated but unreferenced) are, with the operator's confirmation, reconnected, if not empty, by placing them in the lost+found directory. The user is notified if the file or directory is empty or not. If it is empty, fsck silently removes them and forces the reconnection of nonempty directories. The name assigned is the inode number. The only restriction is that the directo- ry 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 a lost+found direc- tory, copying a number of files to the directory, and then removing the files before fsck is executed. See mklost+found(1M). EXAMPLES fsck /dev/rdsk0/c0d0s0 checks the consistency of the file system referred through /dev/rdsk0/c0d0s0. FILES /etc/fsck /etc/ufs/fsck /etc/svfs/fsck /etc/%fsck 4 April, 1990



fsck(1M) fsck(1M)
/etc/fstab Contains default list of file systems to check SEE ALSO clri(1M), fsirand(1M), mkfs(1M), ncheck(1M), newfs(1M), typefs(1M), fstab(4), fs(4). ``Checking the A/UX File System: fsck,'' in A/UX Local Sys- tem Administration. DIAGNOSTICS The diagnostics produced by fsck are intended to be self- explanatory. BUGS Inode numbers for . and .. in each directory should be checked for validity. April, 1990 5

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