I was trying to repair permissions today on my Mac so I ran the Disk Utility's First Aid on my drive and it said that there was an Invalid Index Key and that my disk was corrupt and I needed to run the first aid in Recovery mode.

So I opened in recovery mode and ran the first aid and it tried to fix the B-Tree of the catalog file, however there wasn't enough disk space to do this.

Then it tried to restore the disk to it's original state on mount but it couldn't do this either, I'm guessing because of lack of disk space.

(I had about 13GB of free space at this time)

Sorry I didn't get any screenshots or anything but that is basically what happened.

Now the disk is greyed out in disk utility and I can't reinstall mac os x because I would need to erase all of the data on the drive and I don't want to lose the files I have on it.

So what I thought I could try is delete my BOOTCAMP partition, which is about 100GB, and then merge the free space into the problem partition so that I can run fsck -fy in single user mode to try to repair the volume which now will have enough space to complete the operation.

However the option to delete the BOOTCAMP partition is disabled in Disk Utility. So I did some research and found another post on AskDifferent that explained how to delete a partition from terminal (in recovery mode) by first unmounting the physical disk using diskutil unmountDisk /dev/disk0 and then deleting the partition using gpt remove.

Now I tried to unmount the disk using that command and even with the force wildcard but it said:

Forced unmount of disk0 failed: at least one volume could not be unmounted
Unmount was dissented by PID 0

The volume with PID 0 from the list provided by diskutil list is called GUID_partition_scheme.

This is as far as I got through searching for solutions online. I need help deleting the BOOTCAMP partition and merging with the greyed out Mac HD partition so that I can run fsck to hopefully restore my mac os to working order. At the moment I can't boot into the OS and can only boot into recovery mode or single user mode. Hopefully I will atleast be able to retrieve files from the HD if all else fails.

  • First, you would need to delete the Boot Camp partition. Next you would have to add this free space back to the macOS partition. But, if the macOS volume is damaged, then probably will not be able to modify the file system to add the free space. You probably will get the same original error message that led you to ask your question in the first place. – David Anderson Mar 16 '19 at 12:49
  • I saw somewhere that someone was able to delete files from their drive using Terminal in recovery mode and then that cleared up enough space to run the fsck utility. However on trying to attempt this myself I found that I couldn't remove anything because the drive is in read-only mode :( Not sure what to do now – IAMSAMMM Mar 17 '19 at 10:21
  • Which version of macOS are you using? Which type of recover mode are you using? Are you booting to recovery mode from the internet, the internal drive, an external drive or a flash drive? What is the model/year of your Mac? – David Anderson Mar 17 '19 at 15:48
  • I'm using High Sierra and it's an iMac, maybe from 2011 I can't remember for sure. I was booting into recovery mode, not internet recovery mode, without any external device. I'm thinking that maybe one solution might be to get an external hardrive and then copy the entire volume across on to that and then wipe all data from the internal harddrive and reinstall the operating system using recovery mode. Looking into getting a new external HD to do this as the other one I have is not up to scratch for the task – IAMSAMMM Mar 18 '19 at 6:42
  • I am unable to suggest any way to remove the BOOTCAMP partition. This is because your question contains very little useful information. You have not included the output from any commands. Usually, I expect to at least see the output from diskutil list disk0 If 100 GB is enough to save your files, then you could reformat the BOOTCAMP partition as Mac OS Extended (Journaled) and copy the files there before reformatting the macOS partition, – David Anderson Mar 18 '19 at 9:04

You must log in to answer this question.

Browse other questions tagged .