For some reason, the BootCamp Assistant app won't let me delete my BootCamp partition. How can I do so using Terminal and the diskutil terminal app?
Windows – How to delete a BootCamp partition using Terminal’s diskutil
bootcamppartitionterminalunixwindows
Related Solutions
Update 2:
I assume OS X is installed on partition 2 of disk 0. If you want me to check this, then post the output of the next three commands and I will verify. Otherwise proceed and attempt the resize.
diskutil list
sudo gpt -r -vvv show -l /dev/disk0
sudo fdisk /dev/disk0
To resize to a smaller size, you will have to boot using OS X Internet Recovery. (Hold altcmdR at startup.) Open the Terminal application and enter the following command.
diskutil resizeVolume /dev/disk0s2 limits
Here is an example output. Your numbers will be different.
For device disk0s2 Steelhead:
Current size: 345.1 GB (345131147264 Bytes)
Minimum size: 35.3 GB (35299999744 Bytes)
Maximum size: 345.1 GB (345131147264 Bytes)
Take the minimum size and use that in the next command. (i.e. replace 35.3 with your number)
diskutil resizeVolume /dev/disk0s2 35.3G
Hopefully this will resize to the smallest possible size.
Note: When testing this procedure, I did not use OS X Internet Recovery. My 2007 iMac is just to old. I had to use a flash drive to boot the OS X Recovery System. While you can also create and use a flash drive, I just assumed OS X Internet Recovery would be easier. You CAN NOT use the OS X Recovery System stored on your internal disk. If you want to try using the OS X Recovery System from a flash drive, you will need the OS X Recovery Disk Assistant v1.0.
Update 1:
Justin if you are afraid of violating the warranty, should I assume my answers should only be Apple approved? Well, that would just lead you to following the instructions that you have been already following. So, if that is as far as the slider will go then ... that is as small as you can make the OS X partition.
On the other hand, I would remove the Core Storage and then see if you can move the slider further. Why bother with backup anything up first. You are not going to use OS X anyway. The worst that could happen is you would have to reload from the internet. Your connection speed is fairly good, so that should not take long.
Of course, it would have helped to post more than the first line produced from the distutil cs list
command. I assume you either misunderstood my instructions or are really bad at using OS X. I was hoping to determine if you had a Fusion drive and/or if Core Storage is revertible. Also, I believe you need the UUID to enter the command to revert.
If you choose to keep Core Storage, I would refer you to klanomath, he is far more experianced than me. (Actually, I have no experience with Core Storage other than reading his posts.) One of us could ask him for help, or at least, his opinion.
What is the model year of your macbook air? You can find this by clicking the apple icon on the menu at the top of your screen, then selecting "About this Mac". Also, you might as well determine if you are using core storage. To do this: Open the Terminal application and type the following command.
diskutil cs list
If the output is something other than
No CoreStorage logical volume groups found
then edit your question and post the results there. Don't worry about the format, I will clean it up for you.
I assume your Mac is new enough to boot off the internet. This is where you hold the keys cmd-alt-r down at startup. What I want to know is how long does that takes? Also, do you have any way to do backups. For example, do you have a external hard disk. If so, what format and how much free space. Or, do you use Time Machine? Finally, do you have another way to access the internet, other than your macbook air? If you can not add comments to my answer, the edit your question and post the answers there.
How to proceed, depends the answers to my questions. If possible I would backup your OS X partition. Then if you are using core storage, I would remove it. Core storage is only useful if you have a Fusion Drive. Next, if internet recovery is to slow, then I would transfer my Recovery partition to a flash drive. (You probably don't even know you have a Recovery partition hidden on your internal SSD.)
If you intend to leave OS X on your internal SSD and you are able to shrink to a size smaller than 38Gb, what happens when software updates need to be installed? Or, OS X 10.10.3 comes along? If you need to grow the OS X partition in the future, then the Windows partition will have to be removed to do so.
You show in your posted image that the partition is encrypted. I was unaware a partition could be encrypted without using core storage. Anyway, I believe the correct command to fix your drive is given below.
sudo diskutil resizevolume /dev/disk0s2 R
The command should move /dev/disk0s3
to the bottom of disk0
while resizing /dev/disk0s2
to maximum size. I am not sure if the sudo
prefix is required.
Best Answer
Here's what worked for me:
diskutil list
to find the small Microsoft Reserved partition you're trying to delete but disk utility (or the command-line equivalentdiskutil
) won't allow. Let's say it's on disk 99 partition 400 (mine was on disk 0 partition 4)sudo diskutil eraseVolume JHFS+ deleteme /dev/disk99s400
The above reformats the partition to journaled HFS+ and once you've done that you can just simply delete it (and then resize etc. as you wish).
Note: I've used /dev/disk99s400 because that should not ever work, you have to replace those with the right disk and partition.
WARNING: Destructive, high risk. ALWAYS do a full back up first before screwing with partitions. ALWAYS.