![]() |
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*. Code:
sudo vifs Code:
# Identifier, mount point, fs type, options 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 Code:
LABEL=<drive name> none msdos rw,noauto Code:
LABEL=<drive name> none ntfs ro,noauto Also, you might find that /etc/fstab is ignored and your partition still mounts. Two things you can try:*
|
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.
|
you can use "boot uuid=xxxx-xxx-xxxx..." like an kernel flag in boot.plist for boot leopard from a software raid for example.
|
can you do this if you have leopard and vista on the same hd
|
Unmounting at startup? Yes.
|
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 |
you have to click on menu at top of screen, then file, then get info
|
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 Quote:
|
On partition not drive
Strange comes up between Writable : Yes and Capacity : 100.7 GB (108,162,580,480 Bytes) |
try in terminal
diskutil info diskXsY |
look at my above post i put in bold where it should be compared with my leo partition ^^^^^
|
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 |
don't know then guess it doesn't have one lol!
|
NTFS-3G
wonder if this is the cause? I gather you installed macfuse |
but it should right???
|
Yea i sure did and it works great
Quote:
|
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.
|
i could try it thanks for the tip
|
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.
|
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. :) |
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. Code:
sudo vifs Code:
sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool true Also, MacFUSE/NTFS-3G is awesome, a little slow compared to the normal NTFS-3G but still. |
Cheers Dies i didn't know about vifs. Guide updated. :)
|
Quote:
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 |
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?
|
Label will work, but you'll also need to change the fs type to ntfs:
Code:
LABEL=name_of_volume none ntfs ro,noauto |
Can I use this tutorial for a Fat16 partition? :)
|
how do i save the command after i have written in what i want?
|
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. |
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. |
Have you tried using none for the mount point?
|
Quote:
|
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. |
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) :o:
Code:
LABEL=WinXp none ntfs ro,noauto |
Quote:
/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 |
Quote:
Quote:
|