Mounting Filevault disks from command line?

Discussion in 'macOS' started by orbited, Dec 20, 2011.

  1. orbited macrumors newbie

    Joined:
    Jul 1, 2009
    #1
    I've installed an SSD as my main disk and, using an Optibay adapter, replaced my Superdrive with the old HD. The idea is to keep the system snappy, while storing bulky data on the HD. To keep the system quiet, I try to prevent my HD from spinning more than necessary. I like to keep things encrypted, so Filevault 2 is enabled for both SSD and HD.

    Problem: I can't figure out how to mount my encrypted HD partition from the command line.

    My disks looks like this:
    Code:
    /dev/disk0
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *320.1 GB   disk0
       1:                        EFI                         209.7 MB   disk0s1
       2:          Apple_CoreStorage                         267.9 GB   disk0s2
       3:                 Apple_Boot Boot OS X               134.2 MB   disk0s3
       4:       Microsoft Basic Data BOOTCAMP                51.3 GB    disk0s4
    /dev/disk1
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *120.0 GB   disk1
       1:                        EFI                         209.7 MB   disk1s1
       2:          Apple_CoreStorage                         119.2 GB   disk1s2
       3:                 Apple_Boot Recovery HD             650.0 MB   disk1s3
    /dev/disk2
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:                  Apple_HFS System SSD             *118.9 GB   disk2
    /dev/disk3
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:                  Apple_HFS Data HD                *267.8 GB   disk3
    I've tried diskutil mountDisk /dev/disk0 which in theory should work great, but it only mounts the BOOTCAMP partition. Running diskutil mountDisk /dev/disk3 returns a Volume(s) mounted successfully message, but the drive does not show up in the Finder. My guesstimation is that it has something to do with the encryption?

    Mounting Data HD from Disk Utility works fine, but cannot be scripted.

    I've also tried hdiutil attach /dev/disk3 and it works, but with one flaw. A GUI authentication box (from Authopen) comes up. Twice. It requires me to enter my password. If I enter it, it works. But again, it can't be scripted. And no way of adding password to Keychain or anything.

    So, my question is: how do I mount my encrypted /dev/disk3 to an accessible state? Considering I don't need to input password when mounting from the Disk Utility, it shouldn't be impossible?

    Very grateful for answers! Best,

    / Jonathan
     
  2. mankoff macrumors newbie

    Joined:
    Mar 16, 2014
    #2
    Hi,

    I'm in the exact same situation and can't find a solution. Did you ever find one?

    Thanks,

    -k.
     
  3. mfram macrumors 65816

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #3
    The appropriate commands in Terminal will be 'diskutil' and 'diskutil cs'. Any commands having to do with mounting those volumes will be there. Encrypted volumes are stored as CoreStorage virtual volumes which is why the 'diskutil cs' command would be used.

    I can't give you exact commands because I don't have a setup like what you're describing. But those are the commands that will do it if any will.
     
  4. mankoff macrumors newbie

    Joined:
    Mar 16, 2014
    #4
    Yes thanks for the hint.

    disktutil cs list

    shows the list of disks, and then the Logical Volume ID (about 40 characters long) is shown. Then, the command

    diskutil mount <ID>

    works. I don't need to enter root password anymore to mount/unmount my internal TM backup.

    Finally,

    tmutil startbackup

    starts the backup.
     

Share This Page