Need to migrate a ZVol or dataset to another ZFS pool? Whether you’re reorganizing storage or upgrading hardware, ZFS makes it straightforward to move data between pools with just a few commands. Here’s how you can do it efficiently and safely.
To move a ZVol, start by creating a snapshot of the ZVol. Then, use the zfs send and zfs receive commands to transfer the snapshot to your target pool. For example:
Move a zvol called myVol from pool aaa to pool bbb
zfs snapshot -r aaa/myVol@relocate
zfs send aaa/myVol@relocate | zfs receive -v bbb/myVol@relocate
Move a dataset called myDS from pool aaa to pool bbb
zfs snapshot -r aaa/myDS@relocate
zfs send aaa/myDS@relocate | zfs receive -v bbb/myDS@relocate
The zfs send and zfs receive commands work for both datasets and ZVols, allowing you to transfer data between pools on the same system or even across different systems over a network. This flexibility makes it easy to manage and migrate your ZFS storage as your needs evolve.