Mac OS X on x86 Hardware 2008–2024 Technical Archive
InfiniteMac OSx86 › OSx86 Core & 10.X › Prevent a partition from mounting at boot
21,567 reads · 2008-03-22 – 2009-01-10
Guide 10.X Core Retail DVD / USB

Prevent a partition from mounting at boot

This tutorial is great for keeping your desktop tidy by unmounting drives you don't need regular access to. For example this could be your Windows drive, Tiger partition etc. I thought this could be added to the wiki, i'm sure others would…

Primary Author
@Voyn1x Published 2008-03-22
Collection
OSx86 Core & 10.X
Archival Footprint
21,567 historical reads · 23 curated field notes (from 35 dispatches) · 2008-03-22 – 2009-01-10
Credited Voices (11)
@bhast2 (8)@Voyn1x (6)@Ianxxx (6)@demigod (4)@agrafuese (3)@Dies (2)@Aydinz (2)@roisoft@zuz242@scififan68@nfoav8or

This tutorial is great for keeping your desktop tidy by unmounting drives you don't need regular access to. For example this could be your Windows drive, Tiger partition etc. I thought this could be added to the wiki, i'm sure others would find this useful

First get the UUID of a volume you wish to stop mounting - this can be seen in Disk Utility (click the Info button and find the Universal Unique Identifier).

Now that you have a UUID for the volume to hide during the mount process, from an admin account create your /etc/fstab file (in Leopard this file doesn't exist by default):

From Leopard on you need to use vifs to create and edit /etc/fstab, or at least you should*.

sudo vifs

Add a line with the UUID for your volume and the mounting point information, for example:

# Identifier,  mount point,  fs type,  options
UUID=F0E430C1-5558-3BB3-9FA9-6904B663FEEA  none  hfs  rw,noauto

The Identifier is used to identify the volume.

The mount point is the directory used when the volume is mounted; set none to use the pre-defined OS X directory, i.e. ./Volumes/

The fs type describes the type of the filesystem; use hfs for a Mac volume, use ntfs if it's a NTFS formatted PC volume. The field options describes the mount options associated with the filesystem. 'noauto' will force the volume not to be mounted automatically; and last, use 'rw' or 'ro' for a read-write or read-only disk.

One thing to note is that FAT32 and NTFS formatted volumes are not assigned a UUID. You'll have to use LABEL instead of UUID and change the fs type to 'msdos' or 'ntfs'. NTFS volumes are mounted read only under os x, so you'll also have to change the option from 'rw' to 'ro'.

eg.

FAT32

LABEL=<drive name> none msdos rw,noauto

NTFS

LABEL=<drive name> none ntfs ro,noauto

Save the file and reboot (for internal drives) or unmount, disconnect and reconnect the volume (for external drives). Now the system should not mount the partition identified in fstab. You can still manually mount the volume in Disk Utility, or via the command line (and for a volume containing a boot system, rebooting from it).

Also, you might find that /etc/fstab is ignored and your partition still mounts. Two things you can try:*

  1. sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool true

  2. Instead of using "none" for the mountpoint use the normal location i.e. /Volumes/WindowsXP along with the ro,noauto options.

Author Updates & Technical Revisions

Follow-up dispatches by @Voyn1x

Author Update #1 @Voyn1x 2008-03-25

Oops yep forgot to say FAT32 formatted volumes are not assigned a UUID. You'll have to use LABEL instead of UUID and change the fs type to 'msdos'.

eg. LABEL=WINDOWSXP none msdos rw,noauto 0 0

'WINDOWSXP' is replaced with your drive name.

Author Update #2 @Voyn1x 2008-09-18

Cheers Dies i didn't know about vifs. Guide updated.

Author Update #3 @Voyn1x 2008-10-30

Label will work, but you'll also need to change the fs type to ntfs:

LABEL=name_of_volume none ntfs ro,noauto

I'm going to update the first post with this.

Author Update #4 @Voyn1x 2009-01-09

Try setting the drive to read only as it's ntfs. Also i've removed the zeros as they're not meant to be there, oops (i've updated the first post) :

LABEL=WinXp none ntfs ro,noauto

[Edit] Follow dies instructions if you've got ntfs-3g installed, but still remove the zeros

Synthesized Community Field Notes

23 technical responses curated from 35 original dispatches

Field Note #1 @agrafuese 2008-03-25

Hey good tip. I used to do this when I had other drives in my system, but I never knew about the UUID method. I only ever used the name of the volume in the command, but that's not as good because it could always change (accidentally or intentionally). It's also a hassle because you have to type in space characters if your volume name has a space in it. Thanks.

Field Note #2 @roisoft 2008-03-25

you can use "boot uuid=xxxx-xxx-xxxx..." like an kernel flag in boot.plist for boot leopard from a software raid for example.

Field Note #3 @bhast2 2008-03-25

can you do this if you have leopard and vista on the same hd

Field Note #4 @bhast2 2008-03-25

so where is the uuid number because i can't find it for my windows partition?

cause this is all it show in disk utility
Name : disk0s2
Type : Volume

Disk Identifier : disk0s2
Mount Point : /Volumes/Untitled
File System : Windows NT Filesystem 3G
Connection Bus : ATA
Device Tree : /PCI0@0/SAT1@8/PRI0@0/@0:2
Writable : Yes
Capacity : 100.7 GB (108,162,580,480 Bytes)
Free Space : 69.6 GB (74,690,961,408 Bytes)
Used : 31.2 GB (33,471,614,976 Bytes)
Number of Files : 81,378
Number of Folders : 0
Owners Enabled : Yes
Can Turn Owners Off : No
Can Repair Permissions : No
Can Be Verified : Yes
Can Be Repaired : Yes
Can Be Formatted : Yes
Bootable : No
Supports Journaling : No
Journaled : No
Disk Number : 0
Partition Number : 2

Field Note #5 @Ianxxx 2008-03-25

you have to click on menu at top of screen, then file, then get info

Field Note #6 @bhast2 2008-03-25

that is what i am clicking and that is what it shows
ok it will show it for my leopard partition but there isn't one for my windows partition
Leo partition
Name : Leo
Type : Volume

Disk Identifier : disk0s3
Mount Point : /
File System : Mac OS Extended (Journaled)
Connection Bus : ATA
Device Tree : /PCI0@0/SAT1@8/PRI0@0/@0:3
Writable : Yes
Universal Unique Identifier : CBA0AF8F-B8BE-37BF-B765-78C3C0CAF3D9
Capacity : 197.0 GB (211,566,379,008 Bytes)
Free Space : 183.7 GB (197,253,259,264 Bytes)
Used : 13.3 GB (14,313,119,744 Bytes)
Number of Files : 380,148
Number of Folders : 93,242
Owners Enabled : Yes
Can Turn Owners Off : Yes
Can Repair Permissions : Yes
Can Be Verified : Yes
Can Be Repaired : Yes
Can Be Formatted : Yes
Bootable : Yes
Supports Journaling : Yes
Journaled : Yes
Disk Number : 0
Partition Number : 3

windows partition
Name : disk0s2
Type : Volume

Disk Identifier : disk0s2
Mount Point : /Volumes/Untitled
File System : Windows NT Filesystem 3G
Connection Bus : ATA
Device Tree : /PCI0@0/SAT1@8/PRI0@0/@0:2
Writable : Yes
IT SHOULD BE RIGHT HERE BUT IT IS MISSING
Capacity : 100.7 GB (108,162,580,480 Bytes)
Free Space : 69.6 GB (74,690,961,408 Bytes)
Used : 31.2 GB (33,471,614,976 Bytes)
Number of Files : 81,378
Number of Folders : 0
Owners Enabled : Yes
Can Turn Owners Off : No
Can Repair Permissions : No
Can Be Verified : Yes
Can Be Repaired : Yes
Can Be Formatted : Yes
Bootable : No
Supports Journaling : No
Journaled : No
Disk Number : 0
Partition Number : 2

[cite] Ianxxx:you have to click on menu at top of screen, then file, then get info
Field Note #7 @Ianxxx 2008-03-25

On partition not drive
Strange comes up between Writable : Yes
and
Capacity : 100.7 GB (108,162,580,480 Bytes)

Field Note #8 @bhast2 2008-03-25

look at my above post i put in bold where it should be compared with my leo partition ^^^^^

Field Note #9 @bhast2 2008-03-25

this is what it shows in terminal
bill-hasts-macpro31:~ billhast$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *298.1 Gi disk0
1: EFI 200.0 Mi disk0s1
2: Microsoft Basic Data 100.7 Gi disk0s2
3: Apple_HFS Leo 197.0 Gi disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *186.3 Gi disk1
1: Apple_HFS Stuff 186.3 Gi disk1s1
bill-hasts-macpro31:~ billhast$ diskutil info disk0s2
Device Identifier: disk0s2
Device Node: /dev/disk0s2
Part Of Whole: disk0
Device / Media Name: Untitled

Volume Name:
Mount Point: /Volumes/Untitled
File System: NTFS-3G

Partition Type: Microsoft Basic Data
Bootable: Is bootable
Media Type: Generic
Protocol: ATA
SMART Status: Verified

Total Size: 100.7 Gi (108162576384 B) (211255032 512-byte blocks)
Free Space: 69.6 Gi (74690961408 B) (145880784 512-byte blocks)

Read Only: No
Ejectable: No
Whole: No
Internal: Yes

bill-hasts-macpro31:~ billhast$

Still not there how can the be it should have a uuid number right

Field Note #10 @Ianxxx 2008-03-25

NTFS-3G
wonder if this is the cause?
I gather you installed macfuse

Field Note #11 @bhast2 2008-03-25

Yea i sure did and it works great

[cite] Ianxxx:NTFS-3G wonder if this is the cause? I gather you installed macfuse
Field Note #12 @Ianxxx 2008-03-25

well I can only think that that is the cause, can you not use the partition name, I think someone suggested that in this thread.

Field Note #13 @agrafuese 2008-03-25

yeah that'll work for ya bhast. just make sure you don't accidentally rename your partitions at any point otherwise they'll pop up again if you have spaces in the names too, post back in here and i'll let you know how to handle that (i'm blanking at the moment, but i can look it up). good luck.

Field Note #14 @Dies 2008-09-18

Yes, just using labels is much easier to wrap your head around, easier to set and easier to remember. UUID must have some advantages over labels since everything is moving in that direction but I haven't found them yet.

Two things I found out while excluding my Windows partition from mounting. Thought maybe they could be added to the first post so others don't have to go searching?

From Leopard on you need to use vifs to create and edit /etc/fstab, or at least you should.

sudo vifs

Also, you might find that /etc/fstab is ignored and your partition still mounts. Two things to try

sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool true

Instead of using "none" for the mountpoint use the normal location i.e. /Volumes/WindowsXP along with the ro,noauto options.

Also, MacFUSE/NTFS-3G is awesome, a little slow compared to the normal NTFS-3G but still.

Field Note #15 @zuz242 2008-10-17 ↳ Re: @Voyn1x
@Voyn1xFrom Leopard on you need to use vifs to create and edit /etc/fstab, or at least you should]

Well, nice tutorial but it took me a while to get vifs to do what i wanted.
I had no idea of the commands used in the vi(fs) editor. Google helped

But maybe you could add the 3 commands for vi in your tut.
"i" for insert mode,
"esc" for switching back to command mode
":wq" for saving

Field Note #16 @Aydinz 2008-10-30

can the label option be used for NTFS as well? because one of my NTFS drives doesnt have a UUID. and also just so im clear i enter "sudo vifs" into terminal put in the label commands to unmount the disks then type is :wq to save the file and then reboot my system and it should all work?

Field Note #17 @Aydinz 2008-10-31

how do i save the command after i have written in what i want?

Field Note #18 @nfoav8or 2008-10-31

1. shift+"i" to insert/edit text.
2. edit
3. esc to quit the editing/insertion.
4. ":s /etc/fstab" to save over the old fstab.

do it in this order.

Field Note #19 @demigod 2009-01-09

i added LABEL=WinXp /Volumes/WinXp/ ntfs rw,noauto 0 0
this in /etc/fstab using sudo vifs and also executed this "sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool true" in terminal still it's not unmounting it automatically..

what should i do to unmount it automatically.

Field Note #21 @Dies 2009-01-09

demigod

Can you post the output from

diskutil list

Also, is there a reason you have "rw" in your fstab options? Does this mean you have NTFS-3G installed? If so, you need to make the filesystem type in fstab "ntfs-3g" and not simply "ntfs".

Also make sure you have an empty line at the end of fstab.

Field Note #22 @demigod 2009-01-10 ↳ Re: @Dies
@Diesdemigod Can you post the output from diskutil list Also, is there a reason you have "rw" in your fstab options? Does this mean you have NTFS-3G installed? If so, you need to make the filesystem type in fstab "ntfs-3g" and not simply "ntfs". Also make sure you have an empty line at the end of fstab.
diskutil list

/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *74.5 Gi disk0
1: Apple_HFS Mac HD 74.5 Gi disk0s1
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *149.0 Gi disk1
1: DOS_FAT_32 WinXp 47.8 Gi disk1s1
2: Apple_HFS Storage 101.2 Gi disk1s5

i forgot to mention that i have NTFS-3G installed.Let me try "ntfs-3g" option

why WinXp is marked as DOS_FAT_32 partition ? it is a NTFS type

Field Note #23 @demigod 2009-01-10 ↳ Re: @Dies
@Diesdemigod Can you post the output from diskutil list Also, is there a reason you have "rw" in your fstab options? Does this mean you have NTFS-3G installed? If so, you need to make the filesystem type in fstab "ntfs-3g" and not simply "ntfs". Also make sure you have an empty line at the end of fstab.
@Voyn1xTry setting the drive to read only as it's ntfs. Also i've removed the zeros as they're not meant to be there, oops (i've updated the first post) : LABEL=WinXp none ntfs ro,noauto [Edit] Follow dies instructions if you've got ntfs-3g installed, but still remove the zeros

Thank you both it worked out.i followed Dies and Voynx method

Corroborated & Participated: @agrafuese @Ianxxx @bhast2 @scififan68
Sources & Contributor Provenance (11 credited usernames · Thread #801)
UsernameDossier ContributionDispatchesActive Window
@bhast2Core Contributor82008-03-25
@Voyn1xPrimary Author62008-03-22 → 2009-01-09
@IanxxxCore Contributor62008-03-25
@demigodCore Contributor42009-01-09 → 2009-01-10
@agrafueseCore Contributor32008-03-25
@DiesContributor22008-09-18 → 2009-01-09
@AydinzContributor22008-10-30 → 2008-10-31
@roisoftContributor12008-03-25
@zuz242Contributor12008-10-17
@scififan68Contributor12008-10-31
@nfoav8orContributor12008-10-31