Syncing data (zfs send/receive, rsync) with EON ZFS Storage

Syncing data using zfs send/receive

These steps can be used to backup or sync data between

- Mac OSX <-> EON ZFS Storage

- Win X (cwrsync) <-> EON ZFS Storage

- EON ZFS Storage <-> other ZFS storage systems

There are a few caveat(s) to consider:

- system(s) receiving snapshot(s) must be running a equal or higher version of ZFS than the sender
- must have root or appropriate role access to re-create ZFS filesystem(s)/properties on the receiver

Here's some information on what the command switches used mean. Here's a link to the full manual pages http://docs.oracle.com/cd/E19082-01/819-2240/zfs-1m/index.html

-R Generates a replication stream package, which will replicate the specified filesystem, and all descendent file systems, up to the named snapshot. When received, all properties, snapshots, descendent file systems, and clones are preserved.
-F Force a rollback of the file system to the most recent snapshot before performing the receive operation. If receiving an incremental replication stream (for example, one generated by zfs send -R -[iI]), destroy snapshots and file systems that do not exist on the sending side.
-i snapshot Generate an incremental stream from the first snapshot to the second snapshot. The incremental source (the first snapshot) can be specified as the last component of the snapshot name (for example, the part after the @), and it is assumed to be from the same file system as the second snapshot. If the destination is a clone, the source may be the origin snapshot, which must be fully specified (for example, pool/fs@origin, not just @origin).
-d Use all but the first element of the sent snapshot path (all but the pool name) to determine the name of the new snapshot as described in the paragraph above.
-u File system that is associated with the received stream is not mounted.
-n Do not actually receive the stream. This can be useful in conjunction with the -v option to verify the name the receive operation would use.
-v Print verbose information about the stream package generated.

ZFS send/receive between local pools. Sending from src_pool to dst_pool ( send switches [ -Rv -i snapshot ], receive switches [ -Fundv ] )

zfs send -Rv src_pool/filesystem@snapshot_name | zfs receive -Fv dst_pool/new_or_same_filesystem
zfs send -Rv abyss/share@012213-130155 | zfs receive -Fv poolx/abyss

Alternate method, of the same above

zfs send -Rv src_pool/filesystem@snapshot_name | mbuffer -s 128k -m 1G -o - | zfs receive -Fv dst_pool/new_or_same_filesystem

ZFS send/receive across the network using ssh.

zfs send -Rv src_pool/filesystem@snapshot_name | ssh root@remote_eon_box "zfs receive -Fv new_pool/new_or_same_filesystem"

ZFS send/receive across the network using mbuffer. On the receiving machine (port used in this example -I 9191)

mbuffer -s 128k -m 1G -I 9191 | zfs receive dst_pool/filesystem

On the sending machine

zfs send -i src_pool/filesystem@snapshot_name src_pool/filesystem@snapshot_name2 | mbuffer -s 128k -m 1G -O receiver_machine:9191

mbuffer can be combined with ssh if encryption is required

zfs send src_pool/filesystem@snapshot | mbuffer -s 128k -m 1G 2>/dev/null | ssh -c arcfour128 receiver_machine “mbuffer -q -s 128k -m 1G 2>/dev/null | zfs receive -Fv dst_pool/filesystem”

ZFS send/receive across the network using netcat. On The receiving machine (port chosen/used in this example -p 9191)

nc -w 30 -l -p 9191 | zfs -Fv receive src_pool/zfs_name

On the sending machine

zfs send src_pool/zfs_name@snapshot_name | nc receiver_machine 9191

Syncing using rsync. Manual pages http://rsync.samba.org/ftp/rsync/rsync.html configuration http://rsync.samba.org/ftp/rsync/rsyncd.conf.html

Local/connected EON rsync. ( n = dry run, remove n switch to acutally perform sync )

rsync -avzlHrn --modify-window=1 --delete --delete-excluded --exclude=".DS_Store" "src_path" "dst_path"

Mac OSX, Windows (CWRsync) to EON ( n = dry run, remove n switch to acutally perform sync )

rsync -tvzlHrn --modify-window=1 --delete --delete-excluded --exclude=".DS_Store" "src_path" "dst_path"

Remote rsync to EON

rsync -avzlHrn --modify-window=1 --delete --delete-excluded --exclude=".DS_Store" "/src_path" userl@receiver:/dst_path/

Legend:

src_pool - source zpool name

dst_pool - destination zpool name

receiver_machine - hostname or IP of the receiving machine

filesystem - zfs filesystem name

snapshot_name - name of the snapshot

solid . storeable . superb

EON, Storage for Life.