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: 1030
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: 1030
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan


Return to General Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron