Skip to main content

FreeNAS Backup to Disk

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 7SGPKE6C and 7SGZTRTC.

Create a new volume tank3backup on 7SGPKE6C.

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

Error recovery:

# Insert the drive, and mount
$ zpool -a

# Restore from backup
$ zfs send -R tank3backup@backup | zfs receive -vF tank2_NEW