Go to main content

Managing File Systems in Oracle® Solaris 11.3

Exit Print View

Updated: October 2017
 
 

Fixing a UFS File System That the fsck Command Cannot Repair

The fsck command operates in several passes. For example, a problem corrected in later passes can expose other problems that have occurred in earlier passes. Therefore, it is sometimes necessary to run fsck until it no longer reports any problems. Doing so ensures that all errors are found and repaired.

Pay attention to the information displayed by the fsck command. This information might help you fix the problem. For example, the messages might point to a damaged directory. If you delete the directory, you might find that the fsck command runs cleanly.

If the fsck command still cannot repair the file system, try to use the ff, clri, and ncheck commands to understand and fix what is wrong. For information about these commands, see the fsdb(1M), ff(1M), clri(1M), and ncheck(1M) man pages.

If you are unable to repair a file system but can mount it as read-only, try using the cp, tar, or cpio commands to retrieve all or part of the data from the file system.

If hardware disk errors are causing the problem, you might need to reformat and repartition the disk again before re-creating and restoring file systems. Check if the device cables and connectors are functional before replacing the disk device. Hardware errors usually display the same error again and again across different commands. The format command tries to work around bad blocks on the disk. However, if the disk is too severely damaged, the problems might persist, even after you reformat the disk. For information about the format command, see the format(1M) man page.