0

I noticed that after a system reboot my new USB SSD (SanDisk Extreme Portable SSD) attached via USB-C to an MacMini 2020 is not available until the first user has logged on (interactively using the GUI).

On this MacMini a daemon is running which requires access to the external USB drive directly after a reboot before any user has logged on (because this MacMini runs at server and therefore nobody ever will login).

What do I have to configure in Catalina to make my USB SSD available before the first user has logged on?

The daemon that should use the external SSD is started via registered plist in /Library/LaunchDaemons/ using the following flags:

<key>RunAtLoad</key><true/>
<key>UserName</key><string>myuser</string>
<key>SessionCreate</key><true/>

I have formatted the external SSD as APFS (case sensitive).

5
  • Have you disengaged Secure Boot? It may be that the T2 Minis are designed not to let this happen. What's the daemon do? Any reason whatever it needs can't be on the system volume? What happens if the USB is not plugged in?
    – benwiggy
    Jul 20, 2020 at 11:43
  • @benwiggy: Sorry my question may be formulated a bit unclear, I have added information on the daemon and how it is started. And the SSD only is mounted if a user logs in interactively using the GUI. Login via SSH has no effect.
    – Robert
    Jul 20, 2020 at 11:52
  • If I'm not mistaken, you have to put the USB mount point in your fstab so that it mounts at boot as a particular user and permissions. I only have my iPad at the moment, do I can’t test it out and write it up at the moment.
    – Allan
    Jul 20, 2020 at 12:00
  • @Allan I tried to use fstab but mounting the volume based on it's UUID to /Volumes/SSD nothing happened. Then I found the solution shown in my answer.
    – Robert
    Jul 20, 2020 at 14:42
  • I'll have to try that out. Seems pretty cool.
    – Allan
    Jul 20, 2020 at 14:57

1 Answer 1

2

Seems that MacOS has an option to do exactly what I need:

sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool YES

Afterwards my external SSD is directly accessible by the daemon (if I wait some seconds because the daemon starts before the external SSD has been mounted). Additionally the external SSD is not accessible at all (independent of the user permissions). To finally get access I had to add my daemon (in this case the java executable) Full Disk Access in the MacOS security settings.

1
  • Nice find. The old school way was with fstab, but I just tried this method out and it works smoothly. +1
    – Allan
    Jul 20, 2020 at 19:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .