zfs replication with ssh

1. create pool on source and on destination

on source:
# zpool create sourcepool disk1

on destination:
# zpool create destpool disk1

2. create filesystem on source
# zfs create sourcepool/fs1

3. zfs snapshot sourcepool/fs1@recent
# zfs send sourcepool/fs1@recent | ssh destination zfs receive destpool/fs1@recent

4. rename recent snapshot to on source and destination
on source:
# zfs rename sourcepool/fs1@recent sourcepool/fs1@old
# zfs snapshot sourcepool/fs1@recent
on destnation:
# zfs rename destpool/fs1@recent destpool/fs1@old

5. send incremental snapshot
on source:
# zfs send -i sourcepool/fs1@old sourcepool/fs1@recent | ssh destination receive destpool/fs1@recent

6. to repeat
on source:
# zfs destroy sourcepool/fs1@old
# zfs rename sourcepool/fs1@recent sourcepool/fs1@old
# zfs snapshot sourcepool/fs1@recent

on destination:
# zfs destroy destpool/fs1@old
# zfs rename destpool/fs1@recent destpool/fs1@recent
# zfs snapshot destpool/fs1@recent

# zfs send -i sourcepool/fs1@old sourcepool/fs1@recent | ssh destination zfs receive \
destpool/fs1@recent

This entry was posted in solaris. Bookmark the permalink.

Comments are closed.