I'm trying to recover a disk which appears to have a corrupt ID for the protective MBR.
Yesterday I took a backup of the GPT and protective MBR, and dumped to file.
At that time fdisk reported the MBR type ID as 83, where it should be EE for a protective MBR.
Thanks to a great set of pages at http://www.rodsbooks.com/gdisk/gdisk.html I decided the best course of action was:
- invoke gdisk and select the GPT option (it was showing MBR as present, but not in protective mode). I understand selecting GPT creates a fresh protective MBR.
- write the table to disk, restoring the protective MBR.
So, I attempted it today, but something changed overnight, and now gdisk shows:
GPT fdisk (gdisk) version 0.8.8
Type device filename, or press <Enter> to exit: /dev/sdc
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
Creating new GPT entries.
(Overnight, I did have photorec running, and today decided to kill it - I didn't think it was intrusive, but wonder if that had anything to do with the change in status reported by gdisk. If not, then possibly the disk really is rotting badly.)
Anyway, I loaded my backed-up GPT and partitions look fine:
Recovery/transformation command (? for help): l
Enter backup filename to load: sdb_gpt.txt
Recovery/transformation command (? for help): p
Disk /dev/sdc: 5860533168 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 503CCEC8-87B4-4A12-B19B-1B1D224C216E
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 5860533134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2925 sectors (1.4 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 3905535 1.9 GiB EF02
2 3905536 11718655 3.7 GiB 8200
3 11718656 5761718271 2.7 TiB 0700
4 5761718272 5860532223 47.1 GiB 8300
Recovery/transformation command (? for help): o
Disk size is 5860533168 sectors (2.7 TiB)
MBR disk identifier: 0x00000000
MBR partitions:
Number Boot Start Sector End Sector Status Code
1 1 4294967295 primary 0xEE
BUT.... I cannot write it out:
Recovery/transformation command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sdc.
Unable to save backup partition table! Perhaps the 'e' option on the experts'
menu will resolve this problem.
Warning! An error was reported when writing the partition table! This error
MIGHT be harmless, or the disk might be damaged! Checking it is advisable.
I feel like I'm close to fixing. Why would gdisk fail to write out? Is there anything I can do to fix the disk at a lower level?
Could/should I erase the MBR and partition table at the start of the disk, and then retry the write?