Automount apparently failing

All your general support questions for OpenZFS on OS X.

Automount apparently failing

Postby frank » Mon Dec 30, 2019 7:24 am

Hi All,

O3X noob here, but long-time ZoL (and FUSE predecessor) user. I'm trying to setup a mirrored vdev on dual SSDs in an old MBPro with enough space for two 2.5 inch drives.

Problem number 1: I tried (and failed) to get the boot-on-zfs instructions to work for me. (I needed to go to single-user mode to try and juggle some zfs/zpool things for my mirrored SSDs, but the zpool and zfs commands in the small boot partition were not signed or something. I can attempt to re-create if people are interested in the exact error message.

Problem number 2 (ongoing): I eventually abandoned that approach, and went to an APFS partition for macos Mojave, with a zfs filesystem for /Users/<username>. Obviously, if /Users/<username> is not mounted at boot-time, chaos breaks loose with new <username> directories being created in the APFS /Users directory. Not good.

I believe that I have set everything correctly for o3x to automount that /Users/<username> directory, but that is failing to happen at boot time. I think the relevant things are:
Code: Select all
canmount = on
mountpoint = /Users/<username>

A possible wrinkle: the zfs filesystem is at tank/HOME/username but tank/HOME has canmount=off and mountpoint=none.

In any case, I'm trying all kinds of workarounds (launchd things to mount at boot) but the only reliable thing I've found so far is to mount by hand at boot time from another administrator account on the mac. Ugly, forgetfulness prone, but effective.

I thought I'd ask here for aid in this automount failure (do I have a misconfiguration???) before putting too much more effort into getting the launchd stuff working. That way, if the root cause is actually a o3x bug, others will eventually benefit from the fix.

Of course, I am ready to be a designated tester for any fixes from o3x, if the problem indeed lies there.

TIA for any help you might be able to provide!
frank
 
Posts: 3
Joined: Fri Dec 27, 2019 4:39 pm

Re: Automount apparently failing

Postby lundman » Sun Jan 05, 2020 4:10 pm

The boot issue, signing etc, I believe I managed to correct in the latest version - there is a delicate balance between what must be signed, and a few things that can not be signed.

Home directory, I know there are a few people here that keep their home directory on ZFS, but I was under the impression that some recommend keeping a normal home directory, but
symlinking areas you want on ZFS.

/Users/lundman/Movies -> /Volumes/tank/movies
User avatar
lundman
 
Posts: 729
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: Automount apparently failing

Postby frank » Fri Jan 17, 2020 7:10 pm

OK, just in case this saves someone else some pain, here is a launchd plist (living in /Library/LaunchDaemons) that "Works for Me"™. I'm using the (marvelous) LaunchControl to manage that, and I believe that the crucial executable /usr/local/bin/fdautil comes from LaunchControl. (Just a happy user...)

There is a slight delay on reboot, so in fact all this does for me is avoid having to manually do the mount from another account. There may still be a pseudo race condition between the time your name appears on the login screen and the time the mount occurs, so patience is counseled for logging in after a reboot.

There are likely to be cleaner ways of doing this, but this is what I kludged up.

Good luck...

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>EnvironmentVariables</key>
   <dict>
      <key>PATH</key>
      <string>/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin</string>
   </dict>
   <key>GroupName</key>
   <string>wheel</string>
   <key>InitGroups</key>
   <true/>
   <key>Label</key>
   <string>local.mountzfs.frank</string>
   <key>ProgramArguments</key>
   <array>
      <string>/usr/local/bin/fdautil</string>
      <string>exec</string>
      <string>/bin/sh</string>
      <string>-c</string>
      <string>sleep 5 &amp;&amp; /usr/local/bin/zfs mount -a</string>
   </array>
   <key>StandardErrorPath</key>
   <string>/tmp/local.mountzfs.frank.err</string>
   <key>StandardOutPath</key>
   <string>/tmp/local.mountzfs.frank.out</string>
   <key>UserName</key>
   <string>root</string>
   <key>WatchPaths</key>
   <array>
      <string>/var/run/org.openzfsonosx.zpool-import-all.didRun</string>
   </array>
</dict>
</plist>
frank
 
Posts: 3
Joined: Fri Dec 27, 2019 4:39 pm


Return to General Help

Who is online

Users browsing this forum: Bing [Bot] and 3 guests

cron