Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

How to make Ubuntu dual-boot reinstall with zfs-on-root?

Writer Andrew Henderson

I am using a Ubuntu system (19.10) with zfs as the root file system.

I installed the system as a dual-boot system by installing on a smaller disk and transferring the partitions to a larger disk afterwards with Windows partitions already on it, so the gpt partition scheme has the following partitions now:

part 1 - UEFI boot - /boot/efi
part 2 - Grub boot partition - /boot/grub
part 3 - swap
part 4 - zfs boot (bpool)
part 5 - zfs root (rpool)
part 6 - Windows MSR
part 7 - Windows System
part 8 - Windows RE

So, I would like to reinstall the system for unrelated reasons now. I am even willing to test 20.04 if it's more flexible. How can I best reinstall the system? The plain Ubuntu installer doesn't know about zfs, and the zfs option only works on the whole disk.

In other words, I want to install Ubuntu again, with part 3 - 5 open to deletion / formatting, the others should be untouched.

1 Answer

The easiest way to install Ubuntu with root as zfs I have come up with so far is this:

  1. Do a default zfs install (with full disk erasure) on a virtual machine
  2. Erase your two old partitions on the physical computer
  3. create two new partitions on the physical computer which start at the same starting points as the old ones and have sizes equal to the sizes of the corresponding rpool and bpool partitions on the VM
  4. Copy the two partitions from VM to physical computer with dd over network or removable media
  5. Adjust UUIDs in /etc/fstab on the physical computer according to the new values
  6. Boot into new Ubuntu, probably manually specifying root and linux parameters at the grub> prompt
  7. Make sure /boot and /boot/efi are mounted correctly
  8. grup-install && reboot
  9. Use parted to expand partitions to their full size (or however large you want them to be)
  10. Use zpool online -e to expand the pools to the full partition size
  11. Done

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy