OS X: can't create a partition because drive is locked

16

10

Problem: I have a USB key with Mountain Lion on it and I want to install it on my MacBook Pro. I deleted the existing partition on the laptop and wanted to create a new one where to install the OS but can't because everything in the partition tab for the drive is grayed out.

Basically, I can't do anything until I unlock the partition. So the question is: how to unlock a partition from disk utility or the command line?

Alain

Posted 2012-07-16T00:47:18.010

Reputation: 263

Answers

31

I looked first hand into this problem and the following commands unlocked and formatted the disk, although Disk Utility could not.

$ diskutil list

Should show something like this:

/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *121.3 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            120.5 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *64.0 GB    disk1
   1:                        EFI                         209.7 MB   disk1s1
   2:          Apple_CoreStorage                         63.2 GB    disk1s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk1s3

Then format the disk in question. In this case, disk1.

$ diskutil eraseDisk JHFS+ name disk1

You should see this:

Started erase on disk1
Unmounting disk
Creating the partition map
Waiting for the disks to reappear
Formatting disk1s2 as Mac OS Extended (Journaled) with name name
Initialized /dev/rdisk1s2 as a 59 GB HFS Plus volume with a 8192k journal
Mounting disk
Finished erase on disk1

The following web pages helped me figure this out and might be of use to somebody else.

https://discussions.apple.com/thread/4091299?start=0&tstart=0

http://derflounder.wordpress.com/2011/11/23/using-the-command-line-to-unlock-or-decrypt-your-filevault-2-encrypted-boot-drive/

Carl

Posted 2012-07-16T00:47:18.010

Reputation: 426

1Thank you. After kicking my head upside the wall, you just worked it out for me. Thanks again. – Stephen Cox – 2012-07-25T21:42:04.000

This saved me, I had a FileVault enabled MacBook Air that after trying to erase got locked when trying to do a Mountain Lion clean install – agilityvision – 2012-07-29T01:17:30.940

1brilliant!!! I had a corrupt file vault partition and there was nothing I could do. This worked and took seconds. – Richard – 2012-09-23T23:43:21.813