Notes on backing up FreeNAS11 running ZFS.
My notes are roughly based on this.
For ZFS newbs, like me, it's important to recognize that FreeNAS chose to rename certain ZFS artifacts with a nomenclature unique to FreeNAS. On FreeNAS, A ZFS pool is the same thing as a ZFS volume.
All of my data is stored in
tank2, which is a mirror of two 8TB drives. I
have two spare 8TB drives that I wish to use for backups; their serial numbers are
Create a new volume
Make a snapshot of what we wish to backup:
$ zfs snapshot -r tank2@backup
Send the snapshot to the backup drive:
$ zfs send -R tank2@backup | zfs receive -vF tank3backup
When the snapshot is done, export the drive:
$ zfs export tank3backup
Remove the drive and store it off-site.
The subsequent backup can be either to the next spare disk or to the same disk. If the same disk, the steps would be:
# Insert the drive, and mount $ zpool -a # Rename the previous snapshot $ zfs rename -r tank2@backup tank2@previous_backup # Take a new snapshot $ zfs snapshot -r tank2@backup # Send incremental backup to backup disk $ zfs send -Ri tank2@previous_backup tank2@backup | zfs receive -v tank3backup # Remove previous snapshot $ zfs destroy -r tank2@previous_backup # Remove the drive for storage $ zpool export tank3backup
# Insert the drive, and mount $ zpool -a # Restore from backup $ zfs send -R tank3backup@backup | zfs receive -vF tank2_NEW