With the exception of partitions in unreadable formats and certain hidden partitions such as EFI and Recovery HD, the default behaviour of macOS is to mount all partitions of a drive on boot-up, login, or on connecting an external drive.
Whilst this behaviour is useful for the novice or for those connecting a single USB stick to copy some files, it can become unwieldy and even annoying if you have many multi-partitioned drives attached to your Mac.
For example, my desktop Hackintosh has three internal drives, each with at least two partitions, and one of these drives is not even needed when booted under macOS – it is for Windows 10 and Linux. Add to this a couple of external hard drives with partitions for storage, OS installers and Time Machine backups for other computers, and your desktop and Finder sidebar can begin to look a real mess. It also takes time for the drives to mount on every boot and unmount on sleep or shutdown.
This guide will detail how to ensure only the drives of your choosing mount automatically, leaving the rest unmounted within macOS.