ZFS Backup: Difference between revisions

From wiki
Jump to navigation Jump to search
imported>Jacob
imported>Jacob
Line 37: Line 37:


Create the mount points for the host root datasets first
Create the mount points for the host root datasets first
># mkdir -p /var/zfsbackup/{bigboy,fire,jacup}/zroot
># mkdir -p /var/zfsbackup/{aap,noot,mies}/zroot
The create  
The create  
Then create the datasets for the hosts.
Then create the datasets for the hosts.
># zfs create -o mountpoint=/var/zfsbackup/bigboy zbackup/var/zfsbackup/bigboy
># zfs create -o mountpoint=/var/zfsbackup/aap zbackup/var/zfsbackup/aap
># zfs create -o mountpoint=/var/zfsbackup/fire zbackup/var/zfsbackup/fire
># zfs create -o mountpoint=/var/zfsbackup/noot zbackup/var/zfsbackup/noot
># zfs create -o mountpoint=/var/zfsbackup/firebox zbackup/var/zfsbackup/firebox
># zfs create -o mountpoint=/var/zfsbackup/mies zbackup/var/zfsbackup/mies
># zfs create -o mountpoint=/var/zfsbackup/poud zbackup/var/zfsbackup/poud
 
># zfs create -o mountpoint=/var/zfsbackup/jacup zbackup/var/zfsbackup/jacup


For firebox on jacup the sequence would be
For firebox on jacup the sequence would be

Revision as of 15:06, 6 March 2020


Previous Poudriere setup Next Firewall Switch


ZFS Backup Synopsis

We are going to use ZFS to backup disk. We could use ZFS send and ZFS receive to write the dataset snapshot to the backup server disks. This will however cause problems with mount points for backups of the root file system. We therefore use ZFS send to a file for backups of root file systems. We also ensure that those ZFS pools which contain data are named unique within the landscape., i.e. zdata for the file-server data pool and zbackup for the backup server data pool. Backups are send of the LAN using nc (netcat). We are not using compression as we have a fast 10gig LAN and LZ4 compression is used on all disks.

There are 4 general steps as listed below: 1 Prerequisites

Prerequisites

There are different requirements for backup storage using storage to file or storage to disk. For file we just need a files system, for disk we need a unique dataset.

To file.

ZFS backups to file will be stored in a directory per server. On the dataset "zbackup/var/zfsbackup".

># mkdir -p /var/zfsbackup/{server1,server2,...,serverN}

To disk.

If the dataset exists and needs to be deleted first use: ># zfs destroy zbackup/var/zfsbackup/[hostname]

Make sure there is a dataset on the backup server for each server. That will be the destination for the streamed backups. ># zfs create -o mountpoint=/var/zfsbackup/[hostname] zbackup/var/zfsbackup/[hostname] Then create a dataset for each data set to be received ># zfs create -o mountpoint=/var/zfsbackup/[hostname][dataset] zbackup/var/zfsbackup/[hostname][dataset]

For jacup that will be: ># zfs destroy -r zbackup/var/zfsbackup/firedoor

Create the mount points for the host root datasets first ># mkdir -p /var/zfsbackup/{aap,noot,mies}/zroot The create Then create the datasets for the hosts.

># zfs create -o mountpoint=/var/zfsbackup/aap zbackup/var/zfsbackup/aap
># zfs create -o mountpoint=/var/zfsbackup/noot zbackup/var/zfsbackup/noot
># zfs create -o mountpoint=/var/zfsbackup/mies zbackup/var/zfsbackup/mies


For firebox on jacup the sequence would be ># zfs destroy -r zbackup/var/zfsbackup/firebox@zfirebox2001101319 ># zfs destroy -r zbackup/var/zfsbackup/firebox ># zfs create -o mountpoint=/var/zfsbackup/firebox zbackup/var/zfsbackup/firebox

Create snapshot

It is best to remove older snapshots when a full backup is made, use:

># for f in `zfs list -H -rt snapshot [zroot name] | cut -f 1`; do zfs destroy -nvf $f; done

Then create the snapshot with the date and time as part of the name. Format used is:

># zfs snapshot -r [zroot name]@[host name]YYMMDDhhmm

Set backup server to Receive snapshot.

to disk.

to file.

Send snapshot to backup-server.

Test send snapshot to google drive.

Send / Receive backup server zroot backup.