I started with a basic Ubuntu 22.10 installation, where I chose in the installer to use ZFS as my volume manager.
I wanted to encrypt my home folder.
I followed the article (and comments, including Christoph Hagemann's) from:
https://talldanestale.dk/2020/04/06/zfs-and-homedir-encryption/
To achieve:
- Home directory (a ZFS rpool mount) is encrypted
- You are only prompted for password if you are trying to login to that user
- So PC can boot fine to login screen without intervention
- Password prompt authenticates you as the user and decrypts the home folder's rpool
- SSH users get the same experience as physical users
- You can power on the PC, then SSH in
- Once rpool is unlocked: subsequent SSH login can use key exchange instead of password
- Once all sessions log out: rpool is encrypted and unmounted again
Adding new disks
We will not attempt to add the disk to an existing pool. Just gonna keep things simple by giving the drive its own, new pool. If any drive is removed: we know it has no impact on the other pools.
My results were initially:
Where:
/dev/nvme1n1
: new 4TB NVMe SSD, unformatted/dev/nvme0n1
: main boot device (4TB), already has ZFS set up as per above instructions/dev/sda
: previous 1TB Windows boot device, SATA SSD/dev/sdb
: new 8TB SATA SSD, unformattedI then formatted the new
/dev/nvme1n1
like so:sudo fdisk -l
now describes it as:Our new pool is not listed in
zfs list -r rpool
, because it is not a root pool. it appears inzfs list
though:I also changed ownership of
/nvme1
to birch:birch:At the time of creation: the directory should already be decrypted.
But after reboot: you'll need to unlock it.
# this will prompt you for your password sudo zfs load-key nvme1 sudo zfs mount nvme1
You can avoid this by setting it up for compatibility with our automount script: