ZFS commands not added to PATH [SOLVED]

All your general support questions for OpenZFS on OS X.

ZFS commands not added to PATH [SOLVED]

Postby Gekume123 » Fri May 28, 2021 2:36 pm

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)
Last edited by Gekume123 on Sat May 29, 2021 12:39 pm, edited 1 time in total.
Gekume123
 
Posts: 5
Joined: Fri May 28, 2021 2:25 pm

Re: ZFS commands not added to PATH

Postby lundman » Fri May 28, 2021 7:57 pm

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?
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: ZFS commands not added to PATH

Postby Gekume123 » Sat May 29, 2021 12:14 pm

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.
Gekume123
 
Posts: 5
Joined: Fri May 28, 2021 2:25 pm

Re: ZFS commands not added to PATH [SOLVED]

Postby lundman » Sat May 29, 2021 3:13 pm

excellent, thanks for chasing it down.
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: ZFS commands not added to PATH [SOLVED]

Postby Bingo » Thu Jan 26, 2023 4:53 am

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 :)
Bingo
 
Posts: 16
Joined: Thu Mar 04, 2021 11:18 pm

Re: ZFS commands not added to PATH [SOLVED]

Postby lundman » Sun Feb 05, 2023 4:11 pm

We moved commands from /usr/local/bin/ into its own tree, under /usr/local/zfs/bin/
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan


Return to General Help

Who is online

Users browsing this forum: Google [Bot] and 29 guests