OK, I'm going to explore this a bit further, for prosperity sake.
a quick recap of where we stand
orig-drive (320GB Hitachi): I formatted with ubuntu's disk utility (on 11.10) using a guid partition table, and created one big ext4 partition, moved a bunch of mixed type data (295GB) to it. shutdown, removed drive, walked to 2nd computer, installed, booted, discovered drive was listed as free space. doh! gdisk returned a bunch of errors, but it seemed to me (I'm no expert) that the big problem, and why the computer wouldn't mount the partition was that it ended on a higher sector than possible for the number of sectors on the drive. In addition the backup gpt header was also situated after the last possible sector. Trying to rewrite the backup header (using gdisk) didn't work as the disk was not big enough.
backup-drive (320 GB): is a second drive I formatted with ubuntu's disk utility (on 11.10) using a guid partition table, and created one big ext4 partition. Used this to compare partition table structure with original drive.
Used dd_rescue to copy orig-drive to backup-drive, which despite having the same size on the label, reported a few more sectors. Following this I was able to mount resulting drive and get data off.
Now I'm going to see what happens when I try a couple of other options with the drives.
Firstly, using gdisk on the backup-drive, complains that the disk guid in the main header doesn't match the disk guid in the backup header. Comparing the information in both shows the only difference is the disk guid, so I've opted to copy the backup header over the top of the main header. My thinking is as follows: I don't want two disks with the same guid, the rest of the information is the same, so no harm done (I also made a backup of the partition table to a file before hand using gdisk). This has worked. gdisk is no longer complaining. drive mounts, data accessible.
Just noticed you can change the disk guid in the extra (x) expert menu of gdisk, could be useful for dealing with this.
Code:
root@zeus:/home/dan# gdisk /dev/sdd
GPT fdisk (gdisk) version 0.8.4
Warning! Main and backup partition tables differ! Use the 'c' and 'e' options
on the recovery & transformation menu to examine the two tables.
Warning! One or more CRCs don't match. You should repair the disk!
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: damaged
****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************
Command (? for help): v
Caution: The CRC for the backup partition table is invalid. This table may
be corrupt. This program will automatically create a new backup partition
table when you save your partitions.
Problem: main header's disk GUID (4FF348B9-D041-49A6-AD98-18C15F055F2D) doesn't
match the backup GPT header's disk GUID (58F7115C-D8E0-4D86-B93A-1421EE9F14B8)
You should use the 'b' or 'd' option on the recovery & transformation menu to
select one or the other header.
Caution: Partition 1 doesn't begin on a 8-sector boundary. This may
result in degraded performance on some modern (2009 and later) hard disks.
Consult http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/
for information on disk alignment.
Identified 2 problems!
Command (? for help): r
Recovery/transformation command (? for help): p
Disk /dev/sdd: 625142448 sectors, 298.1 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 4FF348B9-D041-49A6-AD98-18C15F055F2D
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 625142414
Partitions will be aligned on 8-sector boundaries
Total free space is 0 sectors (0 bytes)
Number Start (sector) End (sector) Size Code Name
1 34 625142414 298.1 GiB 0700
Recovery/transformation command (? for help): i
Using 1
Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)
Partition unique GUID: 9E79F802-02B9-4097-8CD2-F9FFE96136BD
First sector: 34 (at 17.0 KiB)
Last sector: 625142414 (at 298.1 GiB)
Partition size: 625142381 sectors (298.1 GiB)
Attribute flags: 0000000000000000
Partition name: ''
Recovery/transformation command (? for help): m
Command (? for help): b
Enter backup filename to save: gptpart-rd.gpt
The operation has completed successfully.
Command (? for help): r
Recovery/transformation command (? for help): i
Using 1
Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)
Partition unique GUID: 9E79F802-02B9-4097-8CD2-F9FFE96136BD
First sector: 34 (at 17.0 KiB)
Last sector: 625142414 (at 298.1 GiB)
Partition size: 625142381 sectors (298.1 GiB)
Attribute flags: 0000000000000000
Partition name: ''
Recovery/transformation command (? for help): p
Disk /dev/sdd: 625142448 sectors, 298.1 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 4FF348B9-D041-49A6-AD98-18C15F055F2D
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 625142414
Partitions will be aligned on 8-sector boundaries
Total free space is 0 sectors (0 bytes)
Number Start (sector) End (sector) Size Code Name
1 34 625142414 298.1 GiB 0700
Recovery/transformation command (? for help): b
Recovery/transformation command (? for help): i
Using 1
Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)
Partition unique GUID: 9E79F802-02B9-4097-8CD2-F9FFE96136BD
First sector: 34 (at 17.0 KiB)
Last sector: 625142414 (at 298.1 GiB)
Partition size: 625142381 sectors (298.1 GiB)
Attribute flags: 0000000000000000
Partition name: ''
Recovery/transformation command (? for help): p
Disk /dev/sdd: 625142448 sectors, 298.1 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 58F7115C-D8E0-4D86-B93A-1421EE9F14B8
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 625142414
Partitions will be aligned on 8-sector boundaries
Total free space is 0 sectors (0 bytes)
Number Start (sector) End (sector) Size Code Name
1 34 625142414 298.1 GiB 0700
Recovery/transformation command (? for help): b
Recovery/transformation command (? for help): v
Caution: The CRC for the backup partition table is invalid. This table may
be corrupt. This program will automatically create a new backup partition
table when you save your partitions.
Caution: Partition 1 doesn't begin on a 8-sector boundary. This may
result in degraded performance on some modern (2009 and later) hard disks.
Consult http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/
for information on disk alignment.
Identified 1 problems!
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/sdd.
The operation has completed successfully.
root@zeus:/home/dan# gdisk /dev/sdd
GPT fdisk (gdisk) version 0.8.4
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): p
Disk /dev/sdd: 625142448 sectors, 298.1 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 58F7115C-D8E0-4D86-B93A-1421EE9F14B8
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 625142414
Partitions will be aligned on 8-sector boundaries
Total free space is 0 sectors (0 bytes)
Number Start (sector) End (sector) Size Code Name
1 34 625142414 298.1 GiB 0700
Command (? for help): i
Using 1
Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)
Partition unique GUID: 9E79F802-02B9-4097-8CD2-F9FFE96136BD
First sector: 34 (at 17.0 KiB)
Last sector: 625142414 (at 298.1 GiB)
Partition size: 625142381 sectors (298.1 GiB)
Attribute flags: 0000000000000000
Partition name: ''
Command (? for help): q
root@zeus:/home/dan#
The second thing I wanted to try was to fix the original disk, in place, possibly by resizing the partition so it fit the size the disk is now reporting. I had said there is a resize facility in the gdisk menu but actually its to resize the partition table, not the partition. And since parted crashes on inspecting this disk, I guess we are done here. I would have liked a solution to recovering the original disk without needing the second same sized disk but, hey, I got my data off.
Feel free to chime in, and correct any noob mistakes I've made.
Bookmarks