I have a long, complicated password for an external drive encrypted with FileVault that I have securely stored, but OS X doesn’t allow pasting into the password unlock GUI dialog (argh!). How can I unlock it via the terminal so I can paste the password in there?
Beginning with OS X 10.11 “El Capitan”, you can now paste into the GUI unlock dialog! If you’re using an older OS X (or just want to use the command-line to unlock), read on.
diskutil command is for working with volumes via the terminal in OS X.
First, find the UUID for your drive via
diskutil list. You should see a section like this:
Logical Volume MyAwesomeDrive on disk2s2 96EC217A-54F2-49A3-8471-9BFE535D159A Locked Encrypted
Where “MyAwesomeDrive” is the volume name, and “96EC217A-54F2-49A3-8471-9BFE535D159A” is the UUID we’re looking for.
diskutil coreStorage unlockVolume <uuid>, replacing
<uuid>with the UUID found above. It will prompt for your password (which can be pasted in) and unlock the encrypted volume.
Note: If you’re typing/pasting passwords or other secure information into the terminal, it would be wise to enable “Secure Keyboard Entry” in the Terminal app menu (also available in iTerm). Read more on security.se.