Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Failurbydesign

macrumors regular
Original poster
Jan 17, 2011
132
1
CA
I'm trying to remove a partition and get back my drive, but i keep getting this error. Thoughts?
 

Attachments

  • Screen Shot 2015-11-10 at 10.40.30 AM.png
    Screen Shot 2015-11-10 at 10.40.30 AM.png
    270.9 KB · Views: 113
Are you booted to that Patriot USB key?

Open Terminal and run the two commands below then tell me the output of each.

Which one are you trying to get rid of?

Code:
diskutil list

Code:
diskutil cs list
 
  • Like
Reactions: Failurbydesign
Yep, sometimes the Disk Utility GUI does haywire, especially if you're running El Cap. Command line is your friend.

Are you booted to that Patriot USB key?

Open Terminal and run the two commands below then tell me the output of each.

Which one are you trying to get rid of?

Code:
diskutil list

Code:
diskutil cs list
 
  • Like
Reactions: Failurbydesign
Are you booted to that Patriot USB key?

Open Terminal and run the two commands below then tell me the output of each.

Which one are you trying to get rid of?

Code:
diskutil list

Code:
diskutil cs list


It was a boot camp partition, i didn't get rid of it the right way. No i did not boot into the drive. I'm trying get rid of the two smaller partitions seen in the picture below.
 

Attachments

  • Screen Shot 2015-11-10 at 2.24.28 PM.png
    Screen Shot 2015-11-10 at 2.24.28 PM.png
    328.3 KB · Views: 95
  • Screen Shot 2015-11-10 at 2.24.49 PM.png
    Screen Shot 2015-11-10 at 2.24.49 PM.png
    476.9 KB · Views: 88
It was a boot camp partition, i didn't get rid of it the right way. No i did not boot into the drive. I'm trying get rid of the two smaller partitions seen in the picture below.

Before you do anything make sure you have a good backup because one wrong move here and your drive will not be bootable and all data will be gone. So don't blame me if this goes badly. :)

Okay... follow these steps.

First boot from the USB key then get into Terminal from the Utilities menu in recovery.

Enter this command to turn off core storage for the main volume so we can later resize it. It takes a bit to finish.

Code:
diskutil cs revert /

Now enter the following to unmount the disk.

Code:
diskutil unmountDisk /dev/disk0

Now these two one after the other to remove the 16.8 and 122.9MB little partitions you want gone.

Code:
gpt remove -i 5 disk0

Code:
gpt remove -i 4 disk0

Now you should be able to exit Terminal then use Disk Utility to expand the OS X volume to fill the disk.
 
Before you do anything make sure you have a good backup because one wrong move here and your drive will not be bootable and all data will be gone. So don't blame me if this goes badly. :)

Okay... follow these steps.

First boot from the USB key then get into Terminal from the Utilities menu in recovery.

Enter this command to turn off core storage for the main volume so we can later resize it. It takes a bit to finish.

Code:
diskutil cs revert /

Now enter the following to unmount the disk.

Code:
diskutil unmountDisk /dev/disk0

Now these two one after the other to remove the 16.8 and 122.9MB little partitions you want gone.

Code:
gpt remove -i 5 disk0

Code:
gpt remove -i 4 disk0

Now you should be able to exit Terminal then use Disk Utility to expand the OS X volume to fill the disk.


Thanks for the info, i booted to the installer usb i created, but this is what i get. Thoughts?
 

Attachments

  • IMG_2021.JPG
    IMG_2021.JPG
    4.7 MB · Views: 97
Thanks for the info, i booted to the installer usb i created, but this is what i get. Thoughts?
Hmm... do you need the data on the disk? Can we just wipe the whole drive and start over?

If so, run this in Terminal while booted from the recovery key.

Code:
diskutil cs delete "OSX"

That will wipe the OS partition. Then go to Terminal and in the erase tab select the disk itself at the top and format to Mac OS Extended (Journaled). That should get you back to a blank disk with one partition.
 
Hmm... do you need the data on the disk? Can we just wipe the whole drive and start over?

If so, run this in Terminal while booted from the recovery key.

Code:
diskutil cs delete "OSX"

That will wipe the OS partition. Then go to Terminal and in the erase tab select the disk itself at the top and format to Mac OS Extended (Journaled). That should get you back to a blank disk with one partition.


Nah i got a back up! I'll give that a try and get back to you!
 
  • Like
Reactions: Weaselboy
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.