Announcement: Upgrade to macOS Mojave

With features like Dark Mode, Stacks, and four new built-in apps, macOS Mojave helps you get more out of every click. 
Find out how to upgrade to macOS Mojave > https://support.apple.com/macos/mojave

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

Question:

Question: How to hide/not mount a partition

I've recently added a new drive to my Mini and shuffled a lot of files around to different places - all successful so far.


The original "Macintosh HD" partion/volume is still there, but I'd like to make it "offline" so it's not mounted automatically at boot up. So it's safe in case of any problems.


I can eject a disk once the machine's booted up, I can unmount if from Disk Utility. But I can't see any way to tell OS X "don't mount this partition".

My inclination would be to go and fiddle with a file like /etc/fstab and comment out the entry, but fstab.hd just says "ignore me" and has no disk entries.

Any useful thoughts or suggestions?

Thanks,
James

Mac mini, OS X Mountain Lion (10.8.1)

Posted on

Reply
Question marked as Solved

Sep 6, 2012 6:48 AM in response to xxxxxxxxxxxxxxxxxxxxxxxxxxx In response to xxxxxxxxxxxxxxxxxxxxxxxxxxx

The following was just tested on 10.8.1 and works. I too, have that pesky second drive with ML on it.


As root, create the new file /etc/fstab. Ownership will be root:wheel 644 (-rw-r--r--).


Open Disk Utility, select Macintosh HD, and click Info. You want the UUID number of this particular disk.


In the following file, I use <space> nomenclature to represent a single space character.


# fstab

#

# Identifier mount point fs type options1

#

UUID=the UUID string of your Macintosh HD<space>none<space>hfs<space>rw,noauto


save and exit /etc/fstab.


Reboot.


Macintosh HD does not mount or display on desktop. It is however, visible in Disk Utility and can be mounted on demand.

Sep 6, 2012 6:48 AM

Reply Helpful

Sep 6, 2012 9:44 AM in response to xxxxxxxxxxxxxxxxxxxxxxxxxxx In response to xxxxxxxxxxxxxxxxxxxxxxxxxxx

An alternative to the suggestion of VikingOSX is to make a an AppleScript to perform unmounts at login time.


For a drive the script looks like this:


try

do shell script "/Usr/sbin/diskutil unmount \"Macintosh HD Clone\""

on error

display dialog "Unmount for macintosh HD Clone Failed"

end try


Save it as an App from Applescript and include it as a login item (Sys. Prefs ->Accounts -> Login items


I have a lot of drive I don;t want to accidently alter - backups, prior releases etc.

Sep 6, 2012 9:44 AM

Reply Helpful

Mar 7, 2013 1:26 PM in response to VikingOSX In response to VikingOSX

This does not work for me 😟 on my MBP 8.1 with OS X 10.8.2 (12C60)

I have a partition formatted to Mac OSX (Journaled, Encrypted) and my system keeps prompting for its password on boot.

I'd like my system to not attempt unlocking the partition on boot, but only when I open Disk Utility and click unlock.

Perhaps it does not work because the partition is encrypted?

Thx

Mar 7, 2013 1:26 PM

Reply Helpful

Apr 27, 2013 2:31 AM in response to VikingOSX In response to VikingOSX

The best procedure is to use fstab, but it requires Terminal:


Prevent a given partition from mounting at boot

http://hints.macworld.com/article.php?story=20060930150059172


Could someone please indicate a step-by-step guide for newbies on Terminal? Thanks.

Apr 27, 2013 2:31 AM

Reply Helpful

Apr 28, 2013 8:23 AM in response to ApMaX In response to ApMaX

Launch terminal, then:


sudo nano /etc/fstab


Press enter. It will prompt you for your administrator password, type it and enter (don't worry if you can't see if you are actually typing anything).


You will be in nano editor, now you have to write the desired configuration. In my case the partition I don't wanna be mounted is called "Arch". I must open "Disk Utility" and then search on the left bar the partition, select it and press CMD+I. Search for the UUID (Universal Unique Identifier) and copy it, mine was: 3CA41C88-3E86-3A39-88CE-9379FF44B6A5


Go back to terminal and write:


# fstab

#

# Identifier mount point fs type options1

#

UUID=3CA41C88-3E86-3A39-88CE-9379FF44B6A5 none hfs rw,noauto


Remember to change my UUID with the UUID of your partition. Once you've finished editing the document you moust press CRTL+O (to save changes) and then press CRTL+X to quit nano editor.

Apr 28, 2013 8:23 AM

Reply Helpful (1)

Apr 28, 2013 4:04 PM in response to sadhuram In response to sadhuram

sadhuram, many thanks. I will appreciate your feedback on these three things:


1. FIRST


After

sudo nano /etc/fstab

I pressed the carriage return and I got something like this (without the lines ---):


--------------------------------------------------

UUID=3C236DAC-45CD-8ADB-8J8A-KI87K756L875 none hfs rw,noauto

UUID=9DKL76JH-859G-9865-87L7-TN59694I6K47 none hfs rw,noauto

--------------------------------------------------


and then I pasted below what you indicated to read (without the lines ---):


--------------------------------------------------

UUID=3C236DAC-45CD-8ADB-8J8A-KI87K756L875 none hfs rw,noauto

UUID=9DKL76JH-859G-9865-87L7-TN59694I6K47 none hfs rw,noauto

# fstab

#

# Identifier mount point fs type options1

#

UUID=U4766497-8TBE-9Y79-M4IH-K7OT4G49475H none hfs rw,noauto

--------------------------------------------------


I understand that it is not required to press the carriage return after pasting that.


If now I press/type:

ctrl O

nothing happens.


If then I press/type:

ctrl X

nothing happens either.


2. SECOND

Imagine that the booting OS X 10.8.3 above is an external disk used to boot two different iMacs (one at work and other at home, for instance). One iMac has the UUID indicated above, but the other has a different UUID, of course. How to prevent that none of such internal Mac hard disks automounts when either of the iMacs (at work or at home) is booted from the external disk?


3. THIRD

On the other hand, how to reverse the unmount feature and make such iMac internal disks automatically mount (if required in the future)? In other words, how to revert this change if required in the future?


Thanks again.

Apr 28, 2013 4:04 PM

Reply Helpful

Apr 29, 2013 9:24 PM in response to ApMaX In response to ApMaX

When I press CRTL+O something does happen. These three lines appear at the bottom of the window;


File Name to Write: /etc/fstab

^G Get Help ^T To Files M-M Mac Format M-P Prepend

^C Cancel M-D DOS Format M-A Append M-B Backup File


But then pressing CRTL+X doesn't exit me from nano editor. I causes the error sound. Did sadhuram omit a step, or is my attempting this in OSX 10.6.8 the error?

Apr 29, 2013 9:24 PM

Reply Helpful

Apr 29, 2013 9:41 PM in response to Eric Root In response to Eric Root

Eric Root wrote:


May I politely suggest you start a new discussion. Since this one is marked as solved, many people may not read it. You might get help faster.

Others please take note of what Eric said. You are only confusing a tread which has been marked as solved by the original poster. Try starting your own threads and explain your exact issues and you are more likely to get a helpful response.


Cheers


Pete

Apr 29, 2013 9:41 PM

Reply Helpful

Apr 29, 2013 10:18 PM in response to petermac87 In response to petermac87

@petermac87: I don't think a strand should end just because the original poster says his question has been answered. Others who share the original poster's question might not be satisfied by the answer. Maybe they find the answer too difficult to execute. A strand that doesn't veer off course but pursues the original question further should go on. In this strand it went on to include sadurham's useful variation on VikingOSX's solution.

Apr 29, 2013 10:18 PM

Reply Helpful
User profile for user: xxxxxxxxxxxxxxxxxxxxxxxxxxx

Question: How to hide/not mount a partition