Autoimport issue with Catalina

All your general support questions for OpenZFS on OS X.

Autoimport issue with Catalina

Postby UnConundrum » Tue Dec 03, 2019 12:44 pm

I can't seem to get my zfs pool to automatically import/mount with openZFS 1.9.3. I can mount it manually after the computer boots. The pool was created with an older version and has been upgraded.

Not sure if it's related, but I found "system_profiler[588:5297] SPUSBDevice: IOCreatePlugInInterfaceForService failed 0xe00002be" in org.openzfsonosx.zpool-import-all.log.

Any help appreciated.
UnConundrum
 
Posts: 13
Joined: Tue Dec 03, 2019 12:30 pm

Re: Autoimport issue with Catalina

Postby lundman » Wed Dec 04, 2019 3:56 pm

Generally, you should check that launchctl runs the zpool-all-import.sh script, but generally it is because it is run before the disks have settled. You can see inside the script there is a delay, you could try increasing it and see if that helps.
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: Autoimport issue with Catalina

Postby UnConundrum » Wed Dec 04, 2019 7:13 pm

Already tried setting it to 20 with no impact.

Following some posts I found, I wrote a short script to launch as root via Lingon:

Code: Select all
#!/bin/zsh

chsh -s /bin/zsh
echo "The user is:  $(whoami)"
echo "The shell is:  $SHELL"
if [ ! -d "/Volumes/backup-on-whp/" ]
then
        echo "Need to import pool"
        /usr/local/bin/zpool import backup-on-whp
else
        exit
fi


which resulted in:

Code: Select all
The user is:  root
The shell is:  /bin/sh
Need to import pool
cannot import 'backup-on-whp': no such pool available


Notice that it reports the shell as sh and not bash. Although it reports that no such pool is available, I know it is there and intact. Realizing that the default shell for Catalina is ZSH, I changed the shebang and the chsh to /bin/zsh, but the code still reported the shell as sh and continued to fail.

What makes this even stranger is that when I execute the same script from the command line as root, it succeeds:
Code: Select all
The user is:  root
The shell is:  /bin/sh
Need to import pool


After the "Need to import pool", the script sits for about 20 seconds as it imports the pool and all works normally. I don't understand why the script would work when called manually, but not be able to see the pool when called by Lingon.
UnConundrum
 
Posts: 13
Joined: Tue Dec 03, 2019 12:30 pm

Re: Autoimport issue with Catalina

Postby lundman » Wed Dec 04, 2019 10:03 pm

The shell should not matter. Guess it would be interesting to see if zpool import -d /dev/ name works better, in case it is "InvariantDisk" that is slow to start.
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: Autoimport issue with Catalina

Postby UnConundrum » Thu Dec 05, 2019 4:54 am

"/usr/local/bin/zpool import -d backup-on-whp" didn't help when within the script. In fact, running
Code: Select all
sudo zpool imoprt -d backup-on-whp
from the command line also reported no pools to import. Removing the -d from the command line worked.
UnConundrum
 
Posts: 13
Joined: Tue Dec 03, 2019 12:30 pm

Re: Autoimport issue with Catalina

Postby lundman » Thu Dec 05, 2019 5:22 pm

Needs to have "-d /dev" as -d takes an argument (directory to look inside)
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: Autoimport issue with Catalina

Postby UnConundrum » Fri Dec 06, 2019 4:33 am

Sorry, I missed that. Some improvement as the script now works from the command-line, but not from Lingon. Thanks for the help. I'll reach out to Lingon for some help.

***UPDATE***
With the help of Lingon, we resolved the issue in System Preferences -> Security & Privacy -> Full Disk Access by allowing sh. Apparently, another solution would be to build an app using automator and running that app via Lingon.
UnConundrum
 
Posts: 13
Joined: Tue Dec 03, 2019 12:30 pm

Re: Autoimport issue with Catalina

Postby glessard » Sat Dec 14, 2019 11:55 pm

I also had auto-import failures on Catalina, until I gave /bin/bash full disk access. After this, my pool auto-imports as it always did on 10.14 and before. I otherwise made no change. (As a sanity check, revoking full disk access for /bin/bash causes auto-import failures to resume.) Thanks unconundrum for pointing in this direction.

I wonder whether this has something to do with my mount point.
glessard
 
Posts: 17
Joined: Thu Mar 27, 2014 11:27 am

Re: Autoimport issue with Catalina

Postby lundman » Sun Dec 15, 2019 4:28 pm

Ah that is most interesting, and I would never notice since I have SIP off for development.
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: Autoimport issue with Catalina

Postby glessard » Wed Dec 18, 2019 11:14 am

I did try giving full disk access to either the auto-import script or the zpool executable, and neither worked.

As to my mount point, it is directly under /, with a synthetic.conf entry that points it to System/Volumes/Data/zfsMountpoint. I haven't tried to reverse the relationship, because Catalina isn't my regular OS yet.
glessard
 
Posts: 17
Joined: Thu Mar 27, 2014 11:27 am

Next

Return to General Help

Who is online

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

cron