ZFS What is the purpose of daily ZFS backups?

D

Deleted member 76849

Guest
In /etc/defaults/periodic.conf, there's this part about daily ZFS backups:

Code:
# 223.backup-zfs
daily_backup_zfs_enable="NO"                            # Backup output from zpool/zfs list
daily_backup_zfs_props_enable="NO"                      # Backup zpool/zfs filesystem properties
daily_backup_zfs_get_flags="all"                        # flags passed to `zfs get`
daily_backup_zfs_list_flags=""                          # flags passed to `zfs list`
daily_backup_zpool_get_flags="all"                      # flags passed to `zpool get`
daily_backup_zpool_list_flags="-v"                      # flags passed to `zpool list`
daily_backup_zfs_verbose="NO"                           # Report diff between the old and new backups.

What is the purpose of the backups? Is it imporatnt to "Backup output from zpool/zfs list" and "Backup zpool/zfs filesystem properties" daily if I am using ZFS?

FreeBSD version : 13.2-RELEASE.
 
What is the purpose of the backups? Is it imporatnt to "Backup output from zpool/zfs list" and "Backup zpool/zfs filesystem properties" daily if I am using ZFS?

Usually yes.

Let's imagine you loose your disk(s). Then, hopefully, you have some kind of backup of your files.

What is usually not contained in the files backup, is the partitioning info of the disks. So you would have to recreate these on best effort.
That's quite annoying and often not easy, therefore the partitioning info is written to /var/backups/gpart.* each day. So you can just fetch these from the files backup, and recreate the disk partitioning accordingly.

What is also not usually contained in a files backup is the layout of the zfs pools and the options on the zfs filesets. Same problem.
So these features you're looking at, they do write that data into /var/backups/zpool_* and /var/backups/zfs_*

Obviousely, in themselves these features are useless, because they write the backups onto the regular disk, and if that disk breaks, the backups are also gone.
It needs to integrate in your normal contingency plan: what do you intend to do when the disks are gone? If you have a backup of your files, be it a simple tar archive or an elaborate backup system, switch these features on and make sure that /var/backups/* is included in that backup.
 
What is usually not contained in the files backup, is the partitioning info of the disks.
That's taken care of by 221.backup-gpart in the daily periodic.

Enabled by default for anything non-jailed:
Code:
# 221.backup-gpart
if [ $(sysctl -n security.jail.jailed) = 0 ]; then
        # Backup partition table/boot partition/MBR
        daily_backup_gpart_enable="YES"
else
        daily_backup_gpart_enable="NO"
fi
 
Back
Top