Page 1 of 1

ZFS commands not added to PATH [SOLVED]

PostPosted: Fri May 28, 2021 2:36 pm
by Gekume123
So I'm running 11.3 Big Sur, and ran the ZFS installer package. I allowed access in the Security page, and then rebooted. However, when I run any zfs commands like zfs, zpool, etc. they all say command not found.

First time trying this on a Mac (and using a Mac in general) so I'm really not sure what I did wrong lol.

I tried running the installer again, and it tells me to unmount all zfs pools. The other ones I have are on separate drives and created in Linux, but I can't unmount them as I can't run any commands :P.

Here's the installer log:
https://pastebin.com/6C8s9xys

This is a Hackintosh if it can make a difference.

Thanks so much :)


EDIT: I do see that the 153 0 0xffffff7f9b453000 0x333000 0x333000 org.openzfsonosx.zfs (2.0.1) 3DF3A2C7-1696-3C3A-B1E3-9AF89C04EEB8 <31 8 6 5 3 1> kext is loaded, but I don't have /Volumes/OpenZFS where the uninstall script would be. I unplugged my ZFS drives and reran the install, but nothing changed.

EDIT2: Well, it does appear that I can run the commands specifying the path directly, ie /usr/local/zfs/bin/zpool in terminal. I'm not sure why the commands aren't available - is it enough to simply add that directory to my PATH?


SOLVED: Turns out Nix/Nix-Darwin edits my /etc/zprofile, I simply created ~/.zprofile and added:
Code: Select all
if [ -x /usr/libexec/path_helper ]; then
        eval `/usr/libexec/path_helper -s`
fi

(I didn't wanna edit /etc/zprofile)

Re: ZFS commands not added to PATH

PostPosted: Fri May 28, 2021 7:57 pm
by lundman
It is supposed to add "/etc/path.d/zfs" with /usr/local/zfs/bin in it. If you've rebooted, or reloaded the shell, it should work?

Re: ZFS commands not added to PATH

PostPosted: Sat May 29, 2021 12:14 pm
by Gekume123
Weird, I've rebooted a couple times and nothing.

echo $PATH:
Code: Select all
/Users/nate/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/Users/nate/.nix-profile/bin:/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin


I do see /etc/paths.d/zfs was created with the correct contents:

cat /etc/paths.d/zfs
Code: Select all
/usr/local/zfs/bin
/usr/local/zfs/bin


When I run
Code: Select all
eval `/usr/libexec/path_helper -s`
the commands become available, but only in that session. Let me know if you need any other files or anything that might help (or if I should just export PATH in my zshrc lol).


EDIT: wait, maybe that's supposed to be in zprofile or something?

EDIT 2: Sorry about this, turns out Nix-Darwin edits zprofile, I see that that path_helper line is included in the backup zprofile.orig file it creates before its own modifications. Problem solved, luckily it wasn't a problem with O3X.

Re: ZFS commands not added to PATH [SOLVED]

PostPosted: Sat May 29, 2021 3:13 pm
by lundman
excellent, thanks for chasing it down.

Re: ZFS commands not added to PATH [SOLVED]

PostPosted: Thu Jan 26, 2023 4:53 am
by Bingo
Is this a ZFS change or a macOS change? I went from Yosemite on a very old Air (where OpenZFS on OS X 2.0.1 worked OOTB), to High Sierra on a less-old but still old MacBook Pro where the 2.1.6 ZFS binaries didn't show up in PATH. I've never had to do anything to make the binaries available, but the solution here worked for me. Thanks :)

Re: ZFS commands not added to PATH [SOLVED]

PostPosted: Sun Feb 05, 2023 4:11 pm
by lundman
We moved commands from /usr/local/bin/ into its own tree, under /usr/local/zfs/bin/