Ubuntu – How to fix a corrupted partition table


I was running a duel boot windows 8.1 and ubuntu 14.04 when I suddenly could no longer boot my system. After booting into a live usb and run GParted I get this error:

Input/output error during read on /dev/sdb

/dev/sda contains GPT signatures, indicating that it has a GPT table. However, it does not have a valid fake msdos partition table, as it should. Perhaps it was corrupted — possibly by a program that doesn't understand GPT partition tables. Or perhaps you deleted the GPT table, and are now using an msdos partition table. Is this a GPT partition table?

Both the primary and backup GPT tables are corrupt. Try making a fresh table, and using Parted's rescue feature to recover partitions.

Is there a way to fix this? I have tried TestDisk which won't run. Is there also a way I can backup my hard drive before I do anything that might damage my computer.

Best Answer

The simplest option is to try to use the backup GPT table. This is stored automatically on the disk. The gdisk utility can do all of this for you. Simply load as normal,

# gdisk /dev/sdb

And enter the recovery and transformation menu (r), and option c to load the backup table. If it's successful you can write the correct table back out again. It won't write anything until you tell it to.