Personal tools
You are here: Home Storage Network FreeNAS ZFS/FreeNas migration of data to a new zpool

ZFS/FreeNas migration of data to a new zpool

This is a copy of the information provided in the link below.  The data from an existing zpool (tank) is moved to a new zpool (tank), which is then renamed to the orginal name (tank).

 

Starting with existing zpool 'tank' and a new empty zpool 'dozer', the steps are:

  1. Make snapshot of tank and send it to dozer (this may take a long while)
  2. When the cut-over is about to occur
    1. Ensure the disk isn't in use (shutdown iSCSI, NFS, syslog, etc)
    2. Make another snapshot of 'tank' and incrementally send it to 'dozer' (this should take a short time)
    3. Set 'tank' as readonly
    4. Export the two zpools
    5. Rename and import the original zpool as'digger'
    6. Rename an import the new zpool as 'tank'
# zfs snapshot -r tank@01
# zfs send -R tank@01 | zfs receive -Fdvu dozer

# zfs snapshot -r tank@02 
# zfs send -R -i tank@01 tank@02 | zfs receive -dvu dozer

# zfs set readonly=on tank
# zpool export tank
# zpool export dozer
# zpool import tank digger
# zpool import dozer tank

 

Note: unmounting a ZFS filesystem can assist in freeing space (if some process is holding onto a handle with those resources).

Links

Appendices

Destroy snapshots

Recursively destroy (delete) snapshots:

# zfs destroy -r tank@01

List Snapshots

# zfs list -t snapshot

Mount/Unmount

# zfs mount tank
# zfs umount tank

Set mount point

# zfs set mountpoint=/mnt/tank tank

Quota exceeded

If the destination was present then destroy it before performing the first sync.

# zfs send -R tank/ds-mirror@01 | zfs receive -Fdvu dozer

receiving full stream of tank/ds-mirror@01 into dozer/ds-mirror@01 cannot receive new filesystem stream: destination dozer/ds-mirror space quota exceeded warning: cannot send 'tank/ds-mirror@01': Broken pipe

Document Actions