Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have an external HDD with 4 partitions.

My question is the following: is there a way of telling the OS to mount just two of them (One FAT and one HFS+) when I connect the HDD? It is rather annoying to have 4 "disks" connected on the finder, and it makes ejecting the drive a test to my patience.

I would appreciate your suggestions. If it's impossible I guess I'll just have to fiddle around and get everything in 2 partitions... :/

share|improve this question
add comment

2 Answers

up vote 13 down vote accepted

Yes. You'll need to create a file called "fstab" in /etc if it is not already there:

sudo nano /etc/fstab

Next, we'll need the partitions Unique Universal Identifier (UUID). Open Disk Utility, and highlight the partition you'd like to no have auto-mounted. Then hit CMD+I and you'll be greeted with the following screen (notice the UUID highlighted):

Disk Utility Partition Information

We will then need to enter the following line into our fstab file. The following example will prevent my "Shockwave" partition from auto-mounting:

UUID=27C2148B-1734-3900-B89C-FE3EB7E11DBC    none   hfs   rw,noauto

Hit CNTRL+O to save when you're done. You can add as many as you like; one per line. Reboot and those partitions specified in fstab will not be mounted.

The UUID is the partitions unique identifier (consult the man-page below if you'd like to use device's label instead). The noauto tag tells OS X not to auto mount on load. You can still mount them using Disk Utility, but OS X won't do it for you initially.

If you'd like to learn more about fstab and what you can do with it, you can view it's respective man-page.

share|improve this answer
    
That is pretty much what I need, though it seems not to be working for me. Im writing the following: "UUID={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX} none hfs rw,noauto" but it doesent seem to work, are you sure this is teh syntax? –  kevin9794 Sep 9 '11 at 1:44
    
I have update the tutorial for you. Remember to remove the braces (e.g., UUID=9324-343224-2343) or it won't work! If it's still not working, ensure that you have the correct UUID. –  cksum Sep 9 '11 at 3:11
add comment

You can add entries in /etc/fstab to prevent volumes from mounting. This is similar to the technique @cksum describes. Here are some example one-liners. They will create an fstab file if it doesn't exist, otherwise they will append. You need admin privileges.

  1. Prevent an HFS (Mac) volume named Archive from mounting. If it is mounted manually, it will be Read/Write.

    echo "LABEL=Archive none hfs rw,noauto 0 0" | sudo tee -a /etc/fstab

  2. NTFS volume named BOOTCAMP. Read-only.

    echo "LABEL=BOOTCAMP none ntfs ro,noauto 0 0" | sudo tee -a /etc/fstab

  3. FAT32 volume named PMBPORTABLE. Read-only.

    echo "LABEL=PMBPORTABLE none msdos ro,noauto 0 0" | sudo tee -a /etc/fstab

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.