How can I, on a M! Pro MacPro running Monterey, prevent the OS from automatically mounting certain drives when connected?
Background: I have a CalDigit Thunderbolt dock, to which Time Machine drives for me and my wife are connected. When I connect my computer, I do not need (want) her drives to mount automatically.
You could write an AppleScript that automatically disconnects the drive after it’s mounted, and have it run via Keyboard Maestro whenever that drive attaches. But it would still mount for a couple seconds.
The Unix way would be to add a noauto flag in /etc/fstab, something that’s covered in the first answer, though Apple sometimes diverges from the Unix way for Apple reasons. (I think this will work though)