How to fix corrupt primary GPT table?
Posted: 21 Jun 2014, 16:06
After experiencing a power outage today, my B3 won't boot anymore. I have managed to create a recovery USB stick, boot up the B3 with this stick (not reinstalling, just "rescue mode"), and SSH into the B3.
Running parted shows me something is wrong with the disk's partitioning. It tells me that the primary GPT table is corrupt. It also tells me that the backup seems fine, and if I choose ok to use the backup I can list the partitions on the disk (and everything seems correct).
How do I recover the corrupt primary GPT table? I have the impression that tools like gparted and gdisk may be able to do this, but I don't have access to these tools in the recovery stick's basic rescue mode. And I haven't found a way to use parted to fix the problem.
Do I really need to take out the disk of my B3 and put it in a system with more advanced disk/partitioning tools to address this issue?
I have pasted the output from parted below.
# parted /dev/sda
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
Error: Input/output error during read on /dev/sda
Retry/Ignore/Cancel? c
c
Error: The primary GPT table is corrupt, but the backup appears OK, so that will
be used.
OK/Cancel? o
o
Model: ATA WDC WD20EFRX-68A (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 10.7GB 10.7GB root
2 10.7GB 1999GB 1989GB home lvm
3 1999GB 2000GB 1074MB linux-swap(v1) swap
Running parted shows me something is wrong with the disk's partitioning. It tells me that the primary GPT table is corrupt. It also tells me that the backup seems fine, and if I choose ok to use the backup I can list the partitions on the disk (and everything seems correct).
How do I recover the corrupt primary GPT table? I have the impression that tools like gparted and gdisk may be able to do this, but I don't have access to these tools in the recovery stick's basic rescue mode. And I haven't found a way to use parted to fix the problem.
Do I really need to take out the disk of my B3 and put it in a system with more advanced disk/partitioning tools to address this issue?
I have pasted the output from parted below.
# parted /dev/sda
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: Input/output error during read on /dev/sda
Retry/Ignore/Cancel? c
c
Error: The primary GPT table is corrupt, but the backup appears OK, so that will
be used.
OK/Cancel? o
o
Model: ATA WDC WD20EFRX-68A (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 10.7GB 10.7GB root
2 10.7GB 1999GB 1989GB home lvm
3 1999GB 2000GB 1074MB linux-swap(v1) swap