Skip to content

Instantly share code, notes, and snippets.

@bcfurtado
Last active May 21, 2021 07:41
Show Gist options
  • Save bcfurtado/6e4d1d4953cfbc28f4a1d482392db348 to your computer and use it in GitHub Desktop.
Save bcfurtado/6e4d1d4953cfbc28f4a1d482392db348 to your computer and use it in GitHub Desktop.

Reinstall GRUB on ubuntu 20.04 with ZFS

sudo -i
zpool export -a
zpool import -N -R /mnt rpool
zpool import -N -R /mnt bpool
zfs load-key -a
# Replace “UUID” as appropriate; use zfs list to find it:
zfs mount rpool/ROOT/ubuntu_UUID
zfs mount bpool/BOOT/ubuntu_UUID
zfs mount -a
mount --rbind /dev  /mnt/dev
mount --rbind /proc /mnt/proc
mount --rbind /sys  /mnt/sys
mount -t tmpfs tmpfs /mnt/run
mkdir /mnt/run/lock
chroot /mnt /bin/bash --login
mount -a
grub-probe /boot
update-initramfs -c -k all
update-grub
grub-install /dev/sdX # For legacy (BIOS) booting
exit
reboot

Source: https://openzfs.github.io/openzfs-docs/Getting%20Started/Ubuntu/Ubuntu%2020.04%20Root%20on%20ZFS.html

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