How to mount an encrypted disk from the command line

disk-utilityencryptionhard drivemountterminal

When I type diskutil mount disk3 in the terminal, it says Volume(s) mounted successfully. However, the disk is not mounted and I can confirm this by opening the GUI of Disk Utility.app and also the disk does not show in the Finder.

I suspect this is because the disk is encrypted and the terminal command is not passing via "Keychain" to retrieve the password for the encrypted disk.

What do you think? Is there a way to mount encrypted disks via the command line?
Thanks.

Best Answer

You want to run diskutil coreStorage unlockVolume <UUID>, where the UUID is the Logical Volume UUID associated with your encrypted disk, /dev/disk3. You can get the lvUUID by running diskutil cs list in the terminal and looking for the output related to /dev/disk3. The identifier is a long string that would look something like this 'B807C2A0-577F-3DB0-9002-F82B9137696C'.

It will prompt you for a password at that point and if it's correct, unlock the disk.