Can I recover my bootcamp and hard drive partitions?

Macbook Pro “15 Late 2013 2.3Ghz. It was stupid of me to take this so lightly. I had a small partition that I had made in my boot camp windows 8.1 that I wasn’t using. So I used mini partition tool to merge that and the bootcamp drive, it asked me to restart and I did. Well it completed the process and rebooted, but it doesn’t load up. The initial music plays and then it plays a a very tiny clip of that music and stays stuck on a black screen with no errors; sort of like when a game freezes and the music clips and loops.


So then I forced a reboot with the powerbutton. Still the same. Then I held down option after booting. To my surprised it only showed Recovery and Bootcamp options. If I select bootcamp, the above explained situation happens.


I selected recovery and went into disk utility. It only showed disk02, recovery HD, bootcamp and under disk 1 OSX Base System. I’ll attach an image. The 02 and Bootcamp are greyed out. I cannot mount them. I cannot erase them.



At one point when I clicked verify on 02, it gave an error “Unable to repair while live”. I felt positive then went to try and do a reinstall of OS X, but can’t select that drive because it’s in MS-DOS(FAT32) format. So I went back and now the drive is greyed out again. Verifying and repairing gives errors, and can’t be mounted.


I tried fsck fy in singleuser mode but it gave a command not found error.


When I click the 02 and bootcamp drives, they only show capacity now, and “-“ all other info.


What can I do to resolve this? Is there anyway the files are still there? I was hoping maybe I could reinstall OSX then repair the Bootcamp drive some how. What are my options?







Edit: I did an NVRAM reset and now the disk0s2 shows its format as Mac OS Extended(pic attached)




Edit: I tried to run a repair and it gave this error(pic below)


MacBook Pro Retina

Posted on Nov 8, 2021 9:15 AM

Reply
Question marked as Top-ranking reply

Posted on Nov 8, 2021 6:25 PM

While it may technically be possible to restore the old partition layout it will not be easy to do and I know of only one contributor on these forums that has that knowledge. Depending on how the third party utility modified the drive it is impossible to say whether the data is still able to be saved and how much even if the partition layout can be restored. If you need to rescue the data because you don't have a backup, then it is safer to boot from an external macOS drive in order to try using data recovery software.


It will be much easier and faster to just start over from scratch with a clean install of macOS. A clean install requires you to erase the whole physical drive before reinstalling macOS. You can then migrate your apps & files from a backup made before things went wrong. You will need to use BootCamp Assistant to reinstall Windows if you still want to dual boot with Windows.


About macOS Recovery on Intel-based Mac computers - Apple Support


How to reinstall macOS - Apple Support


How to create a bootable installer for macOS - Apple Support

Similar questions

16 replies
Question marked as Top-ranking reply

Nov 8, 2021 6:25 PM in response to Layman92

While it may technically be possible to restore the old partition layout it will not be easy to do and I know of only one contributor on these forums that has that knowledge. Depending on how the third party utility modified the drive it is impossible to say whether the data is still able to be saved and how much even if the partition layout can be restored. If you need to rescue the data because you don't have a backup, then it is safer to boot from an external macOS drive in order to try using data recovery software.


It will be much easier and faster to just start over from scratch with a clean install of macOS. A clean install requires you to erase the whole physical drive before reinstalling macOS. You can then migrate your apps & files from a backup made before things went wrong. You will need to use BootCamp Assistant to reinstall Windows if you still want to dual boot with Windows.


About macOS Recovery on Intel-based Mac computers - Apple Support


How to reinstall macOS - Apple Support


How to create a bootable installer for macOS - Apple Support

Nov 9, 2021 5:03 PM in response to HWTech

So I tried to erase the physical drive and through my OS X Sierra bootable USB diskutility, and it failed to unmount after waiting a long time. Now I am trying to run a partition that removes everything other than the disk0s2.


If that doesn’t work, should I try this? It’s a response of yours on another post. If not what can I do?


“If this happens when selecting and erasing the physical drive "Apple SSD SM0128G", then you may have a problem with the laptop's SSD. About the only thing left is to try a hardware based Secure Erase if the SSD supports it, but not all Apple SSD's support this feature.


Probably the easiest way to do this is by creating a bootable Parted Magic USB drive using Etcher (Mac/Windows/Linux). Option Boot the Parted Magic USB drive and select the orange icon labeled "EFI". There should be an icon on the Parted Magic desktop for erasing drives. Within the app there are several options to erase the drive. You need to select the "ATA Secure Erase" option and not the "long" option. Only the "ATA Secure Erase" will reset the SSD to factory defaults and maybe fix any odd issues with it. The "long" option will not reset the SSD and will just cause undue wear to the SSD and might make things worse. The ATA Secure Erase option should only take a few minutes to complete. Make sure to remember the exact password you use just in case the erase operation is not completed as you will need this password to disable the security lock on the SSD before the SSD can be used again. If an error is encountered, take a picture of the error message.


If the secure erase operation fails or is interrupted, then open a terminal app from one of the icons on the desktop or one of the menus and issue the following command (press the Return key at the end of the line):

sudo  hdparm  --usermaster u  --security-prompt-for-password  --security-disable  /dev/sda


When prompted, type the exact password you used when performing the ATA Secure Erase (press the Return key after entering the password).


The last free version of Parted Magic can be downloaded from a mirror link from the MajorGeek's website here. “

Nov 9, 2021 3:18 PM in response to Layman92

I'm concerned that the "disk0s2" partition was not showing up as HFS+ at one point, but is now showing correctly. Personally I would perform a clean install by first erasing the whole physical SSD (in the case of macOS 10.10 and earlier -- partition & format the whole SSD). Since you modified the partitions you will need to reinstall Windows using BootCamp Assistant again (any other option to fix will most likely be complicated to figure out).


Was the "disk0s2" volume encrypted with Filevault?


It is possible that the BootCamp volume is mounted when you are attempting to erase the "disk0s2" volume. You can try to unmount all volumes on "disk0":

diskutil  unmountDisk  disk0


or


diskutil  unmountDisk  force  disk0


Then try erasing the "disk02" volume:

diskutil  eraseVolume  HFS+  "Macintosh HD"  disk0s2


I don't recall if this command requires the "disk0s2" volume to be mounted like with the Disk Utility GUI.


If this doesn't work, then you should just erase the whole physical drive (or partition & format depending on the OS you are installing). If you are installing macOS 10.10 or earlier, then you will need to partition & format the volume using these instructions:

https://www.owcdigital.com/assets/support/support-formatting-and-migration/Mac_Formatting_6-10.pdf


If you are installing macOS 10.11+, then just erase the whole physical SSD as GUID partition and MacOS Extended (Journaled). If you are installing macOS 10.13+, then you will first need to click "View" within Disk Utility and select "Show All Devices" so that the physical drive appears on the left pane of Disk Utility.


No matter which option you choose make sure to retrieve all the data from the Windows' volume first since it is easy to make a mistake with the command line plus if there is an issue with the partition table, then even a simple erase may end up losing access to the Windows' volume.


Nov 8, 2021 10:35 PM in response to HWTech

Hey, thanks for the response. I don’t have any back ups or an external hard drive with mcOS X. I can get a bootable drive.


would it be possible to install mcOS X to the other partition and at least try to recover the bootcamp data? It’ll be a life saver, if there is a way. I don’t mind it being difficult, just need a bit of guidance.

Nov 9, 2021 5:19 AM in response to Layman92

Alright so none of my attempts at erasing or unmounting disk0s2 worked. I have been attempting to reinstall macOS X on it and it was getting stuck at a certain point.


I created a bootdrive with high sierra as I got recommended to do so on another forum since OS X Mavericks is really old even though that was what was last installed on it. I tried booting through it and force unmounting and erasing disk0s2 (diskutil eraseVolume and diskutil unmountDiskforce JHFS+) before install but in both cases it failed at the unmounting part. When I run verify/repair it goes through without issues the last time I ran. I am just unable to unmount. I tried the lsof |grep disk0 command to see if there are any process running, but it doesn’t give me a response, nothing happens; no errors or a response, but it does run the command because if I try to quit terminal it tells me so. Maybe I am doing something wrong.


So after that didn’t work, I said screw it and just tried to install sierra using the bootdrive and launched it. It starts installing and gets stuck at 2 minutes remaining, around 85% of the way through. I had to force restart due to that a few times; even if I let it continue it seems to get stuck at 18minutes remaining, around 5% of the way through. Some files are getting written because I see the capacity of the drive being reduced when I relaunch into Utility menu. However it doesn’t necessarily increase each time that I have noticed, only when attempting both this and the below method did the Used amount increase from what I noticed.


When I go through internet recovery, it downloads mavericks 10.9 for me and attempts to install. It downloads and goes through the installation. Then it finishes, goes into a grey screen(pic below)with a loading circle for quite some time, and restarts but ends up hanging when it does where it’s stuck on a semi white screen with a loading circle showing it’s loading. I am sleep deprived so fell asleep while waiting the last time and even after 4 hours or so it was still stuck there. The fileis getting downloaded as there is a change in drive capacity. As of now it’s used around 11 GB where as it was pretty much empty before any of these operations.


(Grey screen before restart)


So since even that didn’t work, I thought maybe I could reformat the drive I was using for booting then try installing macOS X on that to see if I can get into it and recover my files(at least some of the important ones). So I got into internet recovery and did that. Just like above it goes into the grey screen with loading icon, then restarts and hangs on a white screen with a loading circle.


At the moment I restarted and ran the OS C installer for Mavericks by booting into the Options menu. The install completed in about 20 minutes and now it’s stuck on the grey screen before restarting. I am going to let it be longer and see if it restarts; if not I’ll have to force it again.


If that happens, I’ll post a diskutil list because there are multiple disks for some reason and some and really tiny. My biggest issue here is trying to recover bootcamp files. Could the unmounting failure be because my Recovery HD is in the same disk as the disk0s2? Or is this some kind of a permission issue?


Please help me.

Nov 9, 2021 7:27 PM in response to HWTech

Makes sense, difficult to say in this situation I suppose.



Yeah I tried it. It boots up then hangs at “Searching for PMAGIC_xxxx_xx_xx.SQFS” and was about to search for an alternative to it. According to what you say it’s weird that the last OS I had was Mavericks and I can run the apple diagnostics but am not able to run this. Makes me wonder if I did something wrong or should I have been more patient with the hang up. I flashed a FAT32 USB according to what I found on the parted magic site itseld; is that correct or should I have used a different format? Also it didn’t show as EFI on the option boot but as Windows In orange.


I’ll search for the knoppix instructions, and see just hope I can find something that applies to this scenario.



I tried the dd command and it gave a /dev/disk0: Resource busy error. Do you think the High Sierra Installer that I ran in the beginning, that boots into getting stuck is what’s keeping it busy? If it is, is there a way to stop it?



Nov 9, 2021 8:04 PM in response to davidanderson61

-bash-3.2# sw_vers

ProductName: Mac OS X

ProductVersion: 10.9.5

BuildVersion: 13F34

-bash-3.2# 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 disk0s2        273.9 GB disk0s2

  3:         Apple_HFS Recovery HD      650.0 MB disk0s3

  4:   Microsoft Basic Data BOOTCAMP        225.4 GB disk0s4

/dev/disk1

  #:           TYPE NAME          SIZE   IDENTIFIER

  0:   GUID_partition_scheme            *250.1 GB disk1

  1:            EFI EFI          209.7 MB disk1s1

  2:         Apple_HFS Mavericks OS X     249.2 GB disk1s2

  3:        Apple_Boot Recovery HD      650.0 MB disk1s3

/dev/disk2

  #:           TYPE NAME          SIZE   IDENTIFIER

  0:  Apple_partition_scheme            *1.3 GB  disk2

  1:    Apple_partition_map            30.7 KB  disk2s1

  2:         Apple_HFS OS X Base System    1.3 GB  disk2s2

/dev/disk3

  #:           TYPE NAME          SIZE   IDENTIFIER

  0:              untitled       *524.3 KB disk3

/dev/disk4

  #:           TYPE NAME          SIZE   IDENTIFIER

  0:              untitled       *524.3 KB disk4

/dev/disk5

  #:           TYPE NAME          SIZE   IDENTIFIER

  0:              untitled       *524.3 KB disk5

/dev/disk6

  #:           TYPE NAME          SIZE   IDENTIFIER

  0:              untitled       *524.3 KB disk6

/dev/disk7

  #:           TYPE NAME          SIZE   IDENTIFIER

  0:              untitled       *524.3 KB disk7

/dev/disk8

  #:           TYPE NAME          SIZE   IDENTIFIER

  0:              untitled       *6.3 MB  disk8

/dev/disk9

  #:           TYPE NAME          SIZE   IDENTIFIER

  0:              untitled       *2.1 MB  disk9

/dev/disk10

  #:           TYPE NAME          SIZE   IDENTIFIER

  0:              untitled       *1.0 MB  disk10

/dev/disk11

  #:           TYPE NAME          SIZE   IDENTIFIER

  0:              untitled       *524.3 KB disk11

/dev/disk12

  #:           TYPE NAME          SIZE   IDENTIFIER

  0:              untitled       *524.3 KB disk12

/dev/disk13

  #:           TYPE NAME          SIZE   IDENTIFIER

  0:              untitled       *1.0 MB  disk13

-bash-3.2# mount | grep disk0s

/dev/disk0s2 on /Volumes/disk0s2 (hfs, local, journaled)

/dev/disk0s3 on /Volumes/Recovery HD (hfs, local, journaled)

-bash-3.2# gpt -r show disk0

   start   size index contents

     0     1    PMBR

     1     1    Pri GPT header

     2    32    Pri GPT table

     34     6     

     40  409600   1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B

   409640 534894104   2 GPT part - 48465300-0000-11AA-AA11-00306543ECAC

 535303744  262144     

 535565888  1269536   3 GPT part - 48465300-0000-11AA-AA11-00306543ECAC

 536835424    672     

 536836096 440266752   4 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

 977102848   2179     

 977105027    32    Sec GPT table

 977105059     1    Sec GPT header

-bash-3.2# fdisk /dev/disk0

Disk: /dev/disk0 geometry: 60821/255/63 [977105060 sectors]

Signature: 0xAA55

     Starting   Ending

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

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

 1: EE 1023 254 63 - 1023 254 63 [    1 - 977105059] <Unknown ID>

 2: 00  0 0 0 -  0 0 0 [    0 -     0] unused   

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

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

-bash-3.2# 


I hope that doesn’t appear as bad as it does on my phone on the browser. If it is let me know, I’ll upload photos. I don’t want to type my apple details on the other laptop because it’s not secure. Is there a way to paste the text in a neater way through the phone like a code block?

Nov 10, 2021 2:04 AM in response to HWTech

I finally got the disk to mount by using the terminal from the MacOS X and doing a zerodisk erase on the bootcamp, then also on the disk0s2 which failed but not due to dismount failure. I also ran verify and repair command on the physical drive through terminal. Then I rebooted, went into command + R recovery, And found out disk02 had dismounted. Then I dismounted Recovery HD, and initiated disk erase from Disk Utility. Booted up from the bootable USB to High Sierra I had made and ran the installation. Everything installed perfectly. Now all is well :)

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.

Can I recover my bootcamp and hard drive partitions?

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