manually repair GUID table
System: Macbook Pro 13 (Late 2013) with Yosemite 10.10.3
Question: How can I manually repair the GUID partition table without destroying windows or OSX
I resized my bootcamp partition by first creating empty space with disk utility. Then booting into windows and using Mini Tool Partiton manager to expand the partition into the free space. This worked in giving my a bootable windows partition and I can also boot into OSX so I dont want to break it now!
However OSX can no longer mount the bootcamp partition and thinks its corrupted.
I have already dug into this somewhat and it seems that the issue is that Mini Tool has edited the MBR but this change has not been detected by OSX and put in the GUID partition table (these are separate entities? correct me if I'm wrong).
So using "sudo gpt show disk0" i get this
gpt show: disk0: Suspicious MBR at sector 0
start size index contents
0 1 MBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
409640 859375000 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
859784640 1269536 3 GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
861054176 800
861054976 49645568 4
910700544 66404352 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
977104896 131
977105027 32 Sec GPT table
977105059 1 Sec GPT header
Disk util list shows
diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.3 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 440.0 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
4: Microsoft Basic Data 34.0 GB disk0s4
and Testdisk (which you can get here http://www.cgsecurity.org/Download_and_donate.php/testdisk-7.0.mac_intel.tar.bz2) shows this
TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
Disk /dev/disk0 - 500 GB / 465 GiB - 977105060 sectors (RO)
Partition Start End Size in sectors
>P EFI System 40 409639 409600 [EFI]
D Mac HFS 409640 859784639 859375000
D MS Data 745005064 861054976 116049913
D Mac HFS 859784640 861054175 1269536
D MS Data 861054976 977104888 116049913
D MS Data 910700544 977104895 66404352
D Mac HFS 975835488 977105023 1269536
Structure: Ok. Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
P=Primary D=Deleted
Keys A: add partition, L: load backup, T: change type, P: list files,
Enter: to continue
FAT32, blocksize=512, 209 MB / 200 MiB
So from this i'm pretty sure the issue is that there are two entries for the same bootcamp partition and both are from before I did the resize. It seems the windows partition resized now goes from 861054976 to 977104888 but the GUID partition table says 910700544 to 977104888.
How do I fix this without destroying my setup?
MacBook Pro (Retina, 13-inch, Late 2013), OS X Yosemite (10.10.3)