Ubuntu + ZFS: How to migrate entire system to new disks?

This should work:

  • Create a similar partition layout on the new disks, ZFS isn't going to do it for you.

  • Copy the boot partition and reinstall the boot loader.

  • set the autoexpand property on your root pool zpool set autoexpand=on labpool

  • Replace one of the disks, eg zpool replace labpool sda5 sdc5 and wait for the resilvering to mirror all the pool datasets using zpool status

  • Replace the second disk zpool replace labpool sdb5 sdd5.

  • Remove the old disks


You should be able to use zpool replace <pool> <old disk> <new disk> for each disk. This will keep all partitions, file attributes etc. I have used this successfully with zfs-fuse.

See the manpage.