<?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=188.136.90.201</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=188.136.90.201"/>
		<link rel="alternate" type="text/html" href="https://openzfsonosx.org/wiki/Special:Contributions/188.136.90.201"/>
		<updated>2026-05-09T21:53:38Z</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>2023-10-13T12:06:27Z</updated>
		
		<summary type="html">&lt;p&gt;188.136.90.201: Tested Time machine on ZFS raidz1/cache successfully.&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;
Does not work under Ventura.&lt;br /&gt;
&lt;br /&gt;
=== zvols ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tested successfully under Ventura using raidz1 with cache disk (all disks on USB). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Create a zvol to use for Time Machine backups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Get OSX disk number corresponding to the zvol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Format the zvol as a HFS+, using its disk number from the previous step:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For newer systems (Big Sur), because Time Machine now prefers apfs (see&lt;br /&gt;
https://support.apple.com/en-au/guide/mac-help/mh15139/mac), the following&lt;br /&gt;
commands should create a apfs zvol that Time Machine can use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo diskutil eraseDisk JHFS+ [OSX Disk Name] GPT [disk number]&lt;br /&gt;
sudo diskutil apfs create [disk number]s[slice number] [OSX Disk Name]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, if the zvol was disk5 in OSX, and the HFS+ volume on that zvol&lt;br /&gt;
was on slice 1 (which can be confirmed using '&amp;lt;code&amp;gt;diskutil list disk5&amp;lt;/code&amp;gt;')&lt;br /&gt;
the following should format that disk as a apfs disk named &amp;quot;TimeMachine&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo diskutil eraseDisk JHFS+ &amp;quot;TimeMachine&amp;quot; GPT disk5&lt;br /&gt;
sudo diskutil apfs create disk5s1 &amp;quot;TimeMachine&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Set the zvol as a Time Machine destination:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, if the zvol was formatted as HFS+ named &amp;quot;TimeMachine&amp;quot; in&lt;br /&gt;
the previous steps, the following will set it as a Time Machine destination:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;(Optional) Enable encryption for Time Machine backups on the zvol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;For HFS+ formatted zvols, the following procedure should work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Get the disk identifier for the HFS+ disk on the zvol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Convert the HFS+ disk to use encryption:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;For apfs formatted zvols, the following procedure should work (based on&lt;br /&gt;
comments in the forums, see https://openzfsonosx.org/forum/viewtopic.php?f=26&amp;amp;t=3612):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo diskutil apfs encryptvolume [Disk ID] -user disk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&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 zvol was formatted as apfs named &amp;quot;TimeMachine&amp;quot; in a prior&lt;br /&gt;
step, whose disk identifier was returned as disk5s1, the following will convert the disk to use encryption:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo diskutil apfs encryptvolume disk5s1 -user disk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Based on the forums (see https://openzfsonosx.org/forum/viewtopic.php?f=26&amp;amp;t=3612), it is possible to &amp;quot;bless&amp;quot; the Time Machine&lt;br /&gt;
zvol by &amp;quot;open /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericTimeMachineDiskIcon.icns&amp;quot;, select the first icon in the resulting window, copying (⌘-C) the icon, then Get Info (⌘-I) on the Time Machine disk icon, and pasting (⌘-V) the copied image to the Time Machine disk to &amp;quot;bless&amp;quot; it as a Time Machine disk. For some reason, Time Machine won't do that by itself, as it does with normal external volumes when it first starts using them for Time Machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&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>188.136.90.201</name></author>	</entry>

	<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>2023-10-13T12:05:22Z</updated>
		
		<summary type="html">&lt;p&gt;188.136.90.201: /* zvols */&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;
Does not work under Ventura.&lt;br /&gt;
&lt;br /&gt;
=== zvols ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tested successfully under Ventura using raidz1 with cache disk (all disks on USB). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Create a zvol to use for Time Machine backups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Get OSX disk number corresponding to the zvol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Format the zvol as a HFS+, using its disk number from the previous step:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For newer systems (Big Sur), because Time Machine now prefers apfs (see&lt;br /&gt;
https://support.apple.com/en-au/guide/mac-help/mh15139/mac), the following&lt;br /&gt;
commands should create a apfs zvol that Time Machine can use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo diskutil eraseDisk JHFS+ [OSX Disk Name] GPT [disk number]&lt;br /&gt;
sudo diskutil apfs create [disk number]s[slice number] [OSX Disk Name]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, if the zvol was disk5 in OSX, and the HFS+ volume on that zvol&lt;br /&gt;
was on slice 1 (which can be confirmed using '&amp;lt;code&amp;gt;diskutil list disk5&amp;lt;/code&amp;gt;')&lt;br /&gt;
the following should format that disk as a apfs disk named &amp;quot;TimeMachine&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo diskutil eraseDisk JHFS+ &amp;quot;TimeMachine&amp;quot; GPT disk5&lt;br /&gt;
sudo diskutil apfs create disk5s1 &amp;quot;TimeMachine&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Set the zvol as a Time Machine destination:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, if the zvol was formatted as HFS+ named &amp;quot;TimeMachine&amp;quot; in&lt;br /&gt;
the previous steps, the following will set it as a Time Machine destination:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;(Optional) Enable encryption for Time Machine backups on the zvol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;For HFS+ formatted zvols, the following procedure should work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Get the disk identifier for the HFS+ disk on the zvol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Convert the HFS+ disk to use encryption:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;For apfs formatted zvols, the following procedure should work (based on&lt;br /&gt;
comments in the forums, see https://openzfsonosx.org/forum/viewtopic.php?f=26&amp;amp;t=3612):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo diskutil apfs encryptvolume [Disk ID] -user disk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&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 zvol was formatted as apfs named &amp;quot;TimeMachine&amp;quot; in a prior&lt;br /&gt;
step, whose disk identifier was returned as disk5s1, the following will convert the disk to use encryption:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo diskutil apfs encryptvolume disk5s1 -user disk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Based on the forums (see https://openzfsonosx.org/forum/viewtopic.php?f=26&amp;amp;t=3612), it is possible to &amp;quot;bless&amp;quot; the Time Machine&lt;br /&gt;
zvol by &amp;quot;open /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericTimeMachineDiskIcon.icns&amp;quot;, select the first icon in the resulting window, copying (⌘-C) the icon, then Get Info (⌘-I) on the Time Machine disk icon, and pasting (⌘-V) the copied image to the Time Machine disk to &amp;quot;bless&amp;quot; it as a Time Machine disk. For some reason, Time Machine won't do that by itself, as it does with normal external volumes when it first starts using them for Time Machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&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>188.136.90.201</name></author>	</entry>

	<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>2023-10-08T16:53:25Z</updated>
		
		<summary type="html">&lt;p&gt;188.136.90.201: Does not work under Ventura&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;
Does not work under Ventura.&lt;br /&gt;
&lt;br /&gt;
=== zvols ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Does not work under Ventura.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Create a zvol to use for Time Machine backups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Get OSX disk number corresponding to the zvol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Format the zvol as a HFS+, using its disk number from the previous step:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For newer systems (Big Sur), because Time Machine now prefers apfs (see&lt;br /&gt;
https://support.apple.com/en-au/guide/mac-help/mh15139/mac), the following&lt;br /&gt;
commands should create a apfs zvol that Time Machine can use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo diskutil eraseDisk JHFS+ [OSX Disk Name] GPT [disk number]&lt;br /&gt;
sudo diskutil apfs create [disk number]s[slice number] [OSX Disk Name]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, if the zvol was disk5 in OSX, and the HFS+ volume on that zvol&lt;br /&gt;
was on slice 1 (which can be confirmed using '&amp;lt;code&amp;gt;diskutil list disk5&amp;lt;/code&amp;gt;')&lt;br /&gt;
the following should format that disk as a apfs disk named &amp;quot;TimeMachine&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo diskutil eraseDisk JHFS+ &amp;quot;TimeMachine&amp;quot; GPT disk5&lt;br /&gt;
sudo diskutil apfs create disk5s1 &amp;quot;TimeMachine&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Set the zvol as a Time Machine destination:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, if the zvol was formatted as HFS+ named &amp;quot;TimeMachine&amp;quot; in&lt;br /&gt;
the previous steps, the following will set it as a Time Machine destination:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;(Optional) Enable encryption for Time Machine backups on the zvol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;For HFS+ formatted zvols, the following procedure should work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Get the disk identifier for the HFS+ disk on the zvol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Convert the HFS+ disk to use encryption:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;For apfs formatted zvols, the following procedure should work (based on&lt;br /&gt;
comments in the forums, see https://openzfsonosx.org/forum/viewtopic.php?f=26&amp;amp;t=3612):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo diskutil apfs encryptvolume [Disk ID] -user disk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&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 zvol was formatted as apfs named &amp;quot;TimeMachine&amp;quot; in a prior&lt;br /&gt;
step, whose disk identifier was returned as disk5s1, the following will convert the disk to use encryption:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo diskutil apfs encryptvolume disk5s1 -user disk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Based on the forums (see https://openzfsonosx.org/forum/viewtopic.php?f=26&amp;amp;t=3612), it is possible to &amp;quot;bless&amp;quot; the Time Machine&lt;br /&gt;
zvol by &amp;quot;open /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericTimeMachineDiskIcon.icns&amp;quot;, select the first icon in the resulting window, copying (⌘-C) the icon, then Get Info (⌘-I) on the Time Machine disk icon, and pasting (⌘-V) the copied image to the Time Machine disk to &amp;quot;bless&amp;quot; it as a Time Machine disk. For some reason, Time Machine won't do that by itself, as it does with normal external volumes when it first starts using them for Time Machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&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>188.136.90.201</name></author>	</entry>

	<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>2023-10-08T16:52:41Z</updated>
		
		<summary type="html">&lt;p&gt;188.136.90.201: /* Sparsebundles */&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;
Does not work under Ventura.&lt;br /&gt;
&lt;br /&gt;
=== zvols ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Create a zvol to use for Time Machine backups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Get OSX disk number corresponding to the zvol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Format the zvol as a HFS+, using its disk number from the previous step:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For newer systems (Big Sur), because Time Machine now prefers apfs (see&lt;br /&gt;
https://support.apple.com/en-au/guide/mac-help/mh15139/mac), the following&lt;br /&gt;
commands should create a apfs zvol that Time Machine can use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo diskutil eraseDisk JHFS+ [OSX Disk Name] GPT [disk number]&lt;br /&gt;
sudo diskutil apfs create [disk number]s[slice number] [OSX Disk Name]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, if the zvol was disk5 in OSX, and the HFS+ volume on that zvol&lt;br /&gt;
was on slice 1 (which can be confirmed using '&amp;lt;code&amp;gt;diskutil list disk5&amp;lt;/code&amp;gt;')&lt;br /&gt;
the following should format that disk as a apfs disk named &amp;quot;TimeMachine&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo diskutil eraseDisk JHFS+ &amp;quot;TimeMachine&amp;quot; GPT disk5&lt;br /&gt;
sudo diskutil apfs create disk5s1 &amp;quot;TimeMachine&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Set the zvol as a Time Machine destination:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, if the zvol was formatted as HFS+ named &amp;quot;TimeMachine&amp;quot; in&lt;br /&gt;
the previous steps, the following will set it as a Time Machine destination:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;(Optional) Enable encryption for Time Machine backups on the zvol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;For HFS+ formatted zvols, the following procedure should work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Get the disk identifier for the HFS+ disk on the zvol:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Convert the HFS+ disk to use encryption:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&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;blockquote&amp;gt;&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;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;For apfs formatted zvols, the following procedure should work (based on&lt;br /&gt;
comments in the forums, see https://openzfsonosx.org/forum/viewtopic.php?f=26&amp;amp;t=3612):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo diskutil apfs encryptvolume [Disk ID] -user disk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&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 zvol was formatted as apfs named &amp;quot;TimeMachine&amp;quot; in a prior&lt;br /&gt;
step, whose disk identifier was returned as disk5s1, the following will convert the disk to use encryption:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo diskutil apfs encryptvolume disk5s1 -user disk&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Based on the forums (see https://openzfsonosx.org/forum/viewtopic.php?f=26&amp;amp;t=3612), it is possible to &amp;quot;bless&amp;quot; the Time Machine&lt;br /&gt;
zvol by &amp;quot;open /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericTimeMachineDiskIcon.icns&amp;quot;, select the first icon in the resulting window, copying (⌘-C) the icon, then Get Info (⌘-I) on the Time Machine disk icon, and pasting (⌘-V) the copied image to the Time Machine disk to &amp;quot;bless&amp;quot; it as a Time Machine disk. For some reason, Time Machine won't do that by itself, as it does with normal external volumes when it first starts using them for Time Machine.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&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>188.136.90.201</name></author>	</entry>

	</feed>