Migrate zfs pool from SATA to NVME disks

I’m trying to migrate to a new laptop with dual nvme disks from a set of mirrored sata drives, I have a USB to SATA dongle that I can mount my pool to. What would be the most painless and simple way to get my data off the SATA drives and on to the new storage mediums.

I’ve installed a temporary dummy distro to one of the two nvme disks, I’ve installed zfs on the dummy distro. I’m thinking mount my old pool and transfer my pool to the unused nvme, and then just create mirror wiping the dummy distro, just unsure how to navigate

Create a snapshot of the pool → use zfs send to “copy” it to the new pool. done. No need for triangle trade.

ZFS is flexible and pools can be replicated or migrated to any other ZFS version or machine ever.

2 Likes

Would my entire pool copy over with datasets intact?

Let’s get the terminology straight first: you cannot snapshot or transfer a pool, you snapshot and transfer datasets.

So first create a new pool on your NVMe, then snapshot your dataset(s) on your old pool, then transfer them to the new pool.

Do you have multiple datasets? Are you storing all data in the root dataset?

You cannot replace the root dataset on a pool, so any data that’s on the root dataset on your old pool will end up in a new dataset under the root dataset on the new pool.

Also you need to read the man pages on ‘zfs send’ and ‘zfs recv’ to see what flags to use. You probably want to use send -R to create a replication stream to transfer all snapshots up to the named one (rather than just the named one); you might want to use -w (or not, depending on if you want to change recordsize, get rid of fragmentation etc). Also check out recv -s (resumable - is that a word? - streams), and -e/-d.

If you use -R and have multiple hierarchical datasets, you’ll want to snapshot them with -r (recursive) too. (I guess that’s a good idea regardless.)

1 Like