Go to main content

Managing File Systems in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020

How to Check a UFS File System

There is no need to rerun the fsck command if you see the following message:


This message is an informational message about the actions of fsck. You can run fsck after the message is displayed.

  1. Become an administrator.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.4.

  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. If there are any inconsistencies, error messages are displayed.

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

    For information about how to respond to the error message prompts while you check one or more UFS file systems, see Resolving UFS File System Inconsistencies.

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

    The fsck command moves individual files to the lost+found directory and these files are renamed with their inode numbers.

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

    Rename the files and move them to their original location. Use the grep command to match phrases within individual files and the file command to identify the type of file.

    Remove all the unidentifiable files or directories left in the lost+found directory so that the directory does not fill.

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

Example 12  Interactive Checking of UFS 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%