<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://openzfsonosx.org/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://openzfsonosx.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gcsventures</id>
		<title>OpenZFS on OS X - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://openzfsonosx.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gcsventures"/>
		<link rel="alternate" type="text/html" href="https://openzfsonosx.org/wiki/Special:Contributions/Gcsventures"/>
		<updated>2026-04-19T17:53:28Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.22.3</generator>

	<entry>
		<id>https://openzfsonosx.org/wiki/Time_Machine_Backups</id>
		<title>Time Machine Backups</title>
		<link rel="alternate" type="text/html" href="https://openzfsonosx.org/wiki/Time_Machine_Backups"/>
				<updated>2020-01-15T17:52:22Z</updated>
		
		<summary type="html">&lt;p&gt;Gcsventures: Add the option to backup via network shares set up with the com.apple.devdisk and com.apple.mimic_hfs properties.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Backup to Local Disk ==&lt;br /&gt;
There are two approaches to using ZFS for Time Machine Backups - Sparsebundles on a ZFS data set and zvols formatted as HFS+.&lt;br /&gt;
&lt;br /&gt;
=== Sparsebundles ===&lt;br /&gt;
Here's one approach to using ZFS for your Time Machine Backups.  &lt;br /&gt;
&lt;br /&gt;
Because Time Machine doesn't recognize ZFS datasets as a compatible disk for Time Machine backups, as a work around, we create an HFS+ sparsebundle disk image, store it on a ZFS dataset, and set the mounted image as a backup destination (no &amp;quot;TMShowUnsupportedNetworkVolumes&amp;quot; needed).&lt;br /&gt;
&lt;br /&gt;
1. Create, and mount, a sparsebundle from a ZFS dataset (e.g., with makeImage.sh or Disk Utility.app).&lt;br /&gt;
&lt;br /&gt;
2. Set the sparsebundle as the (active) backup destination: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# tmutil setdestination -a /Volumes/[sparse bundle volume name]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While it has been discussed in heated arguments (e.g., https://github.com/openzfsonosx/zfs/issues/66) I still believe there's at least one ZFS feature I'd like to test with Time Machine: compression.&lt;br /&gt;
&lt;br /&gt;
The hypothesis being that an HFS+ sparsebundle stored on a compressed (gzip, lz4), deduped dataset should&lt;br /&gt;
yield a compression ratio &amp;gt; 1.0 (previously observed 1.4 with compression=on, dedup=off, FreeBSD network Time Machine drives).&lt;br /&gt;
&lt;br /&gt;
=== zvols ===&lt;br /&gt;
&lt;br /&gt;
1. Create a zvol to use for Time Machine backups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo zfs create -V [size] [pool]/[volume]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, the following will create a 1TB volume named tmdisk1 on a zpool named Backup:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo zfs create -V 1T Backup/tmdisk1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Get OSX disk number corresponding to the zvol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ioreg -trn &amp;quot;ZVOL [pool]/[volume] Media&amp;quot; | awk -F'&amp;quot;' '/BSD Name/ {print $4;}'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, if a zvol named tmdisk1 was created as shown above, the following will get its disk number and store it in the shell variable DISKID:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ioreg -trn 'ZVOL Backup/tmdisk1 Media' | awk -F'&amp;quot;' '/BSD Name/ {print $4;}'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Format the zvol as a HFS+, using its disk number from step 2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo diskutil eraseDisk JHFS+ [OSX Disk Name] [disk number]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, if the zvol was disk5 in OSX, the following will format that disk as a HFS+ disk named &amp;quot;TimeMachine&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo diskutil eraseDisk JHFS+ &amp;quot;TimeMachine&amp;quot; disk5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Set the zvol as a Time Machine destination:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo tmutil setdestination -a /Volumes/[OSX Disk Name]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, if the zvol was formatted as HFS+ named &amp;quot;TimeMachine&amp;quot; in step 3, the following will set it as a Time Machine destination:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo tmutil setdestination -a /Volumes/TimeMachine&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. (Optional) Enable encryption for Time Machine backups on the zvol:&lt;br /&gt;
&lt;br /&gt;
5.1 Get the disk identifier for the HFS+ disk on the zvol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;diskutil list [OSX Disk Name] | awk '/[OSX Disk Name]/ { print $NF;}'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, if the zvol was formatted as HFS+ named &amp;quot;TimeMachine&amp;quot; in step 3, the following will get its disk identifier:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;diskutil list TimeMachine | awk '/TimeMachine/ { print $NF; }'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5.2 Convert the HFS+ disk to use encryption:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo diskutil coreStorage convert [Disk ID] -passphrase&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will ask for the encryption password (which may be stored in the Keychain).  For example, if the if the zvol was formatted as HFS+ named &amp;quot;TimeMachine&amp;quot; in step 3, whose disk identifier was returned as disk5s2 in step 5.1, the following will convert the disk to use encryption:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo diskutil coreStorage convert disk5s2 -passphrase&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note, this process can take a considerable amount of time (several hours for a 1TB volume).  You can check on the progress of the encryption using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;diskutil cs list | grep -e &amp;quot;Conversion&amp;quot; -e &amp;quot;Volume Name&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Backup to Network Share ==&lt;br /&gt;
&lt;br /&gt;
Time Machine can backup over the network to either HFS+ or APFS target volumes, shared via SMB.  If you try to do this with a ZFS target volume, the client gets an error saying &amp;quot;The selected network backup disk does not support the required capabilities.&amp;quot;  &lt;br /&gt;
&lt;br /&gt;
You have two options from this point on:&lt;br /&gt;
# You can create an HFS+ or APFS target volume on your zpool.  There are two ways to do that, explained in the section above about local backups: create the volume as a sparse bundle, or as a zvol.  &lt;br /&gt;
# You can set the properties &amp;lt;code&amp;gt;com.apple.devdisk&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;com.apple.mimic_hfs&amp;lt;/code&amp;gt; to 'on' on the dataset you wish to put your backups onto, through the &amp;lt;code&amp;gt;zfs set&amp;lt;/code&amp;gt; command. (note that if you do this through an already mounted dataset, you may have to unmount it and re-mount it again after issuing the &amp;lt;code&amp;gt;zfs set&amp;lt;/code&amp;gt; commands)&lt;br /&gt;
&lt;br /&gt;
You don't need the steps that set the volume as a time machine destination on the server; it's just going to be shared over the network.  When you share the volume on the network, follow the instructions at https://support.apple.com/guide/mac-help/a-shared-folder-time-machine-mac-mchl31533145/mac to make it available as a TimeMachine volume.&lt;/div&gt;</summary>
		<author><name>Gcsventures</name></author>	</entry>

	</feed>