How to recover lost partition table using Ubuntu Live CD and gpart

How to recover lost partition table using Ubuntu Live CD and gpart

While there are commercial programs to recover your lost partition table, there are also free alternatives. In this article we'll cover how to recover your lost partition table with Ubuntu Live CD and gpart.

Notes

1. You're advised to use the following method due to limitations of gpart (see below) and for being an easier alternative.

2. gpart is a fairly old program and is no longer supported by it's original author. It can only detect the following type of partitions;

  • DOS/Windows FAT
  • Linux ext2/swap
  • OS/2 HPFS
  • NTFS
  • FreeBSD and Solaris/x86 disklabels
  • Minix FS
  • QNX 4 FS
  • ReiserFS
  • LVM physical volumes
  • BeOS
  • FS
  • SGI
  • XFS

Steps

Follow these detailed step-by-step guide to recover your partition

Install gpart in Ubuntu live CD

As this article is quite long (no, not really), gpart's installation part is split into this article;

How to install gpart in Ubuntu Live CD

Recover and write partition table to disk

Run terminal

After the installation, run the terminal program

Check current partition table

You can see the current partition table by running the following command

cat/proc/partitions

View partition details

To see details of the partition, run fdisk

sudo fdisk -l /dev/sda

Guess partition table

With the basic view of your partition table, you can now really start recovering your partition table. Run the following command to see what the program really thinks of your partition table

sudo gpart /dev/sda

Write partition table to disk

If you agree with the suggestion, you can make gpart write the partition table to your disk with the following command

sudo gpart -W /dev/sda /dev/sda

No data is lost in this process. Partition table and file allocation table resides on different part of the disk. You can revert this with your favorite partitioning software

comments powered by Disqus