Auto-Mount native encrypted dataset on boot

New to OpenZFS on OS X (Or ZFS in general)? Ask your questions here!

Auto-Mount native encrypted dataset on boot

Postby sir_brickalot » Mon Oct 15, 2018 1:44 am

What is the best way to mount an OpenZFS encrypted dataset without user interaction?

Right now I handle it this way:

  • add the password for the dataset to keychain
    GUI:
    open /Applications/Utitlies/Keychain\ Access.app > Create a new Keychain item > add 'KeychainItemName' and 'password'
    Terminal:
    https://www.netmeister.org/blog/keychain-passwords.html
  • create a bash script to retreive password from Keychain and us the .command suffix for the file name ('mount_dataset.command') :

    Code: Select all
    #!/bin/bash
    # mount encrypted zfs dataset on login

    security find-generic-password -a ${USER} -s 'KeychainItemName' -w | sudo zfs mount -l tank/dataset

  • Add 'mount_dataset.command' file to Settings/Users & Groups/Login Items

When I login into the system a terminal window opens and I have to enter my admin password for the mount to finish.
Is there a better way without user interaction?
sir_brickalot
 
Posts: 12
Joined: Tue Apr 11, 2017 11:13 am

Return to Absolute Beginners Section

Who is online

Users browsing this forum: No registered users and 1 guest