Editing Install

Jump to: navigation, search

Warning: You are not logged in.

Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 8: Line 8:
  
 
  $ md5 OpenZFS_on_OS_X_*.dmg
 
  $ md5 OpenZFS_on_OS_X_*.dmg
  $ shasum OpenZFS_on_OS_X_*.dmg
+
  $ sha1sum OpenZFS_on_OS_X_*.dmg
  $ shasum -a 256 OpenZFS_on_OS_X_*.dmg
+
  $ openssl dgst -sha256 OpenZFS_on_OS_X_*.dmg
  
 
Open the .dmg file.
 
Open the .dmg file.
Line 18: Line 18:
  
 
Follow the prompts.
 
Follow the prompts.
 
Bash completion is also available: see [[Bash_completion]] page
 
  
 
If you ever want to uninstall, follow the instructions for [[Uninstall#Uninstalling_a_release_version|uninstalling a release version]].
 
If you ever want to uninstall, follow the instructions for [[Uninstall#Uninstalling_a_release_version|uninstalling a release version]].
Line 25: Line 23:
 
== Installing from source ==
 
== Installing from source ==
 
===Initial installation from source===
 
===Initial installation from source===
 
+
(Adapted from an [http://zerobsd.tumblr.com/post/62586498252/os-x-with-zfs article by ZeroBSD].)
New-port: Currently recommended ./configure line is:
+
./configure CPPFLAGS="-I/usr/local/opt/gettext/include -I/usr/local/opt/openssl@1.1/include" LDFLAGS="-L/usr/local/opt/gettext/lib/ -L/usr/local/opt/openssl@1.1/lib" CFLAGS="-g -O0" --sysconfdir=/etc --localstatedir=/var --prefix=/usr/local --sbindir=/usr/local/bin
+
 
+
  
 
Before doing anything else, please set your boot-args.
 
Before doing anything else, please set your boot-args.
  
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) :
+
On OS X El Capitan (10.11), OS X Mavericks (10.9), and OS X Mountain Lion (10.8) :
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
sudo nvram boot-args="-v keepsyms=1"
 
sudo nvram boot-args="-v keepsyms=1"
Line 43: Line 38:
  
  
This will take effect the next time you reboot. The argument <code>-v</code> will make your boot screen verbose instead of just showing the Apple logo, the argument <code>keepsyms=1</code> will make your panic reports more useful for us, and the argument <code>kext-dev-mode=1</code> (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.
+
This will take effect the next time you reboot. The argument <code>-v</code> will make your boot screen verbose instead of just showing the Apple logo, the argument <code>keepsyms=1</code> will make your panic reports more useful for us, and the argument <code>kext-dev-mode=1</code> (OS X Yosemite ONLY - does NOT include OS X El Capitan) will allow you to load your  custom-built, unsigned kexts kernel extensions. Note that kext-dev-mode is obsolete and and does nothing on OS X El Capitan. You should remove it from your boot-args to avoid confusion.
  
 
If you are a developer, you may want <code>debug=0x144</code> in your boot-args as well, as explained here: [[Development]]
 
If you are a developer, you may want <code>debug=0x144</code> in your boot-args as well, as explained here: [[Development]]
  
  
Tips for getting into recovery mode, useful if developing on a VM, type the following commands in a shell in the guest VM:
+
For 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
<syntaxhighlight lang="bash">
+
sudo nvram "recovery-boot-mode=unused"
+
sudo reboot recovery
+
</syntaxhighlight>
+
 
+
 
+
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
+
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
csrutil disable
 
csrutil disable
Line 64: Line 52:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
The latter will allow you to load your custom-built, unsigned kernel extensions, while keeping the rest of System Integrity Protection (SIP) in place.
 
The latter will allow you to load your custom-built, unsigned kernel extensions, while keeping the rest of System Integrity Protection (SIP) in place.
(Depending on your needs, other options you may want are <code>--without fs</code>, <code>--without debug</code>, <code>--without dtrace</code>, or <code>--without nvram</code>. If you specify all of them, that is equivalent to <code>csrutil disable</code>. The <code>--without</code> option takes a comma-delimited list or can be specified multiple times: <code>--without kext,debug,dtrace</code> is equivalent to <code>--without kext --without debug --without dtrace</code>).
+
(Depending on your needs, other options you may want are <code>--without fs</code>, <code>--without debug</code>, <code>--without dtrace</code>, and/or <code>--without nvram</code>. If you specify all of them, that is approximately equivalent to <code>csrutil disable</code>).
 
+
Starting with macOS Catalina, you will probably also want to disable the '''reboot to load kext''' using:
+
 
+
spctl kext-consent disable
+
 
+
During Recovery-Boot.
+
 
+
  
 
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.
 
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.
Line 79: Line 60:
 
* [https://developer.apple.com/xcode/ Xcode] (from [http://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12 Mac App Store] or https://developer.apple.com/downloads/index.action)
 
* [https://developer.apple.com/xcode/ Xcode] (from [http://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12 Mac App Store] or https://developer.apple.com/downloads/index.action)
 
* Xcode Command Line Tools (https://developer.apple.com/downloads/index.action)
 
* Xcode Command Line Tools (https://developer.apple.com/downloads/index.action)
* [http://brew.sh/ Homebrew] (or [http://www.macports.org/ MacPorts])
+
* [http://brew.sh/ Homebrew] (or [http://www.macports.org/MacPorts])
  
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):
+
Note: Xcode 6.3 or later is now required to build due to Broadwell CPU support requirements.
 
+
<syntaxhighlight lang="bash">
+
xcode-select --install
+
</syntaxhighlight>
+
  
 
To install Homebrew:
 
To install Homebrew:
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
+
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
 
</syntaxhighlight>
 
</syntaxhighlight>
  
If you already have Homebrew installed, you should
+
Paste that at a Terminal prompt.
 +
 
 +
Once Homebrew is installed, we need a couple of things first:
 +
 
 
<syntaxhighlight lang="text">
 
<syntaxhighlight lang="text">
brew update && brew upgrade
+
brew install automake libtool gawk coreutils
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Once Homebrew is installed or updated, you should check the output of
+
If you have used brew before, it might pay to check it
 +
 
 
<syntaxhighlight lang="text">
 
<syntaxhighlight lang="text">
 
brew doctor
 
brew doctor
 
</syntaxhighlight>
 
</syntaxhighlight>
and address any issues it identifies that you know are not false positives.
 
  
If you have used brew before, you should also run
+
and if prompted
 +
 
 
<syntaxhighlight lang="text">
 
<syntaxhighlight lang="text">
 
brew prune
 
brew prune
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Once your system is ready to brew, you should install the following:
+
Create two folders in your home directory.
<syntaxhighlight lang="text">
+
brew install automake libtool gawk coreutils
+
</syntaxhighlight>
+
(Note that autoconf will automatically be installed as well because it is a dependency of automake.)
+
 
+
Now that the needed tools are installed, it's time to set up your developer work space. Create two folders in your home directory.
+
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 123: Line 98:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Now adjust your PATH variable, unless you know it's already set appropriately.
+
Adjust your PATH variable:
  
If you're on OS X Mavericks or above (>= 10.9), run this:
 
 
<syntaxhighlight lang="bash">
 
echo 'export PATH=$HOME/bin:$PATH' >> ~/.bash_profile
 
</syntaxhighlight>
 
 
If you're on OS X Mountain Lion (10.8), you will want to run this instead:
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
echo 'export PATH=$HOME/bin:/usr/local/bin:$PATH' >> ~/.bash_profile
 
echo 'export PATH=$HOME/bin:/usr/local/bin:$PATH' >> ~/.bash_profile
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Then update your environment by sourcing your profile.
+
and update your environment by sourcing your profile.
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 250: Line 218:
 
sudo zpool export $poolname
 
sudo zpool export $poolname
 
</syntaxhighlight>
 
</syntaxhighlight>
 
Alternatively, you can run:
 
<syntaxhighlight lang="bash">
 
sudo zpool export -a
 
</syntaxhighlight>
 
which will try to export all pools for you.
 
  
 
Make sure they have exported successfully.
 
Make sure they have exported successfully.
Line 264: Line 226:
  
 
It should say, "no pools available."
 
It should say, "no pools available."
 +
 +
Alternatively, you can use this script to export all pools:
 +
<syntaxhighlight lang="bash">
 +
#!/bin/bash
 +
 +
if [ x$(which zpool) != x ]
 +
then
 +
zpool list -H | awk -F '\t' '{print $1;}' | xargs -I '#' sudo zpool export '#'
 +
else
 +
cd ~/Developer/zfs
 +
./cmd.sh zpool list -H | awk -F '\t' '{print $1;}' | xargs -I '#' sudo ./cmd.sh zpool export '#'
 +
fi
 +
</syntaxhighlight>
  
 
Get any [[zfsadm]] updates:
 
Get any [[zfsadm]] updates:
Line 289: Line 264:
  
 
# Assuming the build completed successfully,
 
# Assuming the build completed successfully,
# unload the kexts.
+
# unload the kexts. If you did not export all of
 +
# your pools this will panic:
  
 
zfsadm -u
 
zfsadm -u
Line 308: Line 284:
 
# If not, make sure kextd is aware of them
 
# If not, make sure kextd is aware of them
  
sudo touch /Library/Extensions /System/Library/Extensions
+
sudo touch /System/Library/Extensions
 
sudo killall -HUP kextd
 
sudo killall -HUP kextd
  
Line 321: Line 297:
 
sudo kextload -d spl.kext zfs.kext
 
sudo kextload -d spl.kext zfs.kext
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
If net.lundman.kernel.dependencies has been updated, which is rarely the case, a reboot will be necessary.
  
 
===Uninstalling a source install===
 
===Uninstalling a source install===
Line 346: Line 324:
  
 
cd ~/Developer
 
cd ~/Developer
sudo cp -R zfs/module/zfs/zfs.kext /tmp/o3x/  
+
sudo cp -r zfs/module/zfs/zfs.kext /tmp/o3x/  
sudo cp -R spl/module/spl/spl.kext /tmp/o3x/
+
sudo cp -r spl/module/spl/spl.kext /tmp/o3x/
  
 
cd /tmp/o3x
 
cd /tmp/o3x

Please note that all contributions to OpenZFS on OS X may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenZFS on OS X:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)