Auto-Import by-serial

All your general support questions for OpenZFS on OS X.

Auto-Import by-serial

Postby PermanentRotorStator » Fri Mar 31, 2023 5:08 pm

First of all, this OpenZFS software on OS X is amazing. Thank you for providing this software to the macOS community.

I recently set up an external Thunderbay 8 enclosure and have auto-import "by-id" working on my raidz2-0 array having read:
https://openzfsonosx.org/wiki/FAQ#Q.29_ ... t_work_.3F

I would like to configure the pool to auto-import "by-serial" to be best prepared to monitor for when a drive might require replacement down the road.

I've confirmed I can manually import the pool "by-serial".
% sudo zpool import -d /var/run/disk/by-serial array
See excerpt from terminal session below.

I've also tried to update the below line of the .plist from "by-id" to "by-serial" without success.
<string>/var/run/disk/by-id</string>
/Library/LaunchDaemons/org.openzfsonosx.zpool-import.plist

Has anyone gotten auto-import "by-serial" to work in 2.1.6?

Terminal session from boot:
% sudo zpool status
pool: array
state: ONLINE
config:

NAME STATE READ WRITE CKSUM
array ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
media-XYZ1... ONLINE 0 0 0
media-XYZ2... ONLINE 0 0 0
media-XYZ3... ONLINE 0 0 0
media-XYZ4... ONLINE 0 0 0
media-XYZ5... ONLINE 0 0 0
media-XYZ6... ONLINE 0 0 0
media-XYZ7... ONLINE 0 0 0
media-XYZ8... ONLINE 0 0 0
...
errors: No known data errors
% sudo zpool export array
Volume array on disk10s1 unmounted
% sudo zpool import -d /var/run/disk/by-serial array
% sudo zpool status
pool: array
state: ONLINE
config:

NAME STATE READ WRITE CKSUM
array ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
WDC...SN1 ONLINE 0 0 0
WDC...SN2 ONLINE 0 0 0
WDC...SN3 ONLINE 0 0 0
WDC...SN4 ONLINE 0 0 0
WDC...SN5 ONLINE 0 0 0
WDC...SN6 ONLINE 0 0 0
WDC...SN7 ONLINE 0 0 0
WDC...SN8 ONLINE 0 0 0
...
PermanentRotorStator
 
Posts: 2
Joined: Fri Mar 31, 2023 4:47 pm

Re: Auto-Import by-serial

Postby lundman » Sun Apr 02, 2023 7:41 pm

The zpool-import-all is a script, and in the middle somewhere it has "zpool import", just add the -d by-id part on it and you'll be set.

We probably could add an Argument, so that your idea would work too
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: Auto-Import by-serial

Postby PermanentRotorStator » Mon Apr 03, 2023 5:56 pm

lundman wrote:The zpool-import-all is a script, and in the middle somewhere it has "zpool import", just add the -d by-id part on it and you'll be set.


Thank you for your reply, but where is the zpool-import-all.sh script stored in 2.1.6?

I can see it is running by reviewing the log:
/private/var/log/org.openzfsonosx.zpool-import-all.log

I also see some potentially relevant files here:
/Library/LaunchDaemons/org.openzfsonosx.zpool-import.plist
/Library/LaunchDaemons/org.openzfsonosx.zpool-import.plist.in

But I cannot find zpool-import-all.sh
PermanentRotorStator
 
Posts: 2
Joined: Fri Mar 31, 2023 4:47 pm

Re: Auto-Import by-serial

Postby lundman » Mon Apr 03, 2023 8:16 pm

Oh right, that changed. The import all script runs "launchctl kick"

which has:

launchd/daemons/org.openzfsonosx.zpool-import.plist

Code: Select all
        <string>org.openzfsonosx.zpool-import</string>
        <key>ProgramArguments</key>
        <array>
                <string>@sbindir@/zpool</string>
                <string>import</string>
                <string>-a</string>
                <string>-d</string>
                <string>/var/run/disk/by-id</string>
        </array>
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 30 guests