I am hoping that there is a ZFS guru here that can give me some guidance.
I have a pool (let’s call it TANK) with a number of datasets (lets call them DS1, DS2, … DS9). The pool TANK contains no files, just the datasets.
I want to backup DS1, DS3, DS7 to a removable pool called BACKUP (The other DSs are expendable and don’t need to be backed up).
Since I am only backing up a few of the datasets, I can’t (and don’t want to) do a recursive replication. I only want to do a zfs send of TANK/DS1, TANK/DS3 and TANK/DS7 to BACKUP1.
Assuming that TANK is destroyed, do I need a backup of TANK to be able to restore my backups of DS1, DS3 and DS7?
Or can I just recreate TANK as an empty pool and zfs send BACKUP1/DS1 to TANK/DS1, BACKUP1/DS3 to TANK/DS3, and BACKUP1/DS7 to TANK/DS7?
You could create a replication task for each dataset (DS1, DS3, DS7) and back them up individually. The path i.e. TANK/DS1 is kind of irrelevant. On your backup system (lets call it DOZER ) You could just send TANK/DS1 to DOZER and then add the /DS1 into the path at replication creation. This will then auto create the DS1 dataset on the backup system and for the others just rinse and repeat.
For recovery even if you had a different pool called NEWTANK you could just send or restore this data to NEWTANK/DS1.
@Johnny_Fartpants@Stux (Not sure how to reply to more than 1 person on this new forum - hope this is right)
Thanks very much for the reply - so just for clarity each dataset can be backed up separately and restored to any dataset.
Follow up question:
I have been doing this with a script. The script takes a snapshot, then does the zfs send to a removable drive which is a single disk dataset. The next time I need to do a backup the script automatically takes another snapshot and does a zfs send to append from the last snapshot to the new snapshot.
I never looked, but I assume that there is no way of doing this with the WebUI?
The GUI’s replication task functionality allows multiple datasets to be replicated, and then they can be individually restored at a later date (if somewhat manually)
FYI: I have been using my backup script for about 10 years, and luck for me I have never needed to do a restore. I am going to have to do a partial rewrite when I move from FreeBSD to Linux, so I thought I should dig a bit deeper.
I initialize the backup drive by creating a pool with the gui on a removable drive which gets mounted on /dev/ada4 - a one disk pool. The script takes a snapshot with a name the script recognizes of the dataset to be backed up and then does a zfs send of that dataset to the removable pool. Rince and repeat for all datasets to be backed up on that drive, and then unmount/eject to removable pool.
Next time I want to run a backup, I mount the disk and run the script. It mounts the removable pool, uses the names of datasets on that pool to identify the datasets to be backed up. Each dataset gets another snapshot, and then a differential zfs send is sent last-snapshot to current-snapshot. Which yields very efficient backupsl