I had a rather nasty, heart-rending moment with an external USB drive this morning.
gpt recover: /dev/disk2: recovered primary GPT table from secondary
gpt recover: /dev/disk2: recovered primary GPT header from secondary
Started partition map verification on disk2
Checking prerequisites
Checking the partition list
Checking for an EFI system partition
Checking the EFI system partition's size
Checking the EFI system partition's file system
Checking all HFS data partition loader spaces
Checking booter partitions
Checking Core Storage Physical Volume partitions
The partition map appears to be OK
Finished partition map verification on disk2
When I plugged it into my Mac, I saw this: -
The disk you inserted was not readable by this computer.
I decided to leave things as-is until I got home this evening, and then looked into it more fully.
Alas Disk Utility failed to provide me with the Get Out Of Jail card, via First Aid Verify Disk and Repair Disk, instead showing me disk2s1 rather than the more friendly name of DaveHay.
Rather than panicking, I did a bit of Googling, as one does, and also made some use of the diskutil command: -
diskutil list
/dev/disk2
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *500.1 GB disk2
1: 0xEE 500.1 GB disk2s1
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *500.1 GB disk2
1: 0xEE 500.1 GB disk2s1
I've highlighed the partition with which I had problems, which, by the way, contains all my data :-(
I then tried to verify the offending partition: -
diskutil verifyDisk disk2
Unable to verify this whole disk: A GUID Partition Table (GPT) partitioning scheme is required (-69773)
Again, a trip to Mr Google later, and I found this: -
which led me to gpt ( GUID partition table maintenance utility ), as per the following: -
sudo gpt recover /dev/disk2
gpt recover: /dev/disk2: recovered primary GPT table from secondary
gpt recover: /dev/disk2: recovered primary GPT header from secondary
That looked to be a good sign and, when I checked Disk Utility and Finder, I can HURRAH HURRAH HURRAH see my disk, as now evidenced by diskutil : -
diskutil list
/dev/disk2
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.1 GB disk2
1: EFI EFI 209.7 MB disk2s1
2: Apple_HFS DaveHay 499.8 GB disk2s2
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.1 GB disk2
1: EFI EFI 209.7 MB disk2s1
2: Apple_HFS DaveHay 499.8 GB disk2s2
Note that the EFI partition has now turned up on disk2s1, and that the bulk of the disk is now assigned to the second partition, disk2s2.
In addition, the verifyDisk option now works: -
diskutil verifydisk /dev/disk2
Started partition map verification on disk2
Checking prerequisites
Checking the partition list
Checking for an EFI system partition
Checking the EFI system partition's size
Checking the EFI system partition's file system
Checking all HFS data partition loader spaces
Checking booter partitions
Checking Core Storage Physical Volume partitions
The partition map appears to be OK
Finished partition map verification on disk2
Right, off to backup my disk to my other disk, and then perhaps also back up my Mac's internal disk :-)