Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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.

share|improve this answer
    
THIS is the answer. Thank you!! – Qix Oct 2 '15 at 11:49
    
Worked like a charm. Thanks! – Husky Nov 30 '15 at 20:17

You can use hdiutil to mount a disk image that is protected with a passphrase.

hdiutil attach -agentpass /path/to/image.dmg

That should attempt to mount the disk image, prompting you for the passphrase. If it's encrypted with a public key, you can pass that using option -pubkey.

share|improve this answer
    
Thanks. This isn't quite what I"m looking for. It doesn't ask for the password the disk is encrypted with. It asks for my local account password twice before attaching the disk. – josswinn Mar 4 '12 at 7:40
2  
Oddly enough it only prompts me for a password when I omit the -agentpass option. – Teo Sartori May 13 '13 at 9:17
    
Your answer, using hdiutil, has nothing to do with the OP and question asked, which was about mounting an encrypted disk from the command line, not an encrypted disk image, which are two different things! foundling's answer, using diskutil, is the correct answer! – user3439894 May 1 at 20:00

I can't see what I'm doing differently today, but

diskutil unmount disk3

and

diskutil mount disk3

are working fine and properly unmounting and mounting the HDD and it is viewable in the Finder. Encryption doesn't seem to have anything to do with it.

share|improve this answer
    
Are you answering your own question here? If so, is your answer that the problem simply went away? – Daniel Mar 6 '12 at 7:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.