Fixing corrupt backup GPT table?
After successfully installing a dual boot environment, adding Ubuntu 13.10 to a preinstalled Windows 8 configuration I decided to increase the unallocated SSD disk space after reading about the benefits of over-provisioning. So, using miniTools Partition Wizard in Windows, I shrunk the NTFS Windows partition somewhat. That seem to have completed successfully. However, when I boot up Linux and launch GParted, it gives the following error message at startup:
The backup GPT table is corrupt, but the primary appears OK, so that will be used.
Everything seems fine and dandy with the system, but I am worried that I will have a problem should the main GPT table become corrupt for some reason.
I have used gdisk to backup the GPT table to a file, but is there a way to create a new backup GPT table?
13 Answers
Best to backup partition table first, just in case changes are not correct. Then it is possible to restore old partition table. If drive is sda & save to another drive:
sudo sfdisk -d /dev/sda > PT_sda.txtUse gdisk and verify partitions are correct with p, and use w to write the partition table. If not correct just use q to quit. That should update primary, backup & protective MBR.
sudo gdisk /dev/sda
Command (? for help):
bback up GPT data to a file
cchange a partition's name
ddelete a partition
ishow detailed information on a partition
llist known partition types
nadd a new partition
ocreate a new empty GUID partition table (GPT)
pprint the partition table
qquit without saving changes
rrecovery and transformation options (experts only)
ssort partitions
tchange a partition's type code
vverify disk
wwrite table to disk and exit
xextra functionality (experts only)
?print this menu
Be sure to see comment below by Rod Smith, he is author of gdisk at his rodbooks site.
8The simplest way to fix backup GPT is:
sgdisk -e <target-device>for example:
sgdisk -e /dev/sdaAs documented in the manual the -e option:
2-e, --move-second-header: Move backup GPT data structures to the end of the disk. Use this option if you've added disks to a RAID array, thus creating a virtual disk with space that follows the backup GPT data structures. This command moves the backup GPT data structures to the end of the disk, where they belong.
Not exactly sure, but when I have two disks part of software raid (MDADM) I get this message. I damaged the array trying to remove this message. I was forced to recreate the array, and I still get this message. Since the array works, but I still get this message, I am just going to live with the message instead of trying to remove/fix it.
2