ZFS on Linux emergency Boot CD
July 6, 2015
Posted by on
If you are planning on running your Linux system on a ZFS root, having an emergency boot CD is indispensable.
I was able to get a SystemRescueCD which already had the proper ZFS modules already included
The image can easily be imaged onto a usb drive for convenience.
Alternatively, in a pinch you can use an Ubuntu Live Image as a base to add the ZFS repos and apt-get all the modules.
What I have done for managing ZFS related boot issues:
1. Boot up (use graphical environment or configure the network and change root password for ssh)
2. Import the root pool and setup a chroot environment
zpool import -f -R /mnt/ubuntu rpool
for dir in sys proc dev; do mount –bind /$dir /mnt/ubuntu/$dir; done
chroot /mnt/ubuntu bash -l
3. after this you can run your grub commands to reinstall to your devices and regenerate your grub.cfg. Additionally, you can stop and restart the udevadmin process if you need to recreate devices in /dev for grub.
4.When you are done, exit from your chroot environment and unmount the filesystem to allow you to export the zfs pool prior to rebooting the system.
for dir in sys proc dev; do umount /mnt/ubuntu/$dir; done
zpool export rpool