Thursday, November 1, 2018

How-To Recover Accidentally Deleted Disk Partition In Linux?

There are many a times that we’ve come across this situation where an “hard drive partition table has been erased accidentally” or “partition data is missing or corrupted” and hence, unable to mount respective block devices. Yes, “how to recover or repair corrupted or deleted partition table of a hard drive” or “how can I recreate hard drive partition table without losing data” are some of the keywords that we hit on Internet to find out a solution. There are a few third party tools (many from open-source) available which could get this job done, however, I wanted to show how this could be done using native tools/commands in Linux operating system. There are at times that we could not use those third party tools, hence, we’ve to go with native way of restoring partition table data. So, let’s see how could we get this achieved. NOTE: If a hard drive is extremely damaged (physically) or if it is re-formatted (making a file system) or if meta-data itself is gone corrupted or severely damaged then there are very less chances of recovering data, in such cases users may have to rely on some sophisticated third party tools which may recover some or part of data. The situation that I’m going to cover here is wherein a hard drive partition table is erased, however, no re-formatting has been done yet.

How-To Recover Accidentally Deleted Disk Partition -Part2

Method 2
The earlier method was a bit lengthy and needs proper planning and implementation. Now, let’s discuss about using parted tool to recover corrupted or deleted partition table details. This method is rather easy and straight farword which doesn’t need so many steps to be performed as we did earlier.

The “parted” tool is a powerful disk utility which can do many functions such as recovery of partition data, resize etc., and also the default utility being used if disk size is greater than 2.2TB. Another powerful feature of “parted” is that it is GPT aware.