Problem
I want to run fsck(ADM) on all filesystems on my machine. Can I do this without typing a separate command for each filesystem?
Solution
Yes, you can. The fsck command will read the /etc/checklist file for filesystem names when it is invoked without a filesystem argument. By adding all filesystem names to the checklist(F) file, you will be able to enter the fsck command once and have all filesystems checked.
There are limitations to this. The /etc/checklist file cannot contain more than 15 filesystem names. fsck cannot be run on remote file systems. fsck should never be run in multiuser mode, and filesystems must be unmounted before running fsck on them.
NOTE: The /dev/root and /dev/boot filesystems are exceptions to this last rule. They can and must remain mounted.
The /etc/default/filesys file can also help automate the fsck process. Each filesystem can be listed in the filesys(F) file and fsck options for each filesystem can be specified using the fsckflags= parameter. Check the fsck(ADM) man page for all available options.
With the filesystems listed in /etc/checklist and options for each
filesystem listed in /etc/default/filesys, simply typing "fsck" will
clean each filesystem with its own set of fsck options. Again, be
sure to unmount all non-root, non-boot filesystems before running
fsck in this manner.Below are sample steps that would be taken to have fsck check all filesystems each with their own set of fsck options. This example assumes the system has the following filesystems: /dev/root (mounted to /), /dev/boot (mounted to /stand), /dev/u1, and /dev/u2, /dev/pdev.
1. Bring the system into system maintenance mode:
# init 12. Use the mount command to see what filesystems are mounted:
# mount3. Use the umount command to unmount filesystems:
# umount /dev/u1
# umount /dev/u2
# umount /dev/pdev4. Use your favorite editor to add entries to the /etc/checklist file. You will see a line for /dev/root already there. The edited file would look like this:
/dev/root
/dev/u1
/dev/u2
/dev/pdev5. Use your favorite editor to add or modify entries in the /etc/default/filesys file. The edited file might look like this:
#@(#) filesys.src 25.3 95/03/30
#
#Copyright (C) 1988-1995 The Santa Cruz Operation, Inc.
# All Rights Reserved.
#The information in this file is provided for the exclusive use of
#the licensees of The Santa Cruz Operation, Inc. Such users have the
#right to use, modify, and incorporate this code into other products
#for purposes authorized by the license agreement provided included
#this notice and the associated copyright notice with any product.
#The information in this file is provided "AS IS" without warranty.
#
# default/filesys - Filesystem mount table: filesys(F)
#bdev=/dev/boot cdev=/dev/rboot \
mountdir=/stand mount=no fstyp=EAFS \
fsck=no fsckflags= rcmount=yes \
rcfsck=no mountflags=
bdev=/dev/root cdev=/dev/rroot \
mountdir=/ mount=no fstyp=HTFS \
fsck=no fsckflags=-ofull rcmount=no \
rcfsck=no mountflags=
bdev=/dev/u1 cdev=/dev/ru1 \
mountdir=/u1 mount=no fstyp=HTFS \
fsck=dirty fsckflags=-y \
rcmount=yes rcfsck=dirty
bdev=/dev/u2 cdev=/dev/ru2 \
mountdir=/u2 mount=no fstyp=HTFS \
fsck=dirty fsckflags=-y \
rcmount=yes rcfsck=dirty
bdev=/dev/pdev cdev=/dev/rpdev \
mountdir=/pdev mount=no fstyp=HTFS \
fsck=dirty fsckflags=-ofull -y \
rcmount=yes rcfsck=dirty6. You are now ready to run fsck without options or filesystems specified, and all filesystems listed in /etc/checklist will be checked, each using its own set of options as specified (with the fsckflags= keyword) in the /etc/default/filesys file.
See also
ta105411, "Filesystem Repair Utilities for SCO OpenServer 5.0.0,
5.0.2, 5.0.4, 5.0.5."fsck(ADM); checklist(F); filesys(F)