Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Understanding Mount process (when system starts up)

Hi,

I'm trying to understand (and influence) the process of mounting disks when the the system starts up.

Having a MacMini (late 2012) with two internal disks which I just upgraded to Catalina (10.15.7, booting from a new external SSD).


That seems to work fine and when the sytem comes up it mounts the two internal disks as wanted. But what I'm trying to achieve is to mount an additional external SSD automatically when the system starts up (i.e. without the need to login at the desktop. I usually just ssh to the machine if at all).


There is no problem to mount that SSD (journaled hfs) - either manually in a ssh session or automatically when login at the desktop.

Searching around in the WEB and in various man pages there are some hints using the fstab which would allow to do this and even use the Volume UUID and that would be handled by the "diskarbitrationd" (as

stated in the man pages for that daemon). But I don't get this working.


I used vifs to manipulate the fstab and added some entry there, like:

UUID=my-uuid-taken-from-diskutil-info-output /Volumes/MyVolume hfs


This entry doesn't make any difference, when booting, that SSD is not mounted. I still need to login. But in general the fstab has some impact. As soon as I added mount options in the fourth field this prevents to get the disk mounted at all. So it is not mounted when logged in and mounting manually (using diskutil) fails either.


I've noted that /etc is in fact a link to private/etc, so my guess is that /etc/fstab doesn't has any meaning when booting and that private fstab is considered (at least a bit) when login, but it doesn't understand mount options (nor the two other fields usually known in fstab).



And now the questions :-)

1. Is there any possibility to get an external disk mounted when the system starts up?

2. How to pass any mountoptions (besides the mount point) to "diskutil mount" ?

3. Haven't found another way to specify mount options, than using the mount command directly. But for that you need to determine the /dev/diskXXX entry first, create the directory and then doing the actual mount. (I have created a small script for that). But perhaps there is some other possibilty?

4. For the internal disks, is there any possibilty to change the mount options (lets say I want to add a nosuid or whatever)?


As a workaround for 1) I could use my script executed when the system comes up which probably would mean I need to create a launchd job .... haven't really looked into this yet.


Thanks in advance

Mac mini, macOS 10.15

Posted on Jun 21, 2021 10:25 AM

Reply
Question marked as Best reply

Posted on Jun 21, 2021 6:20 PM

Is the external drive encrypted?


What was the exact line you added to the "fstab" file? Either provide a screenshot or copy & paste the line here using the "Code Insertion" icon which looks like "<>".


Did you use the "vifs" command to edit the "fstab" file? To edit the "fstab" file you can use the following command (I've specified the "nano" editor as it is easier to use for most users than "vi/vim"):

EDITOR=nano  sudo  vifs



Similar questions

7 replies
Question marked as Best reply

Jun 21, 2021 6:20 PM in response to guarda-rios

Is the external drive encrypted?


What was the exact line you added to the "fstab" file? Either provide a screenshot or copy & paste the line here using the "Code Insertion" icon which looks like "<>".


Did you use the "vifs" command to edit the "fstab" file? To edit the "fstab" file you can use the following command (I've specified the "nano" editor as it is easier to use for most users than "vi/vim"):

EDITOR=nano  sudo  vifs



Jun 22, 2021 8:47 AM in response to HWTech

No, the drive is not encrypted.

And yes I used "sudo vifs" (I'm happy with vi)


I tried with various entries in the fstab:

 UUID=my-uuid-taken-from-diskutil-info-output /Volumes/MyVolume hfs


With that I can still use "diskutil mount MyVolume" explicitly, but when booting it is just ignored.

When I add additional fields to the fstab entry, like this:

UUID=my-uuid-taken-from-diskutil-info-output /Volumes/MyVolume hfs noowners

or this:

UUID=my-uuid-taken-from-diskutil-info-output /Volumes/MyVolume hfs noowners 0 2


it is still ignored when booting, but "diskutil mount MyVolume" fails with:

Volume on disk3s2 failed to mount
If you think the volume is supported but damaged, try the "readOnly" option


It is slightly different when using the Disk / Partition UUID instead of the Volume UUID. It is still ignored when booting, but it no longer prevents mounting the disk explicitly using diskutil mount. (But mountoptions are still ignored)



Jun 22, 2021 5:12 PM in response to guarda-rios

guarda-rios wrote:

I tried with various entries in the fstab:
UUID=my-uuid-taken-from-diskutil-info-output /Volumes/MyVolume hfs

With that I can still use "diskutil mount MyVolume" explicitly, but when booting it is just ignored.

Then try adding the options: "rw, auto"

UUID=my-uuid-taken-from-diskutil-info-output    /Volumes/MyVolume    hfs    rw,auto


Or you may want to use the "none" for the mountpoint to use the macOS default which I believe will mount the volume under "/Volumes" with the current volume name.

UUID=my-uuid-taken-from-diskutil-info-output    none    hfs    rw,auto


Jun 22, 2021 11:54 PM in response to HWTech

Then try adding the options: "rw, auto"
UUID=my-uuid-taken-from-diskutil-info-output /Volumes/MyVolume hfs rw,auto

Or you may want to use the "none" for the mountpoint to use the macOS default which I believe will mount the volume under "/Volumes" with the current volume name.
UUID=my-uuid-taken-from-diskutil-info-output none hfs rw,auto


Ah... The trick is to specify "none" as mount point. When specifying /Volumes/MyVolume it doesn't work, but with "none" it does.

I'm pretty sure I had also tested with "auto" - if not I was quite silly - but I definitively didn't test with "none" as mount Volume.


So this is solved, but I unfortunately clicked at the your first response to indicate that it is solved. Should be your second, but it seems I can't change this.


Anyway, Thanks for your help!

Jun 24, 2021 7:37 AM in response to guarda-rios

I know I experimented with that years ago and thought that if you manually created the mount point on "/Volumes" it would remain. I think it is only when macOS or other command line utility automatically "adds" a mount point that the mount point is temporary and disappears once the volume is unmounted. But I cannot recall for certain.

Understanding Mount process (when system starts up)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.