Lost Bootcamp partition after upgrade to El capitan from an old 10.8.5 OS

Hi,

i saw a lot of topics about this but don't want to make a mistake in the procedure so i'm asking the help of an expert.

Here the result of the usual commands :

Roses-MacBook-Air:testdisk-7.2-WIP rosemagers$ diskutil list


/dev/disk0 (internal, physical):


   #:                       TYPE NAME                    SIZE       IDENTIFIER


   0:      GUID_partition_scheme                        *480.1 GB   disk0


   1:                        EFI EFI                     209.7 MB   disk0s1


   2:                  Apple_HFS Macintosh HD            60.0 GB    disk0s2


   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3


   4:       Microsoft Basic Data BOOTCAMP                60.5 GB    disk0s4


Roses-MacBook-Air:testdisk-7.2-WIP rosemagers$ diskutil cs list


No CoreStorage logical volume groups found


Roses-MacBook-Air:testdisk-7.2-WIP rosemagers$ sudo gpt -v -r show /dev/disk0


gpt show: /dev/disk0: mediasize=480103981056; sectorsize=512; blocks=937703088


gpt show: /dev/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  117187504      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC


  117597144    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC


  118866680       1288         


  118867968  118108160      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7


  236976128  700726927         


  937703055         32         Sec GPT table


  937703087          1         Sec GPT header


Roses-MacBook-Air:testdisk-7.2-WIP rosemagers$ sudo fdisk /dev/disk0


Disk: /dev/disk0 geometry: 58369/255/63 [937703088 sectors]


Signature: 0xAA55


         Starting       Ending


 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]


------------------------------------------------------------------------


 1: EE    0   0   2 - 1023 254  63 [         1 -  118867967] <Unknown ID>


*2: 07 1023 254  63 - 1023 254  63 [ 118867968 -  118108160] HPFS/QNX/AUX


 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      


 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      


I've also installed TestDisk and here are the results :


The macbook is an Air 11-inch Mid 2012.


Could someone plese help me to recover my bootcamp partition ?


Thanks

Mattia


Posted on Feb 25, 2020 9:24 AM

Reply

Similar questions

37 replies

Feb 25, 2020 1:19 PM in response to mattia182

  • In Internet Recovery, we are going to remove and recreate GPT4.
    • Unmount disk - diskutil unmountDisk disk0
    • Remove old GPT4 - gpt remove -i 4 /dev/disk0
    • Add the correct GPT4 - gpt add -i 4 -b 118867968 -s 818829312 -t windows /dev/disk0
    • Reboot normally and check if you can see Windows files
  • Install GPT Fdisk (http://sourceforge.net/projects/gptfdisk/)
  • Post back when you are ready to correct the MBR.

Feb 26, 2020 9:56 AM in response to mattia182

GPT Fdisk has one-character commands. If you get an error from it about not being able to write to disk, you will need to temporarily disable SIP using csrutil in Local Recovery (Do not type text like this).


sudo gdisk /dev/disk0

p (print)

x (expert mode)

n (remove the current MBR)

o (print the default MBR for verification)

p (print)

w (write)

y (confirm write)


If you do not get any errors, reboot into Recovery and we can recreate the GPT4 entry.


Feb 27, 2020 10:03 AM in response to mattia182

Rebuild MBR to match the new GPT information thus resetting the Hybrid MBR. Use defaults for other questions (like partition codes). The only values that need modifications are the Boot flags and step 10. Accept all other defaults that Gdisk offers. Please see thesample Q&A as an example. These steps can be repeated if you make a mistake before you get to Step 12, otherwise start from Step 1 for these steps. Step 6 has numbers which are typed with a space between the numbers. Please see the sample Q&A before you execute these steps.

  1. Sudo gdisk /dev/rdisk0
  2. P (Print list of parts)
  3. R (Recover)
  4. O (print current Hybrid MBR)
  5. H (chooses Hybrid)
  6. Partitions numbers to be hybridized: 2 3 4
  7. Y (Good for GRUB question)
  8. N (part 2 boot flag)
  9. N (part 3 boot flag)
  10. Y (part 4 boot flag make NTFS bootable partition)
  11. O (print current Hybrid MBR)
  12. W (Write the new MBR)
  13. Y (Yes! write the new MBR)
  14. Reboot


Here is sample Q&A for this section. Please notice the Press Enter/Return.


Place EFI GPT (0xEE) partition first in MBR (good for GRUB)? (Y/N): Y

Creating entry for GPT partition #2 (MBR partition #2)
Enter an MBR hex code (default AF): Press Enter/Return
Set the bootable flag? (Y/N): N

Creating entry for GPT partition #3 (MBR partition #3)
Enter an MBR hex code (default AB): Press Enter/Return
Set the bootable flag? (Y/N): N

Creating entry for GPT partition #4 (MBR partition #4)
Enter an MBR hex code (default 07): Press Enter/Return
Set the bootable flag? (Y/N): Y


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.

Mar 3, 2020 8:48 AM in response to mattia182

mattia182 wrote:

so i will restart in internet recovery mode ... could you please tell me how to rebuild GPT4 ?

In Internet Recovery, we are going to recreate GPT4.

  • Unmount disk - diskutil unmountDisk disk0
  • Add the correct GPT4 - gpt add -i 4 -b 118867968 -s 818829312 -t windows /dev/disk0
  • Run - diskutil repairDisk disk0
  • Reboot normally and check if you can see Windows files


Feb 25, 2020 9:51 AM in response to mattia182

Your GPT has


118867968  118108160      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7


Your MBR has


*2: 07 1023 254  63 - 1023 254  63 [ 118867968 -  118108160] HPFS/QNX/AUX


but Testdisk shows the size of NTFS to be 818829312 sectors. Was the NTFS partition extended using any third-party partitioning tools? Also, notice the gap after GPT4, starting at 236976128 sector.


 118867968  118108160      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

  236976128  700726927      


The sizes - 118108160 + 700726927 = 818835087 , and your Testdisk layout (818829312 sectors) leaves 5775 sectors at the end of the GPT4.


Feb 26, 2020 10:10 AM in response to Loner T

I had already disabled SIP before so i just executed your command one after the other without problems.

When i hit "n" i didn't get any message after and continued with the other commands. After "y" i got 2 warnings about :

Device opened with shared lock will not have their partition table automatically reloaded and The kernel may continue to use old or deleted partitions.

After that i got The operation has completed succesfully.


Now should i restart in Internet recovery as before and execute the same commands ? :

In Internet Recovery, we are going to remove and recreate GPT4.

  • Unmount disk - diskutil unmountDisk disk0
  • Remove old GPT4 - gpt remove -i 4 /dev/disk0
  • Add the correct GPT4 - gpt add -i 4 -b 118867968 -s 818829312 -t windows /dev/disk0
  • Reboot normally and check if you can see Windows files


Thanks again for the support !


Mattia


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Lost Bootcamp partition after upgrade to El capitan from an old 10.8.5 OS

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.