Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dapperfu
Last active May 12, 2020 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dapperfu/7dd04fb929e7061e62d4c13922fb1746 to your computer and use it in GitHub Desktop.
Save dapperfu/7dd04fb929e7061e62d4c13922fb1746 to your computer and use it in GitHub Desktop.
Lessons learned from Ubuntu 20.04 [Focal Fossa] ZFS-on-Root.

Ubuntu 20.04 ZFS on Root

  1. During installation you have to pick between Encryption or ZFS.
  2. It is easy to add encryption to specific zfs file systems after installation.
  3. ZFS on Linux's encryption call is different than Oracle's.

Everything in this thread relevant to encryption doesn't work.

From this thread: https://www.reddit.com/r/zfs/comments/bnvdco/zol_080_encryption_dont_encrypt_the_pool_root/

Oracle: zfs create -o encryption=on -o keysource=format,location e ....

Ubuntu/ZoL: zfs create -o encryption=aes-256-gcm -o keyformat=passphrase -o keylocation=prompt -o mountpoint=/tank/enc tank/enc

Mounting them at a later time:

zfs mount -l tank/enc

Pay attention to the -l.

Keywords: ZFS on linux encryption. ZFS encryption. Ubuntu 20.04 ZFS encryption

@dapperfu
Copy link
Author

Adding a mirrored drive.

Problem: Ubuntu 20.04's installer doesn't allow you to create a mirrored zpool.
Solution: Add it later.

After installation go to a shell.

zpool status bpool

        NAME                              STATE     READ WRITE CKSUM
        bpool                             ONLINE       0     0     0
            wwn-0x50014ee2624f5972-part3  ONLINE       0     0     0

Copy the partition table to a new device & randomize guid. (See the symlinks in /dev/disk/by-id/)

sgdisk /dev/sdi -R /dev/sdj
sgdisk -G /dev/sdj

Attach the new drive. [I don't know if order is important, I put the existing drive first which is what all other examples show].

zpool attach bpool wwn-0x50014ee2624f5972-part3 wwn-0x5000c5006727f0f0-part3

Repeat for the rpool, copy the EFI partition, install grub. Reboot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment