0

I am trying to mount a Linux SMB share onto a macOS machine running Ventura 13.4. I must have the share mounted after the macOS machine bootup is completed, but before any possible user has logged into the machine via the desktop UI. This is to permit SSH connections into the machine that perform maintenance and requires access to those Linux shares as local mounted folders. Per User scripts cannot help as we are using AD, and a user may not have ever logged into the machine at any time, plus the script must be run before the user has logged in.

I've tried using fstab: My command line equivalents for that with the mount command work, but fstab does not seem to be processed by macOS at startup any longer, so the fstab entries are ignored unless utilized with a manual command line of mount -a

I've also tried using a bash script launched at startup to utilize various combinations of launchd, including Library/LaunchAgents, System/Library/LaunchDaemons, Library/LaunchDaemons, and System/Library/LaunchAgents. Some of these will mount the share at startup, but none of them seem to mount the share before a user has logged into the UI.

Any suggestions on a solution that mount the share before the user has logged in?

12
  • Have you thought of using NFS in this scenario? NFS, though old, is a better fit for this type of “global” mount.
    – Allan
    Commented Jul 3, 2023 at 13:19
  • Why wouldn't this process that connects to the machine simply mount what it needs mounted, and unmount it when done? Commented Jul 3, 2023 at 14:00
  • Automatic network mounts are handled by autofs. All you should need to know is in the auto_master(5) man page.
    – Linc D.
    Commented Jul 3, 2023 at 14:30
  • Also LaunchAgents execute upon user login. Only LaunchDaemons will execute prior to user login but those run as root. Is there a reason you need the mount available prior to logging in?
    – Allan
    Commented Jul 3, 2023 at 15:04
  • @Allan: In addition to the stated Linux server, there are several other devices which do not support NFS, but do support SMB, so SMB is a requirement for us. Also Yes, it must mount before because the maintenances routines that are run via SSH must run after machines have been logged out and left in an "unlogged" state. Commented Jul 3, 2023 at 17:26

0

You must log in to answer this question.

Browse other questions tagged .