How to fix a corrupted partition table?

9,153

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.

Share:
9,153

Related videos on Youtube

Owen Newburn
Author by

Owen Newburn

Updated on September 18, 2022

Comments

  • Owen Newburn
    Owen Newburn over 1 year

    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.

    • Organic Marble
      Organic Marble about 9 years
      Both the primary and backup GPT tables are corrupt... (emphasis mine)
  • Organic Marble
    Organic Marble about 9 years
    Both the primary and backup GPT tables are corrupt... (emphasis mine)
  • Owen Newburn
    Owen Newburn about 9 years
    After trying what was suggested on gdisk I get the error "Caution! After loading partitions, the CRC doesn't check out!". I'm confused what is going on. If I use parted it says there is an sdb partition but fdisk says there are only sda1 and sda2 partitions.
  • teppic
    teppic about 9 years
    That's normal, you can view the loaded partition with p - and quit if it doesn't help.
  • Owen Newburn
    Owen Newburn about 9 years
    Ok so I printed the partition and I perhaps foolishly wrote the changes to the disk. I still cant find any operating system when I restart and gpart is now saying Warning! Read error 5; strange behavior now likely! Warning! Read error 5; strange behavior now likely! Partition table scan: MBR: not present BSD: not present APM: not present GPT: not present is it time to cut my losses format the hard disk and reinstall?
  • Rod Smith
    Rod Smith about 9 years
    Try TestDisk again, and if it fails, report more details. (Edit your original question.) It could be that TestDisk failed because of the damaged partition table data structures, which are now fixed (even though you don't have your partitions back).
  • s1mmel
    s1mmel about 9 years
    P.S.: On a personal note, never ever just do something, because someone suggests it (I've been there, too). Don't even trust me ^^ Make up your own mind and evaluate how valuable your data is.