Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fsck(1M) — A/UX 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

clri(1M)

fsirand(1M)

mkfs(1M)

ncheck(1M)

newfs(1M)

typefs(1M)

fs(4)

fstab(4)




fsck(1M) fsck(1M)
NAME fsck - checks file-system consistency and interactively repairs the file system SYNOPSIS fsck -Tfs-type [-y] [-n] [-m timeout] [-s interleave] [-S interleave] [-t file] [-q] [-D option]... [-f] [-p passtostart] [svfs-filesystem]... fsck -Tfs-type [-b block-number] [-y] [-n] [-m timeout] [-p passtostart] [ufs-filesystem]... ARGUMENTS -b block-number Uses the block specified immediately after the option as the superblock for the file system. Block 16 is always an alternate superblock. This option is for a Berkeley 4.2 UNIX File System (UFS) file system. -D option Checks directories for bad blocks. If option is empty, the directories are merely checked. Replace option with one or more of the following: B Checks for and clears parity bits in filenames. C Checks whether all trailing characters in the filename are null. CZ Checks and writes nulls to all trailing characters in the filename. This option is for an System V File System (SVFS) file system. -f Uses a fast check to check blocks and sizes (phase 1) and the free list (phase 5). Reconstructs the free list (phase 6) if necessary. This option is for an SVFS file system. -m timeout Causes fsck to present a Macintosh-like user interface, which causes StartMonitor to move the progress bar forward periodically 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 that asks you if you want to repair the file system. If you click the default Repair button in the alert box, fsck assumes a yes response to all further questions regarding that file system. If you click Don't Repair, fsck assumes a no response to all further questions regarding that file system. If you give a timeout value greater than 0, the default Repair button is automatically selected after that number of seconds. January 1992 1



fsck(1M) fsck(1M)
If you do not specify a value for timeout, the default is 0, indicating that the Repair button is not automatically selected. -n Causes the operating system to assume a no response to all questions asked by fsck. This option does not open the file system for writing. -p passtostart Acts similar to the -q option (later in this section), but it also suppresses mid-progress phase messages. Besides quietly fixing (``preening'') certain file- system inconsistencies, the -p option and passtostart number provide another way to specify which file systems to check. The value of 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 value of passtostart is 1. If the value of the pass number (that is, the number in the passno field) is 2, as it normally is for the invocation of fsck in the startup script 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 (read-write) or ro (read-only) are subject to being checked this way. If the superblock state field indicates that the file system was properly unmounted, it is skipped. -q Suppresses progress messages and eliminates the need to confirm certain corrective actions. A fifo that is unreferenced is silently removed. If fsck detects inconsistencies, it automatically fixes counts in the superblock and salvages the free list. Inconsistencies other than these still require confirmation. This option is for an SVFS file system. -s interleave Ignores the actual free list and (unconditionally) reconstructs a new one by rewriting the superblock of the file system. You should unmount the file system during this operation. If this is not possible, take care that the system is quiescent and reboot it immediately afterward. This precaution 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. The -s interleave option allows for creating an optimal free-list organization. The argument interleave should be in the format blocks-per-cylinder:blocks-to-skip. If you do not specify interleave, the values used when the file system was created are used. If these values 2 January 1992



fsck(1M) fsck(1M)
were not specified, then the value 400:7 is used. This option is for an SVFS file system. -S interleave Conditionally reconstructs the free list. This option is like the -s interleave option except that the free list is rebuilt only if no discrepancies were discovered in the file system. Using the -S option forces a ``No'' response to all questions asked by fsck. This option is useful for forcing free-list reorganization on uncontaminated file systems. svsf-filesystem Specifies a System V file system. -t file Specifies a scratch file to be used if fsck cannot obtain enough memory to maintain its tables. Without this option, fsck prompts you for the name of a scratch file. The file, when chosen, should not be on the file system being checked. If it is not a special file or did not already exist, it is removed when fsck completes its check. This option is used for an SVFS file system. -T fs-type Specifies a file-system type, for example, 4.2 for a Berkeley 4.2 file system (UFS) or 5.2 for an SVFS file system. If you do not use this option, fsck attempts to determine the type. ufs-filesystem Specifies a Berkeley 4.2 file system. -y Causes the system to assume a yes response to all questions asked by fsck. DESCRIPTION fsck audits and interactively repairs inconsistent conditions for A/UX file systems. If you do not specify filesystem (that is, whether the file system is System V or Berkeley 4.2), fsck reads a list of default file systems from the file /etc/fstab. If the file system is consistent, then fsck reports only the number of files, the number of blocks used, and the number of blocks free. If the file system is inconsistent, fsck prompts you for confirmation to proceed before attempting each corrective action. Frequently, corrective actions result in some loss of data. You can determine the amount and severity of data loss by examining various parameters, such as nonzero file size. Typically, each consistency correction is controlled by your yes or no response. However, if you do not have write January 1992 3



fsck(1M) fsck(1M)
permission for the file system being checked, fsck merely indicates the corrective actions needed. The fsck command has more consistency checks than its predecessors (check, dcheck, fcheck, and icheck) combined. It is almost always faster to check the raw device than to use the block device. Use the fsck command with everything except the root file system. In addition, you should unmount any file system other than the root file system when you check it with fsck. (It is not possible to unmount the root file system.) Consistency Checks Performed The fsck command checks the following inconsistencies: ⊕ 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 file system ⊕ Incorrect link counts ⊕ Size inconsistencies Incorrect number of blocks Directory size not correctly aligned ⊕ Bad inode format ⊕ Blocks not accounted for anywhere ⊕ Directories, to find the following: Files pointing to unallocated inodes Inode numbers out of range ⊕ Superblocks: More than the maximum number of inodes More blocks for inodes than there are in the file system ⊕ Bad free-block list format ⊕ Incorrect total free-block count, free-inode count, or both Reconnection of Dislocated Files With your confirmation, fsck reconnects orphaned files and directories (that is, those allocated but unreferenced), if they are not empty, by placing them in the lost+found directory. It also tells you whether the file or directory is empty or not. If it is empty, fsck silently removes it, 4 January 1992



fsck(1M) fsck(1M)
forces the reconnection of nonempty directories, and assigns the inode number as the name. The only restriction is that the directory lost+found must already exist in the root of the file system being checked and must have empty slots in which entries can be made. Create a lost+found directory by making a directory named lost+found, copying a number of files to that directory, and then removing the files before running fsck. See mklost+found(1M). EXAMPLES The following command checks the consistency of the file system referenced by /dev/rdsk/c0d0s0: fsck /dev/rdsk/c0d0s0 STATUS MESSAGES AND VALUES The messages produced by fsck are intended to be self- explanatory. LIMITATIONS Inode numbers for . and .. in each directory should be checked for validity. FILES /etc/fsck Executable file /etc/%fsck Resource file /etc/fstab Default list of file systems to check /etc/svfs/fsck Executable file for repairing the SVFS file system /etc/ufs/fsck Executable file for repairing the UFS file system SEE ALSO clri(1M), fsirand(1M), mkfs(1M), ncheck(1M), newfs(1M), typefs(1M) fs(4), fstab(4) in A/UX Programmer's Reference ``Checking the A/UX File System: fsck'' in A/UX Local System Administration January 1992 5

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