How to prevent a volume from mounting at boot in OS X

You can keep any combination of volumes from automatically being available for read and write in OS X.

OS X will automatically attempt to mount an attached volume when the system is started, and if successful the volume will appear in the Finder either in the sidebar or on your desktop if you have these options enabled. However, there may be instances such as in multi-boot environments when you might want a specific volume to remain unmounted.

With multiple boot volumes in a system, when loaded in one operating system it is relatively easy to access and edit important files on the boot disk of other operating systems. Therefore, keeping the unused boot drive unmounted may be a preferred setup. Additionally, if you have numerous storage volumes for each OS and only wish to use one or two for your current boot system, then you might wish to keep those from mounting as well.

To set OS X up so it does not mount a drive at boot, you will simply have to instruct it to do so in the system's hidden fstab file, which is used for customizing drive mount points and other details about how a specific filesystem is handled.

The first thing you will need is the volume's UUID (universal unique identifier) number, which can be found by opening Disk Utility, selecting the volume of interest, and then pressing Command-i or clicking the blue information button in the Disk Utility toolbar. In the window that appears, locate and copy the UUID, which looks like a string of alphanumeric characters separated by dashes.

With the UUID, you can now create an fstab entry for the volume that prevents it from mounting:

  1. Open the Terminal utility (in the /Applications/Utilities/ folder)
  2. Edit the fstab file by running the following command (supply your password when prompted):

    sudo pico /etc/fstab

  3. Create a new line at the end of the file that looks like the following (note: replace "NUMBER" with the full UUID string you copied from Disk Utility):

    UUID=NUMBER none hfs rw,noauto

  4. Save the file by pressing Control-O, followed by Control-X to quit the editor.

Perform these steps for each volume you wish to prevent automatically mounting, then restart the system, and they should no longer automatically mount. If you need to mount the volumes, then you can open Disk Utility and select them followed by clicking the Mount button in the toolbar, and they should become available in the Finder.



Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.

About the author

    Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.

     

    Join the discussion

    Conversation powered by Livefyre

    Don't Miss
    Hot Products
    Trending on CNET

    HOT ON CNET

    Looking for an affordable tablet?

    CNET rounds up high-quality tablets that won't break your wallet.