/usr/home

just some random thoughts

ZFS Pool migration to another Disk

In this Article I want you to show, how you can migrate your data from a ZFS-Pool to another or copy a entire Pool to a new Pool (e.g. if you have a single-Disk-Pool and want to migrate to a Mirror or Raidz with bigger Harddisks).

  • The manual way:

Create your Datasets you had on your old Pool and set your ZFS Options using “zfs set | get”. Then copy your data and set permissions.

Because of this is a lot of work, especially if you have a big pool there is a another solution:

  • Do it with “zfs send | receive”

First deactivate your smb/nfs/apf/… Servers, so you cannot lose data in the time of your migration. Now create a snapshot of your Pool. Doing it with -r will do it recursively (zfs snapshot -r tank@migration).

Now create your new pool using zpool, e.g.:  “zpool create data mirror c2t2d0 c2t3d0″. To see all your disks you can use the format utility. 

The last step is to copy your datasets.

zfs send -R tank@migration | zfs receive -d -F data

With “-R” all subdatasets will be sent, “-d” will recreate them on the destination and “-F” forces to overwrite the pool. This step takes a lot of time.

Happy migrating !