NOTE: This article has been brought back to life due to increasing popularity.
Some of the information may be out of date now that OS X Yosemite is the current version of OS X (although I have just experienced an enormous amount of pain with a new Mac shipping with Yosemite – there are STILL problems with FileVault/Core Storage).
There appears to be an issue with the Disk Utility that comes bundled with the Mountain Lion recovery/installation system.
If you’re looking to do a completely clean Mountain Lion install, and already have an encrypted filesystem created by FileVault from OS X Lion – you may encounter the following problem when attempting to erase or delete it through Disk Utility. I have been able to reproduce this across two machines now (an early 2011 17″ MacBook Pro and a mid-2011 21″ iMac).
Once you’ve booted from the USB drive and fired up Disk Utility – if you delete the encrypted volume, you’ll find you’ll come across this message:
Disk Encryption Failed
Disk encryption failed with the error
There is not enough free space in the Core Storage logical volume Group for this operation.
You won’t be able to do anything at all with the boot volume – you can’t create a new partition, you can’t install – you’re snookered.
But don’t panic! Just quit Disk Utility, go to the Utilities menu and fire up Terminal. Then issue the command:
diskutil cs list
which will give you a list of logical CoreStorage volumes (and a physical volume as well – but ignore that). Copy the long UUID string of the the logical volume. Now type:
diskutil cs delete UUID
where UUID is that long string of characters. You will see a text-based progress bar for a bit and finally confirmation that the volume has been deleted. The whole process looks like this:
You can then quit Terminal, fire up Disk Utility, partition to your heart’s content and then finally install a fresh clean Mountain Lion from scratch. Hoorah.