# Create a usb disk with Elementary OS and Startup Disk Creator
# Boot it
sudo -i
apt-add-repository --yes ppa:zfs-native/stable
apt-get update
apt-get install --yes spl-dkms zfs-dkms ubuntu-zfs
zpool create -f rpool /dev/disk/by-id/ata-DISK
zfs set compression=lz4 rpool
zfs create rpool/ROOT
zfs create rpool/ROOT/elementary-1
zfs set mountpoint=/ rpool/ROOT/elementary-1
zpool set bootfs=rpool/ROOT/elementary-1 rpool
parted -s /dev/disk/by-id/ata-DISK mkpart GRUB2 48s 2047s
parted -s /dev/disk/by-id/ata-DISK set 2 bios_grub on
zpool export rpool
zpool import -R /mnt rpool
#debootstrap trusty /mnt
cp /etc/hosts /mnt/etc/
cp /etc/resolv.conf /mnt/etc/resolv.conf
nano /mnt/etc/hostname
mount --rbind /dev /mnt/dev
mount --rbind /proc /mnt/proc
mount --rbind /sys /mnt/sys
chroot /mnt /bin/bash --login
cp -rp /fire/EXISTING-ELEMENTARY-INSTALL /mnt
locale-gen en_US.UTF-8
dpkg-reconfigure tzdata
apt-get update
apt-add-repository --yes ppa:zfs-native/stable
apt-get update
apt-get install --yes ubuntu-zfs
apt-get install --yes grub-pc zfs-initramfs
wget -q -O /etc/cron.hourly/zfs-check https://gist.githubusercontent.com/fire/65f7aa33b91d3af2aef0/raw/a0309ef9a6bec26b497b2ee7e00aaa2889310384/zfs-check.sh
wget -q -O /etc/cron.monthly/zfs-scrub https://gist.githubusercontent.com/fire/65f7aa33b91d3af2aef0/raw/5b0904343897b1410fd57239879a0f43ff634883/zfs-scrub.sh
chmod 755 /etc/cron.hourly/zfs-check /etc/cron.monthly/zfs-scrub
wget -q -O /etc/sudoers.d/zfs https://gist.githubusercontent.com/fire/65f7aa33b91d3af2aef0/raw/36a2b9e37819abffc6bfc2a9a36859afabf47754/zfs.sudoers
chmod 440 /etc/sudoers.d/zfs
# Change name of admin user
USERNAME="johnd"
adduser $USERNAME
cp -a /etc/skel/.[!.]* /home/$USERNAME
chown $USERNAME:$USERNAME /home/$USERNAME
usermod -a -G adm,audio,dialout,dip,cdrom,floppy,fuse,lpadmin,plugdev,sambashare,scanner,sudo,video $YOURUSERNAME
apt-get install grub-common grub-pc
apt-get install zfs-initramfs
cat > /etc/udev/rules.d/70-zfs-grub-fix.rules << 'EOF'
ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*", ENV{ID_FS_TYPE}=="zfs_member", SYMLINK+="$env{ID_BUS}-$env{ID_SERIAL} $env{ID_BUS}-$env{ID_SERIAL}-part%n"
EOF
udevadm trigger
sudo nano /etc/default/grub
# add "boot=zfs" to GRUB_CMDLINE_LINUX_DEFAULT=
update-initramfs -c -k all
# update-initramfs: Generating /boot/initrd.img-3.2.0-40-generic
# 6.3 Update the boot configuration file:
update-grub
# Generating grub.cfg ...
# Found linux image: /boot/vmlinuz-3.2.0-40-generic
# Found initrd image: /boot/initrd.img-3.2.0-40-generic
# done
# Verify that boot=zfs appears in the boot configuration file:
grep boot=zfs /boot/grub/grub.cfg
# linux /ROOT/ubuntu-1/@/boot/vmlinuz-3.2.0-40-generic root=/dev/sda2 ro boot=zfs $bootfs quiet splash $vt_handoff
# linux /ROOT/ubuntu-1/@/boot/vmlinuz-3.2.0-40-generic root=/dev/sda2 ro single nomodeset boot=zfs $bootfs
# 6.4 Install the boot loader
grub-install $(readlink -f /dev/disk/by-id/scsi-SATA_disk1)
# Installation finished. No error reported.
exit
# 7.2 Run these commands in the LiveCD environment to dismount all filesystems:
umount -l /mnt/dev
umount -l /mnt/proc
umount -l /mnt/sys
zfs umount -a
zpool export rpool
reboot
# See issue https://github.com/zfsonlinux/pkg-zfs/issues/113 for adding a script to add dev link
# See issue for partition 1 workaround https://github.com/zfsonlinux/grub/issues/5
Do you think this would be more or less an identical procedure on elementaryOS Hera? Looking to try it out on ZFS root