<?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=77.186.150.26</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=77.186.150.26"/>
		<link rel="alternate" type="text/html" href="https://openzfsonosx.org/wiki/Special:Contributions/77.186.150.26"/>
		<updated>2026-05-09T20:06:27Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.22.3</generator>

	<entry>
		<id>https://openzfsonosx.org/wiki/Encryption</id>
		<title>Encryption</title>
		<link rel="alternate" type="text/html" href="https://openzfsonosx.org/wiki/Encryption"/>
				<updated>2014-08-13T01:04:31Z</updated>
		
		<summary type="html">&lt;p&gt;77.186.150.26: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Core Storage (File Vault 2) ==&lt;br /&gt;
&lt;br /&gt;
Although the upstream OpenZFS project lists [http://open-zfs.org/wiki/Projects#Platform_agnostic_encryption_support platform-agnostic encryption support] at the ZFS dataset level as a possible future enhancement, OS X already offers a feature called [http://support.apple.com/kb/ht4790 FileVault 2], which provides built-in support for XTS-AES 128 encryption at the block level as part of Core Storage volume management.&lt;br /&gt;
&lt;br /&gt;
This is the OS X analogue of the following block-level encryption systems on other operating systems that support ZFS: &lt;br /&gt;
* FreeBSD: geli&lt;br /&gt;
* Linux: LUKS&lt;br /&gt;
&lt;br /&gt;
The overall procedure is, as follows: convert an empty HFS+ partition to use Core Storage and apply Core Storage encryption. Then use the Core Storage Logical Volume as a device in your zpool by supplying it to &amp;quot;zpool create,&amp;quot; &amp;quot;zpool add,&amp;quot; &amp;quot;zpool attach,&amp;quot; etc.&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
Build ZFS [[Install#Installing_from_source|from source]], or wait for the [[Downloads|next installer]], newer than 1.2.0 (for explanation, see original IRC chat).&lt;br /&gt;
&lt;br /&gt;
=== Caveats ===&lt;br /&gt;
As noted in the article [[suppressing the annoying pop-up]], you will receive a pop-up claiming the disk isn't readable by this computer.&lt;br /&gt;
This leads to one step that can be confusing: when unlocking the disk (e.g., on startup), the &amp;quot;bug&amp;quot; will make OS X believe the disk wasn't unlocked, and thus &amp;quot;wiggle,&amp;quot; presenting the prompt again.&lt;br /&gt;
&lt;br /&gt;
Assuming you entered your password correctly, the encrypted volume should now be unlocked, despite the misleading wiggle, and you can safely close the dialog box by clicking &amp;quot;Cancel.&amp;quot; You'll know for sure the volume is unlocked when you proceed to import your pool, or you can check directly by looking for &amp;lt;code&amp;gt;Encryption Status: Unlocked&amp;lt;/code&amp;gt; in the output of &amp;lt;code&amp;gt;diskutil coreStorage list&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Steps ===&lt;br /&gt;
The initial layout, with disk1 being the external disk (counter-intuitively named &amp;quot;Internal HD&amp;quot;) intended as encrypted ZFS device.&lt;br /&gt;
&lt;br /&gt;
 # diskutil list&lt;br /&gt;
 /dev/disk0&lt;br /&gt;
    #:                       TYPE NAME                    SIZE       IDENTIFIER&lt;br /&gt;
    0:      GUID_partition_scheme                        *160.0 GB   disk0&lt;br /&gt;
    1:                        EFI EFI                     209.7 MB   disk0s1&lt;br /&gt;
    2:                  Apple_HFS Macintosh HD            159.7 GB   disk0s2&lt;br /&gt;
 /dev/disk1&lt;br /&gt;
    #:                       TYPE NAME                    SIZE       IDENTIFIER&lt;br /&gt;
    0:      GUID_partition_scheme                        *1.0 TB     disk1&lt;br /&gt;
    1:                        EFI EFI                     209.7 MB   disk1s1&lt;br /&gt;
    2:                  Apple_HFS Internal HD             999.9 GB   disk1s2&lt;br /&gt;
&lt;br /&gt;
We note that disk1s2 is the partition to be encrypted, and we convert it to Core Storage (think LVM), to enable encryption:&lt;br /&gt;
&lt;br /&gt;
 #  diskutil coreStorage convert /dev/disk1s2&lt;br /&gt;
 Started CoreStorage operation on disk1s2 Internal HD&lt;br /&gt;
 Resizing disk to fit Core Storage headers&lt;br /&gt;
 Creating Core Storage Logical Volume Group&lt;br /&gt;
 Attempting to unmount disk1s2&lt;br /&gt;
 Switching disk1s2 to Core Storage&lt;br /&gt;
 Waiting for Logical Volume to appear&lt;br /&gt;
 Mounting Logical Volume&lt;br /&gt;
 Core Storage LVG UUID: 4690972A-484E-42E2-B72D-933A58E41237&lt;br /&gt;
 Core Storage PV UUID: 22A1A783-01BA-4ABA-B4A3-2A9146506519&lt;br /&gt;
 Core Storage LV UUID: F6D16BFE-B6E9-4A9B-BC03-E5CD03772C44&lt;br /&gt;
 Core Storage disk: disk2&lt;br /&gt;
 Finished CoreStorage operation on disk1s2 Internal HD&lt;br /&gt;
&lt;br /&gt;
Note that we converted the existing unencrypted HFS+ partition.&lt;br /&gt;
&lt;br /&gt;
Next, we encrypt the logical volume, our Core Storage disk, disk2:&lt;br /&gt;
&lt;br /&gt;
 # diskutil coreStorage encryptVolume /dev/disk2&lt;br /&gt;
 New passphrase for existing volume:&lt;br /&gt;
 Confirm new passphrase:&lt;br /&gt;
 The Core Storage Logical Volume UUID is F6D16BFE-B6E9-4A9B-BC03-E5CD03772C44&lt;br /&gt;
 Started CoreStorage operation on disk2 Internal HD&lt;br /&gt;
 Scheduling encryption of Core Storage Logical Volume&lt;br /&gt;
 Core Storage LV UUID: F6D16BFE-B6E9-4A9B-BC03-E5CD03772C44&lt;br /&gt;
 Finished CoreStorage operation on disk2 Internal HD&lt;br /&gt;
&lt;br /&gt;
Note that we used disk2, the logical volume, not disk1s2.&lt;br /&gt;
&lt;br /&gt;
This can and will take a while to complete. You can check the status by issuing:&lt;br /&gt;
 # diskutil coreStorage list | grep Conversion&lt;br /&gt;
&lt;br /&gt;
Until it's done:&lt;br /&gt;
 Conversion Status:  Complete&lt;br /&gt;
 Conversion Progress: -none-&lt;br /&gt;
&lt;br /&gt;
Your partition layout should now look like:&lt;br /&gt;
&lt;br /&gt;
 # diskutil list&lt;br /&gt;
 /dev/disk0&lt;br /&gt;
    #:                       TYPE NAME                    SIZE       IDENTIFIER&lt;br /&gt;
    0:      GUID_partition_scheme                        *160.0 GB   disk0&lt;br /&gt;
    1:                        EFI EFI                     209.7 MB   disk0s1&lt;br /&gt;
    2:                  Apple_HFS Macintosh HD            159.7 GB   disk0s2&lt;br /&gt;
 /dev/disk1&lt;br /&gt;
    #:                       TYPE NAME                    SIZE       IDENTIFIER&lt;br /&gt;
    0:      GUID_partition_scheme                        *1.0 TB     disk1&lt;br /&gt;
    1:                        EFI EFI                     209.7 MB   disk1s1&lt;br /&gt;
    2:          Apple_CoreStorage                         999.9 GB   disk1s2&lt;br /&gt;
    3:                 Apple_Boot Boot OS X               134.2 MB   disk1s3&lt;br /&gt;
 /dev/disk2&lt;br /&gt;
    #:                       TYPE NAME                    SIZE       IDENTIFIER&lt;br /&gt;
    0:                  Apple_HFS                        *999.5 GB   disk2&lt;br /&gt;
&lt;br /&gt;
disk2 being our encrypted, unlocked HFS+ device. If you have yet to be prompted for the passphrase by OS X, now would be a good time to restart your Mac and try it out.&lt;br /&gt;
&lt;br /&gt;
Lastly, we'll prepare the volume for ZFS, by unmounting /dev/disk2:&lt;br /&gt;
&lt;br /&gt;
 # mount&lt;br /&gt;
 ...&lt;br /&gt;
 /dev/disk2 on /Volumes/Internal HD (hfs, local, journaled)&lt;br /&gt;
 # diskutil unmount &amp;quot;/Volumes/Internal HD&amp;quot;&lt;br /&gt;
&lt;br /&gt;
You can now follow the article on [[Zpool#Creating_a_pool|creating a pool]]. As a simple example, you might&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 # zpool list&lt;br /&gt;
 no pools available&lt;br /&gt;
 # zpool create -f -o ashift=12 ZFS_VOLUME /dev/disk2&lt;br /&gt;
 # zpool list&lt;br /&gt;
 ZFS_VOLUME    928G  20.8G   907G     2%  1.00x  ONLINE  -&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Reason to &amp;quot;use latest&amp;quot; ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; If you want encryption you have a few options&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; https://github.com/zfsrogue/osx-zfs-crypto&lt;br /&gt;
&amp;lt;lundman&amp;gt; :)&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; or you can do what cbreak said, and use an encrypted sparsebundle&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; (I'd give it its own ZFS file system)&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; or you can create a ZVOL, and put an encrypted Core Storage/Filevault 2 HFS+&lt;br /&gt;
           file system on it&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; or you can put the pool itself on top of Core Storage.&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; The last option you should not do with the installer version.&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; But wait for the next installer if that's the route you want to go&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; or build from source.&lt;br /&gt;
&amp;lt;aandy&amp;gt;    Ah, interesting. Does FileVault 2 require HFS+? Not that it'd surprise me.&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; No it does not.&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; But it is not possible to set other Content Hints&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; so it will always say HFS+ even if you do put ZFS on your logical volumes.&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; So basically the procedure is to format the volume HFS+.&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; Then run 'diskutil coreStorage convert' on it.&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; Then you can encrypt it.&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; Then you unmount the HFS+&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; and zpool create on the logical volume.&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; And you should be good to go.&lt;br /&gt;
&amp;lt;aandy&amp;gt;    On the original HFS+ partition, right?&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; Right.&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; But I'd encrypt first&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; then put ZFS on it.&lt;br /&gt;
&amp;lt;aandy&amp;gt;    Right. Perfect.&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; diskutil coreStorage convert ...&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; diskutil coreStorage encryptVolume ...&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; etc.&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; The reason not to use the installer version, is that it will attempt to&lt;br /&gt;
           partition the Core Storage Logical Volume.&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; But since 10.8.5 and after, Apple doesn't like that&lt;br /&gt;
&amp;lt;ilovezfs&amp;gt; so we added new code to detect Core Storage and not partition if it sees it's&lt;br /&gt;
           Core Storage.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Time Machine backups ===&lt;br /&gt;
As a follow-up, here's one approach to using ZFS for your Time Machine Backups:&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:&lt;br /&gt;
an HFS+ sparsebundle stored on a compressed (gzip, lz4), deduped dataset should&lt;br /&gt;
yield a compression ratio &amp;gt; 1.0.&lt;br /&gt;
(previously observed 1.4 with compression=on, dedup=off, FreeBSD network Time Machine drives).&lt;br /&gt;
&lt;br /&gt;
To work around compatible disks for Time Machine, we create an HFS+ sparsebundle, store it on ZFS, 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 your ZFS filesystem (e.g., with makeImage.sh).&lt;br /&gt;
&lt;br /&gt;
2. Set your sparsebundle as the (active) backup destination # tmutil setdestination -a /Volumes/Time\ Machine\ Backups&lt;/div&gt;</summary>
		<author><name>77.186.150.26</name></author>	</entry>

	</feed>