Search code examples
migrationext4zfsubuntu-20.04

How do I migrate an existing 20.04 ext4 installation to zfs root on different disk?


I have a 20.04 ext4 installation (successful upgrade from 19.10!) and am just wondering about the above.

One caveat I can think of is /etc/fstab and some other things may be somewhat different for ZFS root and so should probably not be transferred over.

Is there any way to automagically avoid/resolve such conflicts, or should I just do a clean ZFS root installation and setup from scratch?


Solution

  • The diet version is that to switch to ZFS root on a separate disk you will need to do the following:

    1. Remove the / mount from /etc/fstab on the ZFS side after copying the rootfs across

    2. Make sure that you rebuild the initramfs to include the zfs kernel module and userspace zpool and zfs binaries.

    3. Change your kernel boot parameters to specify root=ZFS=poolname/rootfsname

    There is an excellent howto available here that covers this topic in full detail: https://github.com/openzfs/zfs/wiki/Ubuntu-18.04-Root-on-ZFS