Preventing disks mounting at startup

Prevent a volume from mounting at startup - Apple Community


The excellent article linked above is very informative but doesn't cover what to do if the drives in question aren't HFS or APFS, but Linux drives.

I have my (very old) Mac set up to dual boot Linux - I have one 500GB SSD with OSX installed and another 500GB SSD with Linux Fedora 36 installed, plus a 4TB Hard drive that holds media for the Fedora system.


I want to avoid getting the dialogue from MacOS Finder on start up that states that the other disks are unreadable and invites me to eject, initialise or ignore. Ideally I just want MacOS to automatically ignore the Linux drives. This is because it wouldn't be wise to trust other family members not to initialise the Linux drives, plus it's just clunky getting the dialogue all the time.


So assuming the way forward is to create and edit etc/fstab my questions are:

1) If I boot into Linux and note the relevant drive's UUID numbers, can I then use these numbers in MacOS's etc/fstab file or do the UUIDs have to come from MacOS? i.e. are UUIDs "portable"?


2) With regard to the section of the article that's:

UUID=FF9DBDC4-F77F-3F72-A6C2-26676F39B7CE none hfs rw,noauto

or

UUID=FF9DBDC4-F77F-3F72-A6C2-26676F39B7CE none apfs rw,noauto


is it as simple as swapping hfs or apfs for ext4? Or do I need to do something different?


3) Do I need to repeat the process for partition UUIDs or is the UUID for each drive sufficient?

Thanks

Julian



Mac Pro, OS X 10.11

Posted on Dec 4, 2022 5:07 AM

Reply

Similar questions

3 replies

Dec 4, 2022 7:59 AM in response to Julian Morgan

Since Apple does not design macOS to be LInux filesystem aware, there is no supported filesystem type for it in the third fstab field, and without that, I doubt that even with the correct UUID entry, it may not be sufficient to suppress mounting that Linux partition, or blowing up the entire fstab processing.


If you haven't already, a review of the fstab man page may be in order.


Dec 6, 2022 7:12 PM in response to Julian Morgan

As mentioned in the linked article, you need to use the UUID associated with the volume (aka partition).


Like @VikingOSX, I doubt you can do this for a Linux file system since macOS has no idea about any of the Linux file systems, however, you can try using one of the ones recognized by Apple. Since you are not trying to mount the file system, it may be sufficient for what you want to achieve. It may only actually reference the UUID and the options ("noauto")...I don't see any reason it needs to do anything else at that point, but I also don't know how this function works at the lower level.


macOS suggests using the "vifs" utility to edit the "fstab" file. This utility locks the file for editing. By default it utilizes the "vi" or "vim" command line text editor which is very difficult to use if you are not already familiar with it. I personal prefer using the "nano" command line text editor as it is much easier to understand and use. You can tell macOS to use the "nano" text editor by using the following command (omit the "EDITOR=nano" if you prefer to use "vi" text editor):

EDITOR=nano  sudo  vifs


Otherwise, you should move your data to another compatible volume so you avoid these issues.


Personally I would not want to allow other users access to any of my external drives so it would be best not to have them connected at all when other users are using your Mac. In fact, those other people should use their own separate "Standard" macOS user account or Guest account so they cannot damage any files or settings on your computer or within your home user account. You may even be able to limit a "Standard" macOS user account from even accessing any external drives (perhaps with options configured from the admin account or perhaps even some Management Profiles.....I'm not personally familiar with either option as I don't use either one for custom configurations).


Dec 7, 2022 4:29 AM in response to HWTech

Hi there - THANK YOU so very much for walking me through this.

I'm familiar with nano and while I'd heard of vim, haven't used it, so I'm very happy to discover I can just use nano!

This old Mac is being repurposed to keep it out of e-waste, mostly because I'm extremely sentimental about it :)


The user account on it will essentially make it easier for my disabled wife to access her emails and iMessages on the rare occasions she's well enough to spend some time in our living room - as a Mac Pro, the drives are in its internal sleds (so aren't external) and the person using it in "Mac" mode, my wife, is very responsible and only accessing her own account.


My child and his friends will be primarily be using it in "Linux gaming" mode to play various retro and 32bit games not playable on Macs since Mojave and which Linux does a very good job of making accessible. Linux also typically does a good job of just ignoring entire drives it cannot read, such as HFS+ and APFS volumes.


Worse case scenario is I muck something up editing the etc/fstab file and have to reinstall either a freely available Linux distro or MacOS - both of which are already backed up anyway.


Thanks again - I'll give it a whirl :)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Preventing disks mounting at startup

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