How to Remedy Typical Hard Drive Issues and Rescue Important Files on Linux

If you go for stability in an operating system, then certainly Linux makes for a good choice. However, merely this can’t ascertain that that you will have a trouble-free experience on your Linux computer. There are various other things that may cause despair, such as hard drive failures, errors in the file system, accidental deletion of files on the Linux drive, and more. Thankfully, Linux has a range of tools built into its kernel that can do away with a majority of these issues easily.

In general, there are three types of file systems used on Linux hard drives, i.e. FAT-based (such as FAT16), inode-based (the ext family), and log-structured (for instance ZFS). Each of these file systems is good in their own right, but none of them is immune to failures. When a failure occurs, you should check the lowest corrupt level (i.e. file or hard drive). You should determine if the file system has gone bad or corruption has reached the data stored on your drive. In case your drive has suffered a physical failure, you should consider going for a recovery service.

‘e2fsck’, the successor to UNIX ‘fsck’ command-line utility, has a knack of checking and fixing errors in the Ext2/Ext3/Ext4 family of file systems. The utility can be only used with unmounted partitions. To run this command, you need to first switch to run level 1 and unmount the partition to be fixed. Once you have done that, you can run the command as follows:

e2fsck -y /dev/sdb1
(Checking unmounted partition ‘/dev/sdb1’ with e2fsck)

You can recheck the partition to see if all the error have disappeared and remount the partition to access data.

Another common issue on Linux systems is the corrupt or missing partition table. Such issues may result from an interrupted write operation to the disk pages that store the partition table or deletion of any wrong partition on the hard drive. In order to fix this problem, you should boot from a live CD and run Test Disk as follows:

testdisk /dev/sdc

This utility runs a scan against your drive to examine each file system. It attempts to rebuild the partition table based on the information collected through the scan. In some cases, TestDisk can fix partition errors within seconds.

In order to check for bad blocks on your hard drive, you can use the ‘badblocks’ command as follows:

sudo badblocks -sv /dev/sdc

You should search for bad blocks before repairing your file system. The command will help you identify sector corruption on your drive. Once you are rest assured that the drive is clean, proceed to repair your file systems.

In rare cases, the above methods would fail to bring your system to a consistent state. If this happens and your data is mission-critical, you should use professional Linux data recovery software. These software are equipped with dedicated and non-destructive algorithms to recover every piece of critical information from your hard drive, including files, photos, documents, audios, movies, and more. In addition, they can work on all the mainstream Linux distributions, such as Ubuntu, Red Hat, Fedora, etc.