ZFS on Root rescue
Rescue mode
I use ZFS on Root when ever I can. In case you broke something so terribly, that it doesn’t boot anymore and you need to boot a rescue-system like Grml.
Install zfs
Install in your rescue-system
# apt install zfs-dkms
Mount it
Import the rpool
with a different mountpoint, otherwise you can’t mount it
somewhere else.
# zpool import -R /mnt rpool -f -N
Because you are intelligent, everything is encrypted. So you need to unlock
your rpool
.
# zfs load-key rpool
Mount / before the others, because the order might be wrong.
# zfs mount rpool/ROOT/debian
Now also import bpool
.
# zpool import -R /mnt bpool -f -N
… and mount all.
# zfs mount -a
mount-bind all the important special filesystems to /mnt
# for i in proc sys dev dev/pts; do mount -o bind /${i} /mnt/${i}; done
Jump into the system to repair.
# chroot /mnt
Now do fix your sh!t.
Cleanup
On your next boot, you might need to fix the mountpoint of rpool
.
TODO: add this in detail, the next time I need it.