Resized bootcamp. MBR updated. GPT is not. Understanding and fixing.
So I resized my bootcamp partition. I did this through downsizing in diskutil and then using a partition manager in windows to expand to the left. This seemed to work great. I was able to still boot into Windows, but Mac OSX did not see my Bootcamp partition, nor did it recognize the the enlargement of the bootcamp partition.
I reason that this is due to the fact that the MBR has been updated, but the GPT has not. I need to sync my MBR to my GPT.
One speed bump in this was that I synced my GPT to my MBR with rEFIT, which broke my booting into bootcamp. I was able to fix this and get back to booting both windows/mac with incorrect gpt. I did this with fdisk and testdisk, editing my partition 4 to have the same size as the partition in testdisk which was able to list my NTFS files successfully. This worked beautifully.
Now I'm back to need to fix my GPT. However I also want to save my Recovery partition. I'm confused on where my recovery partition was moved to during the resize in Diskutility intiatilly. Does diskutility just move the recovery partition along with the HFS partition but just not show you.
What is also super strange is that I can still mount the recovery partition and examine it and it looks to be intact.
diskutil mount disk0s3
I've dd'ed the partition off (650MB) to a safe place just to be sure.
sudo dd if=/dev/disk0s3 of=/Users/bobharris/Desktop/RecoveryBack.bin
obharriss-mbp:~ bobharris$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *750.2 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 500.0 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
4: Microsoft Basic Data 148.0 GB disk0s4
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk1
1: Microsoft Basic Data 1TB 1.0 TB disk1s1
What I did to fix my MBR when I overwrote with GPT so as to fix bootcamp to booting again.
TestDisk 6.14, Data Recovery Utility, July 2013
Christophe GRENIER <grenier@cgsecurity.org>
Disk /dev/disk0 - 750 GB / 698 GiB - 1465149168 sectors (RO)
Partition Start End Size in sectors
P EFI System 40 409639 409600 [EFI]
Mac HFS 409640 976972135 976562496
MS Data 491339784 978243584 486903801
Mac HFS 976972136 978241679 1269544
>P MS Data 978243584 1465147384 486903801 [BOOTCAMP]
MS Data 1176088576 1465147391 289058816 [BOOTCAMP]
Mac HFS 1463879584 1465149127 1269544
fdisk: 1> edit 4
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
*4: 07 1023 254 63 - 1023 254 63 [1176088576 - 289058816] HPFS/QNX/AUX
Partition id ('0' to disable) [0 - FF]: [7] (? for help) 07
Do you wish to edit in CHS mode? [n] n
Partition offset [0 - 1465149168]: [978241680] 978243584
Partition size [1 - 486905584]: [486905584] 486903801
fdisk:*1> write
Device could not be accessed exclusively.
A reboot will be needed for changes to take effect. OK? [n] y
Writing MBR at offset 0.
Some outputs that seem relevant from google searching...This is my computer as is now.
bobharriss-MacBook-Pro:~ bobharris$ sudo gpt -r -vv show disk0
gpt show: disk0: mediasize=750156374016; sectorsize=512; blocks=1465149168
gpt show: disk0: Suspicious MBR at sector 0
gpt show: disk0: Pri GPT at sector 1
gpt show: disk0: Sec GPT at sector 1465149167
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 976562496 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
976972136 1269544 3 GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
978241680 197846896
1176088576 289058816 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
1465147392 1743
1465149135 32 Sec GPT table
1465149167 1 Sec GPT header
I might edit this with more command outputs.
So resizing partitions in fdisk and gdisk, seem different. One is MBR. The other GPT. In fdisk you can edit a partition. However in gdisk, it seems I must delete and rebuild my 3 partitions. Not so bad given a constant offset that I now know. However I can't account for the recovery partition that is still mounting. I would have thought it would be lost, essentially shifted by the new free space.
So. How can I resize my GPT too account for new sizes. How can I save my recovery partition. Why can I still somehow mount my recovery partition with diskutil? Many thank for taking the time to look at this post and putting up with some typos.
MacBook Pro, OS X Mavericks (10.9)