Page 1 of 1

Solved: How to backup ZFS pools with Time Machine

PostPosted: Tue Apr 14, 2020 8:01 am
by Fnuxus
After some research there seems to be consensus that backups of ZFS media with Time Machine do not work.

Apparently I found a solution to this problem.

N. B. This is not about using ZFS as a Time Machine target volume! (See https://openzfsonosx.org/wiki/Time_Machine_Backups for using ZFS as backup target.)

This is about backing up ZFS volumes with Time Machine!

Here is how it works:

Either create a ZFS pool and turn on HFS mimic

Code: Select all
sudo zfs set com.apple.mimic_hfs=on myPool


or create a ZFS pool with a HFS+ or APFS zvol on top:

https://openzfsonosx.org/wiki/Time_Mach ... kups#zvols

Open Terminal.app and do this:

1. First we check for demonstration purposes if the volume is currently backed up:

Code: Select all
tmutil isexcluded /Volumes/myPool
[Excluded]    /Volumes/myPool


2. Now we use tmutil to include the pool:

Code: Select all
sudo tmutil removeexclusion -v /Volumes/Zetes
Password:


N. B.: This does not change the appearance in the Time Machine control panel – it is still greyed out.

3. Now we check the backup status again:

Code: Select all
isexcluded /Volumes/Zetes
[Included]    /Volumes/Zetes


Voilà!

Backing up and restoring a 2 GB iPhoto .photolibrary to and from Time Machine worked with HFS mimic and an APFS volume flawlessly.

I didn’t test a HFS+ zvol on top of HFS, but I assume it works as well.

Re: Solved: How to backup ZFS pools with Time Machine

PostPosted: Mon Jun 01, 2020 3:53 am
by TooDizzy
Very nice! Will need to try this!