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

	<entry>
		<id>https://openzfsonosx.org/wiki/Stopping_Spotlight_etc._from_changing_ZFS_without_permission</id>
		<title>Stopping Spotlight etc. from changing ZFS without permission</title>
		<link rel="alternate" type="text/html" href="https://openzfsonosx.org/wiki/Stopping_Spotlight_etc._from_changing_ZFS_without_permission"/>
				<updated>2020-08-27T20:36:58Z</updated>
		
		<summary type="html">&lt;p&gt;89.115.197.57: /* Solutions */ add more extensive approach to add &amp;quot;flag files&amp;quot; and disable macOS services&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The Issue ==&lt;br /&gt;
&lt;br /&gt;
ZFS is a great solution for backing up data, and moving data between platforms (e.g. Linux and Mac OS X).  However, if you connect an external ZFS drive to Mac OS X, you may be unpleasantly surprised to find that Spotlight, Finder etc. will modify the filesystems on the drive without asking (and even in violation of the user privileges granted by those filesystems).  This goes against several basic principles that you probably expect:&lt;br /&gt;
&lt;br /&gt;
* the filesystem should not change unless you change data on the filesystem.  E.g. simply plugging in the drive should not change the filesystem.&lt;br /&gt;
&lt;br /&gt;
* any attempted changes to the filesystem should obey the privilege rules set on that filesystem.  E.g. if the current user plugging in the drive lacks write privileges to the filesystem, no changes should be allowed.&lt;br /&gt;
&lt;br /&gt;
However, Spotlight, Finder etc. do not obey these expectations.  This can lead to serious problems for standard ZFS activities such as snapshot based backup.  For example, say you backup data by sending ZFS snapshots from one ZFS filesystem to another ZFS drive.  When you try to push incremental snapshots to an existing filesystem, it may fail with messages like &amp;quot;data has been changed since snapshot XYZ&amp;quot; -- even if you never wrote to that backup filesystem since your last snapshot.  Now you are in a quandary.  You will have to manually investigate the backup filesystem(s) to see what all the changes are, and whether might be any changes that need to be preserved (rather than just rolled back).  If you are used to working with ZFS on Linux this may initially baffle you, because on Linux a ZFS filesystem will not change in content unless you deliberately write data to it!&lt;br /&gt;
&lt;br /&gt;
The following Mac OS X services will modify your ZFS filesystems silently:&lt;br /&gt;
&lt;br /&gt;
* Spotlight&lt;br /&gt;
* Finder (.DS_Store, Trash)&lt;br /&gt;
&lt;br /&gt;
== Solutions ==&lt;br /&gt;
&lt;br /&gt;
* in general, if you are connecting an external ZFS drive to a Mac solely to READ data from it, '''just import it readonly'''.  This is the one trivially easy way to avoid the whole problem, e.g.:&lt;br /&gt;
&lt;br /&gt;
'''zpool import -o readonly=on tank'''&lt;br /&gt;
&lt;br /&gt;
If that is not an option, then you are going to have clean up your ZFS filesystems (every time) after OS X has &amp;quot;dirtied&amp;quot; them:&lt;br /&gt;
&lt;br /&gt;
* '''always take a snapshot of ZFS filesystems BEFORE plugging them in to a Mac'''.  This makes it relatively easy to know which changes are &amp;quot;OS X dirt&amp;quot; vs. previous data changes that you made before plugging into the Mac, and to rollback the dirt.  For example: '''zfs diff -H tank@lastsnap tank''' will give you a list of new, modified and deleted files since lastsnap.  Use Google to learn what Spotlight and Finder's hidden file names are.&lt;br /&gt;
&lt;br /&gt;
* if you did not deliberately make changes to a given ZFS filesystem while connected to the Mac, then '''just rollback to the latest snapshot''' (as your first action once you import that drive to a non-Mac host).&lt;br /&gt;
&lt;br /&gt;
* add &amp;quot;flag files&amp;quot; to each file system to prevent various OS X services from dirtying them.  E.g. '''touch /tank/.metadata_never_index''' should [http://superuser.com/questions/1000280/disable-ds-store-spotlight-and-other-metadata-on-mac-disk-image prevent Spotlight indexing].  We should collect a list here of all the rules for preventing such &amp;quot;dirty&amp;quot; services.&lt;br /&gt;
&lt;br /&gt;
A more extensive approach to add &amp;quot;flag files&amp;quot; and disable macOS services from polluting the file system:&lt;br /&gt;
&lt;br /&gt;
 # set the name of your ZFS pool on macOS, e.g.&lt;br /&gt;
 zpool_name=tank&lt;br /&gt;
&lt;br /&gt;
 # Remove macOS specific files from Spotlight, fseventsd, and the Trashes, create dummy files instead&lt;br /&gt;
 sudo rm -rfv /Volumes/$zpool_name/.{,_.}{fseventsd,Spotlight-V*,Trashes}&lt;br /&gt;
 sudo mkdir -pv /Volumes/$zpool_name/.fseventsd&lt;br /&gt;
 sudo touch /Volumes/$zpool_name/.fseventsd/no_log /Volumes/$zpool_name/.metadata_never_index /Volumes/$zpool_name/.Trashes&lt;br /&gt;
&lt;br /&gt;
 # Turn off Spotlight indexing and remove the .Spotlight-V* folders in newer macOS versions&lt;br /&gt;
 sudo mdutil -i off /Volumes/$zpool_name&lt;br /&gt;
 sudo mdutil -X /Volumes/$zpool_name&lt;br /&gt;
&lt;br /&gt;
 # Optionally, change ownership to current user to enable zfs volume operations w/o sudo&lt;br /&gt;
 sudo chown -R &amp;quot;$USER&amp;quot; /Volumes/$zpool_name&lt;/div&gt;</summary>
		<author><name>89.115.197.57</name></author>	</entry>

	<entry>
		<id>https://openzfsonosx.org/wiki/Install</id>
		<title>Install</title>
		<link rel="alternate" type="text/html" href="https://openzfsonosx.org/wiki/Install"/>
				<updated>2020-06-04T12:56:44Z</updated>
		
		<summary type="html">&lt;p&gt;89.115.197.57: /* Installing the official release */ add link to Bash_completion page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:About O3X]]&lt;br /&gt;
[[Category:Getting and installing O3X]]&lt;br /&gt;
== Installing the official release ==&lt;br /&gt;
&lt;br /&gt;
Download the most recent dmg from the [[Downloads]] page.&lt;br /&gt;
&lt;br /&gt;
Verify the checksums.&lt;br /&gt;
&lt;br /&gt;
 $ md5 OpenZFS_on_OS_X_*.dmg&lt;br /&gt;
 $ shasum OpenZFS_on_OS_X_*.dmg&lt;br /&gt;
 $ shasum -a 256 OpenZFS_on_OS_X_*.dmg&lt;br /&gt;
&lt;br /&gt;
Open the .dmg file.&lt;br /&gt;
&lt;br /&gt;
Read ReadMe.rtf.&lt;br /&gt;
&lt;br /&gt;
Start the installer by opening OpenZFS_on_OS_X_x.y.z.pkg.&lt;br /&gt;
&lt;br /&gt;
Follow the prompts.&lt;br /&gt;
&lt;br /&gt;
Bash completion is also available: see [[Bash_completion]] page&lt;br /&gt;
&lt;br /&gt;
If you ever want to uninstall, follow the instructions for [[Uninstall#Uninstalling_a_release_version|uninstalling a release version]].&lt;br /&gt;
&lt;br /&gt;
== Installing from source ==&lt;br /&gt;
===Initial installation from source===&lt;br /&gt;
&lt;br /&gt;
Before doing anything else, please set your boot-args.&lt;br /&gt;
&lt;br /&gt;
On macOS Mojave (10.14), High Sierra (10.13), Sierra (10.12), OS X El Capitan (10.11), OS X Mavericks (10.9), and OS X Mountain Lion (10.8) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo nvram boot-args=&amp;quot;-v keepsyms=1&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X Yosemite (10.10):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo nvram boot-args=&amp;quot;-v keepsyms=1 kext-dev-mode=1&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This will take effect the next time you reboot. The argument &amp;lt;code&amp;gt;-v&amp;lt;/code&amp;gt; will make your boot screen verbose instead of just showing the Apple logo, the argument &amp;lt;code&amp;gt;keepsyms=1&amp;lt;/code&amp;gt; will make your panic reports more useful for us, and the argument &amp;lt;code&amp;gt;kext-dev-mode=1&amp;lt;/code&amp;gt; (OS X Yosemite ONLY) will allow you to load your  custom-built, unsigned kexts kernel extensions. Note that as of OS X El Capitan, kext-dev-mode is obsolete and does nothing. If you are on macOS Sierra (10.12) or OS X El Capitan, you should remove kext-dev-mode from your boot-args to avoid confusion.&lt;br /&gt;
&lt;br /&gt;
If you are a developer, you may want &amp;lt;code&amp;gt;debug=0x144&amp;lt;/code&amp;gt; in your boot-args as well, as explained here: [[Development]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Tips for getting into recovery mode, useful if developing on a VM, type the following commands in a shell in the guest VM:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo nvram &amp;quot;recovery-boot-mode=unused&amp;quot;&lt;br /&gt;
sudo reboot recovery&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For macOS Sierra (10.12) and OS X El Capitan (10.11), you also need to boot into the Recovery OS (either the Recovery partition or bootable OS X install media for 10.11) and run&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
csrutil disable&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
csrutil enable --without kext&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The latter will allow you to load your custom-built, unsigned kernel extensions, while keeping the rest of System Integrity Protection (SIP) in place.&lt;br /&gt;
(Depending on your needs, other options you may want are &amp;lt;code&amp;gt;--without fs&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--without debug&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--without dtrace&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;--without nvram&amp;lt;/code&amp;gt;. If you specify all of them, that is equivalent to &amp;lt;code&amp;gt;csrutil disable&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;--without&amp;lt;/code&amp;gt; option takes a comma-delimited list or can be specified multiple times: &amp;lt;code&amp;gt;--without kext,debug,dtrace&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;--without kext --without debug --without dtrace&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Starting with macOS Catalina, you will probably also want to disable the '''reboot to load kext''' using:&lt;br /&gt;
&lt;br /&gt;
 spctl kext-consent disable&lt;br /&gt;
&lt;br /&gt;
During Recovery-Boot.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have any other implementation of ZFS installed, you must uninstall it and reboot before proceeding further. Similarly, if you have installed the O3X installer version, please follow the [https://openzfsonosx.org/wiki/Uninstall uninstallation directions] before proceeding.&lt;br /&gt;
&lt;br /&gt;
Prerequisites:&lt;br /&gt;
&lt;br /&gt;
* [https://developer.apple.com/xcode/ Xcode] (from [http://itunes.apple.com/us/app/xcode/id497799835?ls=1&amp;amp;mt=12 Mac App Store] or https://developer.apple.com/downloads/index.action)&lt;br /&gt;
* Xcode Command Line Tools (https://developer.apple.com/downloads/index.action)&lt;br /&gt;
* [http://brew.sh/ Homebrew] (or [http://www.macports.org/ MacPorts])&lt;br /&gt;
&lt;br /&gt;
Note: Xcode 6.3 or later is now required to build due to Broadwell CPU support requirements. Additionally, as of XCode 8, if you are on 10.11 specifically (unnecessary on 10.12), you need to install the CLT (Command Line Tools):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To install Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/bin/bash -c &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you already have Homebrew installed, you should &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
brew update &amp;amp;&amp;amp; brew upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once Homebrew is installed or updated, you should check the output of &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
brew doctor&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and address any issues it identifies that you know are not false positives.&lt;br /&gt;
&lt;br /&gt;
If you have used brew before, you should also run&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
brew prune&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once your system is ready to brew, you should install the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
brew install automake libtool gawk coreutils&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
(Note that autoconf will automatically be installed as well because it is a dependency of automake.)&lt;br /&gt;
&lt;br /&gt;
Now that the needed tools are installed, it's time to set up your developer work space. Create two folders in your home directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p ~/Developer ~/bin&lt;br /&gt;
chmod 700 ~/Developer ~/bin&lt;br /&gt;
chmod +a &amp;quot;group:everyone deny delete&amp;quot; ~/Developer ~/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now adjust your PATH variable, unless you know it's already set appropriately.&lt;br /&gt;
&lt;br /&gt;
If you're on OS X Mavericks or above (&amp;gt;= 10.9), run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo 'export PATH=$HOME/bin:$PATH' &amp;gt;&amp;gt; ~/.bash_profile&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you're on OS X Mountain Lion (10.8), you will want to run this instead:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo 'export PATH=$HOME/bin:/usr/local/bin:$PATH' &amp;gt;&amp;gt; ~/.bash_profile&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then update your environment by sourcing your profile.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source ~/.bash_profile&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To acquire the sources and build ZFS, we can use the [[zfsadm]] script found [https://gist.github.com/ilovezfs/7713854#file-zfsadm here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/Developer/&lt;br /&gt;
git clone https://gist.github.com/7713854.git zfsadm-repo&lt;br /&gt;
cp zfsadm-repo/zfsadm ~/bin/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can can build OpenZFS on OS X:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zfsadm&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will take a few minutes, depending on your hardware. There may be some warnings during the compilation. Do not worry about it unless you see errors.&lt;br /&gt;
&lt;br /&gt;
Before using ZFS, we need to actually install it. If you are a developer and wish not to install ZFS, but rather run it from the compile directory, skip ahead.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/Developer/spl&lt;br /&gt;
sudo make install&lt;br /&gt;
cd ~/Developer/zfs&lt;br /&gt;
sudo make install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check to see if the kernel extensions loaded automatically with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
kextstat | grep lundman&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see something similar to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
137    1 0xffffff803f61a800 0x20c      0x20c      net.lundman.kernel.dependencies (10.0.0)&lt;br /&gt;
144    1 0xffffff7f82720000 0xd000     0xd000     net.lundman.spl (1.0.0) &amp;lt;137 7 5 4 3 1&amp;gt;&lt;br /&gt;
145    0 0xffffff7f8272d000 0x202000   0x202000   net.lundman.zfs (1.0.0) &amp;lt;144 13 7 5 4 3 1&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If not, make sure kextd is aware of them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo touch /System/Library/Extensions&lt;br /&gt;
sudo killall -HUP kextd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now check again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
kextstat | grep lundman&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If not, you can load the kexts manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /System/Library/Extensions&lt;br /&gt;
sudo kextload spl.kext&lt;br /&gt;
sudo kextload -d spl.kext zfs.kext&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Try running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zpool&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to see if everything is installed and configured properly.&lt;br /&gt;
&lt;br /&gt;
You can go ahead and [[zpool#Creating_a_pool|create your pools]] at this point.&lt;br /&gt;
&lt;br /&gt;
===Running ZFS from the source build===&lt;br /&gt;
&lt;br /&gt;
In the ZFS directory there is a script called '''load.sh''' which will load the two kext modules. To run userland binaries from the source tree, use the provided '''cmd.sh''' script to set the DYNDL_LIBRARY_PATH variable correctly to find the libraries.&lt;br /&gt;
&lt;br /&gt;
Note that '''load.sh''' will also start '''tail -f /var/log/system.log''' for your convenience.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot; highlight=&amp;quot;1,2,3,6,7,10,12,14&amp;quot;&amp;gt;&lt;br /&gt;
$ sudo bash&lt;br /&gt;
# cd ~/Developer/zfs&lt;br /&gt;
# ./load.sh&lt;br /&gt;
kernel[0]: SPL: Loaded module v1.3.1-15_g4e2ff66 (DEBUG mode), (ncpu 4, memsize 4294967296, pages 1048576)&lt;br /&gt;
kernel[0]: ZFS: Loaded module v1.3.1-230_gb9658da, ZFS pool version 5000, ZFS filesystem version 5&lt;br /&gt;
# ./cmd.sh zpool import BOOM&lt;br /&gt;
# ./cmd.sh zpool list&lt;br /&gt;
NAME   SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT&lt;br /&gt;
BOOM  39.8G   207M  39.5G         -     1%     0%  1.00x  ONLINE  -&lt;br /&gt;
# ./cmd.sh zpool export BOOM&lt;br /&gt;
Unmount successful for /Volumes/BOOM&lt;br /&gt;
# kextunload -b net.lundman.zfs&lt;br /&gt;
kernel[0]: ZFS: Unloaded module v1.3.1-230_gb9658da&lt;br /&gt;
# kextunload -b net.lundman.spl&lt;br /&gt;
kernel[0]: SPL: Released 524288 bytes from vmem_seg_arena&lt;br /&gt;
kernel[0]: SPL: Unloaded module. (os_mem_alloc: 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Upgrading a source install===&lt;br /&gt;
When you want to get the [https://github.com/openzfsonosx/zfs/commits/master latest commits] from the GitHub, here's a quick overview of things you need to run.&lt;br /&gt;
&lt;br /&gt;
First make sure you have exported all of your pools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zpool list&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For every pool listed, run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo zpool export $poolname&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can run:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo zpool export -a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
which will try to export all pools for you.&lt;br /&gt;
&lt;br /&gt;
Make sure they have exported successfully.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zpool status&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should say, &amp;quot;no pools available.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Get any [[zfsadm]] updates:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/Developer&lt;br /&gt;
[ -d zfsadm-repo/.git ] &amp;amp;&amp;amp; (cd zfsadm-repo ; git pull)&lt;br /&gt;
[ ! -d zfsadm-repo/.git ] &amp;amp;&amp;amp;  git clone https://gist.github.com/7713854.git zfsadm-repo&lt;br /&gt;
cp zfsadm-repo/zfsadm ~/bin/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you should be able to upgrade your ZFS installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/Developer&lt;br /&gt;
&lt;br /&gt;
cd spl&lt;br /&gt;
make clean&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
cd zfs&lt;br /&gt;
make clean&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
zfsadm&lt;br /&gt;
&lt;br /&gt;
# Assuming the build completed successfully,&lt;br /&gt;
# unload the kexts.&lt;br /&gt;
&lt;br /&gt;
zfsadm -u&lt;br /&gt;
&lt;br /&gt;
# Now install the upgrade.&lt;br /&gt;
&lt;br /&gt;
cd spl&lt;br /&gt;
sudo make install&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
cd zfs&lt;br /&gt;
sudo make install&lt;br /&gt;
&lt;br /&gt;
# And verify they reloaded automatically&lt;br /&gt;
&lt;br /&gt;
kextstat | grep lundman&lt;br /&gt;
&lt;br /&gt;
# If not, make sure kextd is aware of them&lt;br /&gt;
&lt;br /&gt;
sudo touch /Library/Extensions /System/Library/Extensions&lt;br /&gt;
sudo killall -HUP kextd&lt;br /&gt;
&lt;br /&gt;
# and check again&lt;br /&gt;
&lt;br /&gt;
kextstat | grep lundman&lt;br /&gt;
&lt;br /&gt;
# if they they still have not loaded automatically&lt;br /&gt;
&lt;br /&gt;
cd /System/Library/Extensions&lt;br /&gt;
sudo kextload spl.kext&lt;br /&gt;
sudo kextload -d spl.kext zfs.kext&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Uninstalling a source install===&lt;br /&gt;
If you ever want to uninstall, follow the instructions for [[Uninstall#Uninstalling_a_source_install|uninstalling a source install]].&lt;br /&gt;
&lt;br /&gt;
== Using without actually installing (development) ==&lt;br /&gt;
This method is usually appropriate only for Developers.&lt;br /&gt;
&lt;br /&gt;
The procedure is the same as found in the section [[Install#Installing_from_source|installing from source]] except that you never run &amp;quot;make install.&amp;quot; Instead you load the kexts manually, and execute the binaries directly from the source tree.&lt;br /&gt;
&lt;br /&gt;
You can load the kexts manually by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zfsadm -k&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, zfsadm -k will copy spl.kext and zfs.kext from the source where they were built to /System/Library/Extensions, recursively change the ownership of everything in /System/Library/Extensions/spl.kext and /System/Library/Extensions/zfs.kext to be owned by the user &amp;quot;root&amp;quot; and the group &amp;quot;wheel,&amp;quot; and then load the kexts directly from /System/Library/Extensions. If you prefer to use a different directory, use the -i option in zfsadm or edit zfsadm to hard code a different directory.&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use zfsadm, you can do all of this yourself, using whatever target directory you'd like. For example, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
sudo rm -rf o3x&lt;br /&gt;
sudo mkdir o3x&lt;br /&gt;
&lt;br /&gt;
cd ~/Developer&lt;br /&gt;
sudo cp -R zfs/module/zfs/zfs.kext /tmp/o3x/ &lt;br /&gt;
sudo cp -R spl/module/spl/spl.kext /tmp/o3x/&lt;br /&gt;
&lt;br /&gt;
cd /tmp/o3x&lt;br /&gt;
sudo chown -R *&lt;br /&gt;
sudo kextload spl.kext&lt;br /&gt;
sudo kextload -d spl.kext zfs.kext&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the kexts have been loaded, you can test the commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
~/Developer/zfs/cmd.sh zfs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Migrating old pools (from MacZFS or ZEVO) ==&lt;br /&gt;
&lt;br /&gt;
First export all of your pools, and uninstall the other implementation. It is all right if you forgot to export your pools before uninstalling. You will just need to use the '-f' option when importing into OpenZFS on OS X.&lt;br /&gt;
&lt;br /&gt;
To find out the pool names, you need to execute the command for pool discovery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo zpool import&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will tell you what pools are available to be imported, but will not actually import anything. You can see that nothing has been imported yet by using the 'zpool status' command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zpool status&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that you know what pools are available to be imported, you can actually import a pool by supplying the name or guid that you saw during pool discovery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo zpool import poolname (or guid)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Notice how this differs from the command for pool discovery.)&lt;br /&gt;
&lt;br /&gt;
If you forgot to export before migrating, you will need to use the '-f' option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo zpool import -f poolname (or guid)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to see the same information you saw during pool discovery, you will now need to use 'zpool status' rather than 'zpool import'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zpool status&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If all pools have been imported, the pool discovery command— 'zpool import' with no pool or guid specified— will return without any output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo zpool import&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>89.115.197.57</name></author>	</entry>

	<entry>
		<id>https://openzfsonosx.org/wiki/Bash_completion</id>
		<title>Bash completion</title>
		<link rel="alternate" type="text/html" href="https://openzfsonosx.org/wiki/Bash_completion"/>
				<updated>2020-06-04T12:54:07Z</updated>
		
		<summary type="html">&lt;p&gt;89.115.197.57: fix shell code eaten by wiki syntax&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assuming you already have [http://brew.sh/ Homebrew] installed&lt;br /&gt;
== Bash version &amp;lt; 4 ==&lt;br /&gt;
 brew install bash-completion&lt;br /&gt;
Add the following lines to your ~/.bash_profile:&lt;br /&gt;
 if [ -f $(brew --prefix)/etc/bash_completion ]; then&lt;br /&gt;
         . $(brew --prefix)/etc/bash_completion&lt;br /&gt;
 fi&lt;br /&gt;
Install the ZFS bash completions:&lt;br /&gt;
 cd /usr/local/etc/bash_completion.d&lt;br /&gt;
 curl -O https://raw.githubusercontent.com/openzfs/zfs/master/contrib/bash_completion.d/zfs&lt;br /&gt;
 chmod +x /usr/local/etc/bash_completion.d/zfs&lt;br /&gt;
Source the added file (source /usr/local/etc/bash_completion.d/zfs) or open a new terminal window.&lt;br /&gt;
&lt;br /&gt;
== Bash version ≥ 4 ==&lt;br /&gt;
 brew install bash-completion@2&lt;br /&gt;
Add the following lines to your ~/.bash_profile or ~/.bashrc (depending on your preferred setup of startup files):&lt;br /&gt;
 export BASH_COMPLETION_COMPAT_DIR=&amp;quot;/usr/local/etc/bash_completion.d&amp;quot;&lt;br /&gt;
 if [ -r &amp;quot;/usr/local/etc/profile.d/bash_completion.sh&amp;quot; ]; then &lt;br /&gt;
         . &amp;quot;/usr/local/etc/profile.d/bash_completion.sh&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
Install the ZFS bash completions:&lt;br /&gt;
 cd /usr/local/share/bash-completion/completions&lt;br /&gt;
 curl -O https://raw.githubusercontent.com/openzfs/zfs/master/contrib/bash_completion.d/zfs&lt;br /&gt;
 chmod +x /usr/local/share/bash-completion/completions/zfs&lt;br /&gt;
Source the added file (source /usr/local/share/bash-completion/completions/zfs) or open a new terminal window.&lt;/div&gt;</summary>
		<author><name>89.115.197.57</name></author>	</entry>

	<entry>
		<id>https://openzfsonosx.org/wiki/Bash_completion</id>
		<title>Bash completion</title>
		<link rel="alternate" type="text/html" href="https://openzfsonosx.org/wiki/Bash_completion"/>
				<updated>2020-06-04T12:50:55Z</updated>
		
		<summary type="html">&lt;p&gt;89.115.197.57: update github url and add bash ≥ 4 instructions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Assuming you already have [http://brew.sh/ Homebrew] installed&lt;br /&gt;
== Bash version &amp;lt; 4 ==&lt;br /&gt;
 brew install bash-completion&lt;br /&gt;
Add the following lines to your ~/.bash_profile:&lt;br /&gt;
 if [ -f $(brew --prefix)/etc/bash_completion ]; then&lt;br /&gt;
         . $(brew --prefix)/etc/bash_completion&lt;br /&gt;
 fi&lt;br /&gt;
Install the ZFS bash completions:&lt;br /&gt;
 cd /usr/local/etc/bash_completion.d&lt;br /&gt;
 curl -O https://raw.githubusercontent.com/openzfs/zfs/master/contrib/bash_completion.d/zfs&lt;br /&gt;
 chmod +x /usr/local/etc/bash_completion.d/zfs&lt;br /&gt;
Source the added file (source /usr/local/etc/bash_completion.d/zfs) or open a new terminal window.&lt;br /&gt;
&lt;br /&gt;
== Bash version ≥ 4 ==&lt;br /&gt;
 brew install bash-completion@2&lt;br /&gt;
Add the following lines to your ~/.bash_profile or ~/.bashrc (depending on your preferred setup of startup files):&lt;br /&gt;
 export BASH_COMPLETION_COMPAT_DIR=&amp;quot;/usr/local/etc/bash_completion.d&amp;quot;&lt;br /&gt;
 [[ -r &amp;quot;/usr/local/etc/profile.d/bash_completion.sh&amp;quot; ]] &amp;amp;&amp;amp; . &amp;quot;/usr/local/etc/profile.d/bash_completion.sh&amp;quot;&lt;br /&gt;
Install the ZFS bash completions:&lt;br /&gt;
 cd /usr/local/share/bash-completion/completions&lt;br /&gt;
 curl -O https://raw.githubusercontent.com/openzfs/zfs/master/contrib/bash_completion.d/zfs&lt;br /&gt;
 chmod +x /usr/local/share/bash-completion/completions/zfs&lt;br /&gt;
Source the added file (source /usr/local/share/bash-completion/completions/zfs) or open a new terminal window.&lt;/div&gt;</summary>
		<author><name>89.115.197.57</name></author>	</entry>

	<entry>
		<id>https://openzfsonosx.org/wiki/Install</id>
		<title>Install</title>
		<link rel="alternate" type="text/html" href="https://openzfsonosx.org/wiki/Install"/>
				<updated>2020-06-03T16:27:30Z</updated>
		
		<summary type="html">&lt;p&gt;89.115.197.57: update brew install command to the current one on brew.sh&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:About O3X]]&lt;br /&gt;
[[Category:Getting and installing O3X]]&lt;br /&gt;
== Installing the official release ==&lt;br /&gt;
&lt;br /&gt;
Download the most recent dmg from the [[Downloads]] page.&lt;br /&gt;
&lt;br /&gt;
Verify the checksums.&lt;br /&gt;
&lt;br /&gt;
 $ md5 OpenZFS_on_OS_X_*.dmg&lt;br /&gt;
 $ shasum OpenZFS_on_OS_X_*.dmg&lt;br /&gt;
 $ shasum -a 256 OpenZFS_on_OS_X_*.dmg&lt;br /&gt;
&lt;br /&gt;
Open the .dmg file.&lt;br /&gt;
&lt;br /&gt;
Read ReadMe.rtf.&lt;br /&gt;
&lt;br /&gt;
Start the installer by opening OpenZFS_on_OS_X_x.y.z.pkg.&lt;br /&gt;
&lt;br /&gt;
Follow the prompts.&lt;br /&gt;
&lt;br /&gt;
If you ever want to uninstall, follow the instructions for [[Uninstall#Uninstalling_a_release_version|uninstalling a release version]].&lt;br /&gt;
&lt;br /&gt;
== Installing from source ==&lt;br /&gt;
===Initial installation from source===&lt;br /&gt;
&lt;br /&gt;
Before doing anything else, please set your boot-args.&lt;br /&gt;
&lt;br /&gt;
On macOS Mojave (10.14), High Sierra (10.13), Sierra (10.12), OS X El Capitan (10.11), OS X Mavericks (10.9), and OS X Mountain Lion (10.8) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo nvram boot-args=&amp;quot;-v keepsyms=1&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On OS X Yosemite (10.10):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo nvram boot-args=&amp;quot;-v keepsyms=1 kext-dev-mode=1&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This will take effect the next time you reboot. The argument &amp;lt;code&amp;gt;-v&amp;lt;/code&amp;gt; will make your boot screen verbose instead of just showing the Apple logo, the argument &amp;lt;code&amp;gt;keepsyms=1&amp;lt;/code&amp;gt; will make your panic reports more useful for us, and the argument &amp;lt;code&amp;gt;kext-dev-mode=1&amp;lt;/code&amp;gt; (OS X Yosemite ONLY) will allow you to load your  custom-built, unsigned kexts kernel extensions. Note that as of OS X El Capitan, kext-dev-mode is obsolete and does nothing. If you are on macOS Sierra (10.12) or OS X El Capitan, you should remove kext-dev-mode from your boot-args to avoid confusion.&lt;br /&gt;
&lt;br /&gt;
If you are a developer, you may want &amp;lt;code&amp;gt;debug=0x144&amp;lt;/code&amp;gt; in your boot-args as well, as explained here: [[Development]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Tips for getting into recovery mode, useful if developing on a VM, type the following commands in a shell in the guest VM:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo nvram &amp;quot;recovery-boot-mode=unused&amp;quot;&lt;br /&gt;
sudo reboot recovery&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For macOS Sierra (10.12) and OS X El Capitan (10.11), you also need to boot into the Recovery OS (either the Recovery partition or bootable OS X install media for 10.11) and run&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
csrutil disable&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
csrutil enable --without kext&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The latter will allow you to load your custom-built, unsigned kernel extensions, while keeping the rest of System Integrity Protection (SIP) in place.&lt;br /&gt;
(Depending on your needs, other options you may want are &amp;lt;code&amp;gt;--without fs&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--without debug&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--without dtrace&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;--without nvram&amp;lt;/code&amp;gt;. If you specify all of them, that is equivalent to &amp;lt;code&amp;gt;csrutil disable&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;--without&amp;lt;/code&amp;gt; option takes a comma-delimited list or can be specified multiple times: &amp;lt;code&amp;gt;--without kext,debug,dtrace&amp;lt;/code&amp;gt; is equivalent to &amp;lt;code&amp;gt;--without kext --without debug --without dtrace&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Starting with macOS Catalina, you will probably also want to disable the '''reboot to load kext''' using:&lt;br /&gt;
&lt;br /&gt;
 spctl kext-consent disable&lt;br /&gt;
&lt;br /&gt;
During Recovery-Boot.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have any other implementation of ZFS installed, you must uninstall it and reboot before proceeding further. Similarly, if you have installed the O3X installer version, please follow the [https://openzfsonosx.org/wiki/Uninstall uninstallation directions] before proceeding.&lt;br /&gt;
&lt;br /&gt;
Prerequisites:&lt;br /&gt;
&lt;br /&gt;
* [https://developer.apple.com/xcode/ Xcode] (from [http://itunes.apple.com/us/app/xcode/id497799835?ls=1&amp;amp;mt=12 Mac App Store] or https://developer.apple.com/downloads/index.action)&lt;br /&gt;
* Xcode Command Line Tools (https://developer.apple.com/downloads/index.action)&lt;br /&gt;
* [http://brew.sh/ Homebrew] (or [http://www.macports.org/ MacPorts])&lt;br /&gt;
&lt;br /&gt;
Note: Xcode 6.3 or later is now required to build due to Broadwell CPU support requirements. Additionally, as of XCode 8, if you are on 10.11 specifically (unnecessary on 10.12), you need to install the CLT (Command Line Tools):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To install Homebrew:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/bin/bash -c &amp;quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you already have Homebrew installed, you should &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
brew update &amp;amp;&amp;amp; brew upgrade&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once Homebrew is installed or updated, you should check the output of &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
brew doctor&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and address any issues it identifies that you know are not false positives.&lt;br /&gt;
&lt;br /&gt;
If you have used brew before, you should also run&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
brew prune&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once your system is ready to brew, you should install the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
brew install automake libtool gawk coreutils&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
(Note that autoconf will automatically be installed as well because it is a dependency of automake.)&lt;br /&gt;
&lt;br /&gt;
Now that the needed tools are installed, it's time to set up your developer work space. Create two folders in your home directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p ~/Developer ~/bin&lt;br /&gt;
chmod 700 ~/Developer ~/bin&lt;br /&gt;
chmod +a &amp;quot;group:everyone deny delete&amp;quot; ~/Developer ~/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now adjust your PATH variable, unless you know it's already set appropriately.&lt;br /&gt;
&lt;br /&gt;
If you're on OS X Mavericks or above (&amp;gt;= 10.9), run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo 'export PATH=$HOME/bin:$PATH' &amp;gt;&amp;gt; ~/.bash_profile&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you're on OS X Mountain Lion (10.8), you will want to run this instead:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo 'export PATH=$HOME/bin:/usr/local/bin:$PATH' &amp;gt;&amp;gt; ~/.bash_profile&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then update your environment by sourcing your profile.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source ~/.bash_profile&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To acquire the sources and build ZFS, we can use the [[zfsadm]] script found [https://gist.github.com/ilovezfs/7713854#file-zfsadm here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/Developer/&lt;br /&gt;
git clone https://gist.github.com/7713854.git zfsadm-repo&lt;br /&gt;
cp zfsadm-repo/zfsadm ~/bin/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can can build OpenZFS on OS X:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zfsadm&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will take a few minutes, depending on your hardware. There may be some warnings during the compilation. Do not worry about it unless you see errors.&lt;br /&gt;
&lt;br /&gt;
Before using ZFS, we need to actually install it. If you are a developer and wish not to install ZFS, but rather run it from the compile directory, skip ahead.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/Developer/spl&lt;br /&gt;
sudo make install&lt;br /&gt;
cd ~/Developer/zfs&lt;br /&gt;
sudo make install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can check to see if the kernel extensions loaded automatically with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
kextstat | grep lundman&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see something similar to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
137    1 0xffffff803f61a800 0x20c      0x20c      net.lundman.kernel.dependencies (10.0.0)&lt;br /&gt;
144    1 0xffffff7f82720000 0xd000     0xd000     net.lundman.spl (1.0.0) &amp;lt;137 7 5 4 3 1&amp;gt;&lt;br /&gt;
145    0 0xffffff7f8272d000 0x202000   0x202000   net.lundman.zfs (1.0.0) &amp;lt;144 13 7 5 4 3 1&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If not, make sure kextd is aware of them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo touch /System/Library/Extensions&lt;br /&gt;
sudo killall -HUP kextd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now check again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
kextstat | grep lundman&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If not, you can load the kexts manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /System/Library/Extensions&lt;br /&gt;
sudo kextload spl.kext&lt;br /&gt;
sudo kextload -d spl.kext zfs.kext&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Try running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zpool&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to see if everything is installed and configured properly.&lt;br /&gt;
&lt;br /&gt;
You can go ahead and [[zpool#Creating_a_pool|create your pools]] at this point.&lt;br /&gt;
&lt;br /&gt;
===Running ZFS from the source build===&lt;br /&gt;
&lt;br /&gt;
In the ZFS directory there is a script called '''load.sh''' which will load the two kext modules. To run userland binaries from the source tree, use the provided '''cmd.sh''' script to set the DYNDL_LIBRARY_PATH variable correctly to find the libraries.&lt;br /&gt;
&lt;br /&gt;
Note that '''load.sh''' will also start '''tail -f /var/log/system.log''' for your convenience.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot; highlight=&amp;quot;1,2,3,6,7,10,12,14&amp;quot;&amp;gt;&lt;br /&gt;
$ sudo bash&lt;br /&gt;
# cd ~/Developer/zfs&lt;br /&gt;
# ./load.sh&lt;br /&gt;
kernel[0]: SPL: Loaded module v1.3.1-15_g4e2ff66 (DEBUG mode), (ncpu 4, memsize 4294967296, pages 1048576)&lt;br /&gt;
kernel[0]: ZFS: Loaded module v1.3.1-230_gb9658da, ZFS pool version 5000, ZFS filesystem version 5&lt;br /&gt;
# ./cmd.sh zpool import BOOM&lt;br /&gt;
# ./cmd.sh zpool list&lt;br /&gt;
NAME   SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT&lt;br /&gt;
BOOM  39.8G   207M  39.5G         -     1%     0%  1.00x  ONLINE  -&lt;br /&gt;
# ./cmd.sh zpool export BOOM&lt;br /&gt;
Unmount successful for /Volumes/BOOM&lt;br /&gt;
# kextunload -b net.lundman.zfs&lt;br /&gt;
kernel[0]: ZFS: Unloaded module v1.3.1-230_gb9658da&lt;br /&gt;
# kextunload -b net.lundman.spl&lt;br /&gt;
kernel[0]: SPL: Released 524288 bytes from vmem_seg_arena&lt;br /&gt;
kernel[0]: SPL: Unloaded module. (os_mem_alloc: 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Upgrading a source install===&lt;br /&gt;
When you want to get the [https://github.com/openzfsonosx/zfs/commits/master latest commits] from the GitHub, here's a quick overview of things you need to run.&lt;br /&gt;
&lt;br /&gt;
First make sure you have exported all of your pools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zpool list&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For every pool listed, run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo zpool export $poolname&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can run:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo zpool export -a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
which will try to export all pools for you.&lt;br /&gt;
&lt;br /&gt;
Make sure they have exported successfully.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zpool status&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should say, &amp;quot;no pools available.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Get any [[zfsadm]] updates:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/Developer&lt;br /&gt;
[ -d zfsadm-repo/.git ] &amp;amp;&amp;amp; (cd zfsadm-repo ; git pull)&lt;br /&gt;
[ ! -d zfsadm-repo/.git ] &amp;amp;&amp;amp;  git clone https://gist.github.com/7713854.git zfsadm-repo&lt;br /&gt;
cp zfsadm-repo/zfsadm ~/bin/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you should be able to upgrade your ZFS installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/Developer&lt;br /&gt;
&lt;br /&gt;
cd spl&lt;br /&gt;
make clean&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
cd zfs&lt;br /&gt;
make clean&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
zfsadm&lt;br /&gt;
&lt;br /&gt;
# Assuming the build completed successfully,&lt;br /&gt;
# unload the kexts.&lt;br /&gt;
&lt;br /&gt;
zfsadm -u&lt;br /&gt;
&lt;br /&gt;
# Now install the upgrade.&lt;br /&gt;
&lt;br /&gt;
cd spl&lt;br /&gt;
sudo make install&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
cd zfs&lt;br /&gt;
sudo make install&lt;br /&gt;
&lt;br /&gt;
# And verify they reloaded automatically&lt;br /&gt;
&lt;br /&gt;
kextstat | grep lundman&lt;br /&gt;
&lt;br /&gt;
# If not, make sure kextd is aware of them&lt;br /&gt;
&lt;br /&gt;
sudo touch /Library/Extensions /System/Library/Extensions&lt;br /&gt;
sudo killall -HUP kextd&lt;br /&gt;
&lt;br /&gt;
# and check again&lt;br /&gt;
&lt;br /&gt;
kextstat | grep lundman&lt;br /&gt;
&lt;br /&gt;
# if they they still have not loaded automatically&lt;br /&gt;
&lt;br /&gt;
cd /System/Library/Extensions&lt;br /&gt;
sudo kextload spl.kext&lt;br /&gt;
sudo kextload -d spl.kext zfs.kext&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Uninstalling a source install===&lt;br /&gt;
If you ever want to uninstall, follow the instructions for [[Uninstall#Uninstalling_a_source_install|uninstalling a source install]].&lt;br /&gt;
&lt;br /&gt;
== Using without actually installing (development) ==&lt;br /&gt;
This method is usually appropriate only for Developers.&lt;br /&gt;
&lt;br /&gt;
The procedure is the same as found in the section [[Install#Installing_from_source|installing from source]] except that you never run &amp;quot;make install.&amp;quot; Instead you load the kexts manually, and execute the binaries directly from the source tree.&lt;br /&gt;
&lt;br /&gt;
You can load the kexts manually by running&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zfsadm -k&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, zfsadm -k will copy spl.kext and zfs.kext from the source where they were built to /System/Library/Extensions, recursively change the ownership of everything in /System/Library/Extensions/spl.kext and /System/Library/Extensions/zfs.kext to be owned by the user &amp;quot;root&amp;quot; and the group &amp;quot;wheel,&amp;quot; and then load the kexts directly from /System/Library/Extensions. If you prefer to use a different directory, use the -i option in zfsadm or edit zfsadm to hard code a different directory.&lt;br /&gt;
&lt;br /&gt;
If you do not wish to use zfsadm, you can do all of this yourself, using whatever target directory you'd like. For example, you might do the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /tmp&lt;br /&gt;
sudo rm -rf o3x&lt;br /&gt;
sudo mkdir o3x&lt;br /&gt;
&lt;br /&gt;
cd ~/Developer&lt;br /&gt;
sudo cp -R zfs/module/zfs/zfs.kext /tmp/o3x/ &lt;br /&gt;
sudo cp -R spl/module/spl/spl.kext /tmp/o3x/&lt;br /&gt;
&lt;br /&gt;
cd /tmp/o3x&lt;br /&gt;
sudo chown -R *&lt;br /&gt;
sudo kextload spl.kext&lt;br /&gt;
sudo kextload -d spl.kext zfs.kext&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the kexts have been loaded, you can test the commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
~/Developer/zfs/cmd.sh zfs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Migrating old pools (from MacZFS or ZEVO) ==&lt;br /&gt;
&lt;br /&gt;
First export all of your pools, and uninstall the other implementation. It is all right if you forgot to export your pools before uninstalling. You will just need to use the '-f' option when importing into OpenZFS on OS X.&lt;br /&gt;
&lt;br /&gt;
To find out the pool names, you need to execute the command for pool discovery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo zpool import&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will tell you what pools are available to be imported, but will not actually import anything. You can see that nothing has been imported yet by using the 'zpool status' command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zpool status&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that you know what pools are available to be imported, you can actually import a pool by supplying the name or guid that you saw during pool discovery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo zpool import poolname (or guid)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Notice how this differs from the command for pool discovery.)&lt;br /&gt;
&lt;br /&gt;
If you forgot to export before migrating, you will need to use the '-f' option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo zpool import -f poolname (or guid)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to see the same information you saw during pool discovery, you will now need to use 'zpool status' rather than 'zpool import'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zpool status&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If all pools have been imported, the pool discovery command— 'zpool import' with no pool or guid specified— will return without any output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo zpool import&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>89.115.197.57</name></author>	</entry>

	</feed>