Q: Bootcamp partition missing after Yosemite upgrade
After upgrading OS X to 10.10 my Bootcamp partition is missing. Using the free tools testdisk and also gpt, I'm trying how to rescue my Bootcamp partition.
Testdisk output:
TestDisk 7.0-WIP, Data Recovery Utility, December 2014 Christophe GRENIER <grenier@cgsecurity.org> http://www.cgsecurity.org Disk /dev/disk0 - 2000 GB / 1863 GiB - 3907029168 sectors (RO) Current partition structure: Partition Start End Size in sectors 1 P EFI System 40 409639 409600 [EFI system partition] 2 P Mac HFS 409640 1953534639 1953125000 [Customer] 3 P Mac Boot 1953534640 1954804183 1269544 [Recovery HD] Warning: number of heads/cylinder mismatches 255 (NTFS) != 1 (HD) Warning: number of sectors per track mismatches 63 (NTFS) != 1 (HD) 4 P MS Data 2916796416 3907028991 990232576 [BOOTCAMP]
TestDisk 7.0-WIP, Data Recovery Utility, December 2014 Christophe GRENIER <grenier@cgsecurity.org> http://www.cgsecurity.org Disk /dev/disk0 - 2000 GB / 1863 GiB - 3907029168 sectors (RO) The harddisk (2000 GB / 1863 GiB) seems too small! (< 2507 GB / 2335 GiB) Check the harddisk size: HD jumpers settings, BIOS detection... The following partitions can't be recovered: Partition Start End Size in sectors > MS Data 3907028991 4897261566 990232576 Mac HFS 3907029124 3908298667 1269544 [ Continue ] NTFS, blocksize=4096, 506 GB / 472 GiB
TestDisk 7.0-WIP, Data Recovery Utility, December 2014 Christophe GRENIER <grenier@cgsecurity.org> http://www.cgsecurity.org Disk /dev/disk0 - 2000 GB / 1863 GiB - 3907029168 sectors (RO) Partition Start End Size in sectors >P EFI System 40 409639 409600 [EFI] D Mac HFS 409640 1953534639 1953125000 D MS Data 2582536 1954805760 1952223225 D Mac HFS 1953534640 1954804183 1269544 D MS Data 1954805760 3907028984 1952223225 D MS Data 2916796416 3907028991 990232576 D Mac HFS 3905759584 3907029127 1269544 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
sudo gpt -vv -r show /dev/disk0 output:
➜ ~ sudo gpt -vv -r show /dev/disk0 gpt show: /dev/disk0: mediasize=2000398934016; sectorsize=512; blocks=3907029168 gpt show: /dev/disk0: Suspicious MBR at sector 0 gpt show: /dev/disk0: Pri GPT at sector 1 gpt show: /dev/disk0: Sec GPT at sector 3907029167 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 1953125000 2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC 1953534640 1269544 3 GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC 1954804184 961992232 2916796416 990232576 4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 3907028992 143 3907029135 32 Sec GPT table 3907029167 1 Sec GPT header
After selecting "List files" for D MS Data 1954805760 3907028984 1952223225 with testdisk I get the Root data of the Bootcamp partition (Programms, Programm Files, User, etc.).
Posted on Jan 14, 2015 8:03 AM
This a table that I use to verify that the sectors are valid.
| GPT 3 Start | GPT 3 Size | GPT 3 End | NTFS Start | Sector Offset | NTFS Size | NTFS End |
| 1953534640 | 1269536 | 1954804176 | 1954805760 | 1584 | 1952223225 | 3907028985 |
You need to use the following steps. If you see any error messages during the following steps, please stop and post back here with the error message. The following steps have values from your Testdisk output (and you can verify) in Steps 7 and 8. Please use the default values for partition MBR hex codes when rebuilding the Hybrid MBR, as offered by Gdisk, otherwise it will cause further problems.
Rebuild GPT4 using start/end offsets
- Sudo gdisk /dev/rdisk0
- P (print the full list of parts)
- D (delete)
- 4 (part 4)
- N (new part)
- 4 (part 4)
- 1954805760 - Start offset in bytes (start point for Bootcamp part)
- +1952223225 (Size offset as opposed to End offset)
- 0700 (Windows part type)
- P (print list of all parts just to see what changes will be made)
- W (Write the new GPT)
- Y (Yes! really write the new GPT)
This will delete and re-write the GPT partition info for /dev/disk0s4.
Rebuild MBR to match the new GPT information thus resetting the Hybrid MBR.
Use defaults for other questions (like partition codes).
- Sudo gdisk /dev/disk0
- P (Print list of parts)
- R (Recover)
- H (chooses Hybrid)
- Partitions numbers to be hybridized: 2 3 4
- Y (Good for GRUB question)
- N (part 2 boot flag)
- N (part 3 boot flag)
- Y (part 4 boot flag make NTFS bootable partition)
- P (Print list of updated parts)
- W (Write the new MBR)
- Y (Yes! write the new MBR)
- Reboot
Test 1 - Does Bootcamp Volume show up in Finder?
Test 2 - Can you see files in Bootcamp Volume?
Test 3 - Can you select Bootcamp in System Preferences -> Startup Disk?
Test 4 - If Test 3 is successful, select Bootcamp and Click Restart
If you see a hanging underline cursor at the top left on a black screen, and it does not proceed further, you may need Windows Startup Repair or a tool called EasyBCD.
Posted on Jan 14, 2015 9:38 AM