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 retrieve 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?
[edit: typo]