System Administration Guide: Devices and File Systems

ProcedureHow to Check Other File Systems (Not root (/), /usr, or /var)

For new information about fsck in the Solaris Express release, see Enhancements to UFS File System Utilities (fsck, mkfs, and newfs). There is no need to rerun fsck if you see the following message:


However, it doesn't harm the file system to rerun fsck after this message. This message is just informational about fsck's corrective actions.

This procedure assumes that the file system to be checked is unmounted.

For information on restoring a bad superblock, see How to Restore a Bad Superblock ( Solaris Express Release) or How to Restore a Bad Superblock (Solaris 8, 9, and 10 Releases).

  1. Become superuser or assume an equivalent role.

  2. Unmount the local file system to ensure that there is no activity on the file system.

    Specify the mount point directory or /dev/dsk/device-name as arguments to the fsck command. Any inconsistency messages are displayed.

    For example:

    # umount /export/home
    # fsck /dev/rdsk/c0t0d0s7
    ** /dev/dsk/c0t0d0s7
    ** Last Mounted on /export/home
  3. Correct any reported fsck errors.

    For information on how to respond to the error message prompts while you interactively check one or more UFS file systems, see Chapter 20, Resolving UFS File System Inconsistencies (Tasks), in System Administration Guide: Advanced Administration.

  4. If fsck cannot repair all of the problems after running it, see Fixing a UFS File System That the fsck Command Cannot Repair.

  5. Mount the repaired file system to determine if there are any files in the lost+found directory.

    Individual files put in the lost+found directory by the fsck command are renamed with their inode numbers.

  6. Rename and move any files put in the lost+found directory.

    If possible, rename the files and move them where they belong. Try to use the grep command to match phrases within individual files and the file command to identify file types.

    Eventually, remove unidentifiable files or directories left in the lost+found directory so that it doesn't fill up unnecessarily.

Example 22–1 Interactively Checking Non-root (/) or Non-/usr File Systems

The following example shows how to check the /dev/rdsk/c0t0d0s6 file system and correct the incorrect block count. This example assumes that the file system is unmounted.

# fsck /dev/rdsk/c0t0d0s6
** Phase 1 - Check Block and Sizes
INCORRECT BLOCK COUNT I=2529 (6 should be 2)

** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Cylinder Groups
929 files, 8928 used, 2851 free (75 frags, 347 blocks, 0.6%