DISCLAIMER: make sure you have backed up all your data before following these steps. Use these steps solely on your own risk!
- Install Ubuntu 18.04 using server installer, but change partitioning as follows
EFI partition: 1gb
/boot partition ext4: 1gb
/ partition ext4: 4gb (or size for swap usage)
- Update to latest
apt-get update && apt-get upgrade
- Add latest ZFS version
add-apt-repository --yes ppa:jonathonf/zfs
- Install zfs tools
apt install zfs-dkms zfs-initramfs gdisk
- Add partitions to partition table
gdisk /dev/sda
- Enter
n
for new partition - Enter +512G as size and a504 as partition type
- Enter
p
to see partition table - Enter
w
to write partition table - Repeat for sdb
- Reboot
- Create pool
zpool create -o ashift=12 -O atime=off -O compression=lz4 tank mirror /dev/disk/by-id/XXXXXpartX /dev/disk/by-id/YYYYYpartY
- Create datasets
zfs create -o mountpoint=none -o canmount=off tank/os
zfs create tank/os/root
- Copy / to ZFS
rsync -a --one-file-system / /tank/os/root/
- Change into chroot environment
cd /tank/os/root
mount --bind /boot boot
mount --bind /dev dev
mount --bind /proc proc
mount --bind /sys sys
mount --bind /run run
chroot .
update-grub
grub-install /dev/sda
grub-install /dev/sdb
exit
reboot
zfs set mountpoint=legacy /tank/os/root/
reboot
zfs list
$ lsinitramfs /boot/initrd.img-4.8.0-58-generic | grep zfs