Aug '14 27

Move ZFS filesystem between pools

I’m migrating my data around between my different raid groups (Mirror and RaidZ1). I Found a good post on how to do it with zfs send/receive and snapshots.

  • Use Pipe Viewer (pv) to monitor progress
  • Create a snapshot on source use -r for child subsystems
  • zfs send -R / receive -F  (may need -d  to remove first node name on destination)
  • Remove any snapshots and reconfigure Samba and mountpoints.
  • check zfs set has the correct settings

Create snapshot and copy to destination
zfs snapshot -r sourcepool@moving
zfs send -R sourcepool@moving | pv | zfs receive -F destpool
# OR
zfs send -R sourcepool@moving | pv | zfs receive -dF destpool

Stop any locks on system (Samba / NFS / FTP etc)
zfs snapshot -r sourcepool@moving2
zfs send -Ri sourcepool@moving sourcepool@moving2 | pv | zfs receive -F destpool
# OR
zfs send -Ri sourcepool@moving sourcepool@moving2 | pv | zfs receive -dF destpool