Wednesday, May 11, 2011

How to fix file system corruption problem in linux when FSCK fails

Although Linux machine is considered as one of the most crash resistant but some times it too suffers from crash due to various unavoidable reasons like file system corruption and hardware failures. File system corruption can be easily resolved by running 'fsck' command, FSCK or "file system check" is a tool to check the consistency of Linux file systems But what will happens if this utility itself fails as the case of extreme corruption . As a consequence, we may lose all the valuable data stored in your system. To overcome the problem, we need to look for some third party Linux data recovery tool to get back our critical data.
    
For instance, we may come across the following series of error messages after starting our Linux machine:   First, we encounter “dev/hda2 contains a file system with errors-check forced” error

The system performs an automatic "File System Check" (fsck) and displays the following messages on your screen-

“unexpected inconsistency RUN fsck manually without -a or -p options” 
“An automatic file system check of root file system failed. fsck should be performed in maintenance mode with root file system in read only” 
“a manual fsck must be performed then system rebooted”

Now lets check the reason behind this error:-

We have to face such behavior because there is some corruption in our file system. The corruption could be due to various reasons, like

 1) Virus infection
 2) Operating system malfunction
 3) Super-block or Inode damage

This will prevent us from accessing the data. An updated backup will help to retrieve all the lost or inaccessible data. However, if the backup is not available, we should follow the below steps to get back the data.
  • Run the 'fsck' command manually following the syntax as given below-
              --'fsck [ -F fstype] [-V] [-yY] [-o options] special'

Here 'fstype' is the file system type and 'special' resembles the character device name of the file system. 

If the problem still persists, you should take help of a third party linux recovery tool. These tools are made to recover all the lost data from a Linux-based machine in any case of severe corruption and data loss.