-
-
Save hoonetorg/6ef8bb2d28c405485c2af7775488e2b6 to your computer and use it in GitHub Desktop.
Import ZFS pool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This service will unlock all ZFS pools at boot time | |
# It should live in | |
# /etc/systemd/system/zfs-load-key.service | |
# Enable it with | |
# systemctl enable zfs-load-key.service | |
[Unit] | |
Description=Load encryption keys | |
DefaultDependencies=no | |
Before=zfs-mount.service | |
After=zfs-import.target | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/bin/bash -c '/sbin/zfs load-key -a' | |
[Install] | |
WantedBy=zfs-mount.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zpool import <nameofzpool> | |
zfs set keylocation=file:///path/to/key <nameofzpool>/<nameofdataset> | |
zfs load-key <nameofzpool>/<nameofdataset> # or load all with zfs load-key -a | |
zfs mount <nameofzpool>/<nameofdataset> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment