Created
December 26, 2023 23:01
-
-
Save kyhwana/48e381bd82492a9a3f52d12939626cb6 to your computer and use it in GitHub Desktop.
Enabling ZFS encryption on ubuntu 23.10
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
Ubuntu 23.10 lets you select the advanced option of using ZFS, but not encrypting it. | |
#assuming you want to use zstd compression, if not remove the compress=zstd bits, as it defaults to lz4 | |
#This doesn't encrypt the boot pool. | |
#ROOT is the root zfs dataset. | |
1) Install ubuntu 23.10 as normal, select the advanced/experimental options when installing and select ZFS | |
2) Once the install is done, reboot back into the installer (via USB/DVD/etc) | |
3) "Try ubuntu" and open a terminal, then sudo -i to root | |
4) zpool import -f rpool | |
5) zfs list (get rpool/ROOT/ubuntu_<x>, where <x> will be some random numbers/letter we need this for later) | |
6) zfs snapshot -r rpool/ROOT@copy | |
7) zfs send -R rpool/ROOT@copy | zfs receive rpool/copyroot | |
8) zfs destroy -r rpool/ROOT | |
9) zfs create -o encryption=on -o keyformat=passphrase -o compress=zstd rpool/ROOT | |
10) Enter passphrase twice | |
11) zfs send -R rpool/copyroot/ubuntu_<x>@copy | zfs receive -o encryption=on -o compress=zstd rpool/ROOT/ubuntu_<x> | |
12) zfs destroy -r rpool/copyroot | |
13) zfs destroy -r rpool/ROOT/ubuntu_<x>@copy | |
14) zpool export rpool | |
15) reboot | |
For some reason this first boot gets stuck on the UEFI spinning screen, wait a few minutes then reset the machine and it will boot properly | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment