Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

koesherbacon

macrumors member
Original poster
Jun 5, 2009
30
0
Hi everyone,

I'm new here, and could not find an answer to this question anywhere. If it has already been addressed, please point me in the right direction.

Anyways, I'm wondering if it is possible to automatically eject my Windows volume I created using Boot Camp upon logging into OS X 10.5.7? Its not a huge deal, but a little tiresome always having to do this when I log in. If it is, how do I go about setting this up?

Thanks!
 
I don't always *have* to eject it; I just don't like having a volume mounted that I never use.
 
No problem. Step by step instructions:

Fire up the terminal (/Applications/Utilities/Terminal) and run this command:
Code:
diskutil list
It should show you something like this:
Code:
Tardis:~ Ted$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *465.8 Gi   disk0
   1:                        EFI                         200.0 Mi   disk0s1
   2:                  Apple_HFS Macintosh HD            250.0 Gi   disk0s2
   3:       Microsoft Basic Data BOOTCAMP                215.3 Gi   disk0s3
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *465.8 Gi   disk1
   1:                        EFI                         200.0 Mi   disk1s1
   2:                  Apple_HFS Storage                 465.4 Gi   disk1s2
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *465.8 Gi   disk2
   1:                        EFI                         200.0 Mi   disk2s1
   2:                  Apple_HFS My Passport             465.4 Gi   disk2s2
Tardis:~ Ted$
Now, look for the Microsoft Basic Data drive, in my case its #3 on /dev/disk0. That means that the disk identifier is disk0s3.

Now, go back to the terminal and run this command:
Code:
diskutil info disk0s3
Please note that you'll have to put the disk identifier of YOUR drive. It might be different than mine, but chances are it's the same. It should show you something like this:
Code:
Tardis:~ Ted$ diskutil info disk0s3
   Device Identifier:        disk0s3
   Device Node:              /dev/disk0s3
   Part Of Whole:            disk0
   Device / Media Name:      DOS_FAT_32_Untitled_2

   Volume Name:              BOOTCAMP
   Mount Point:              
   File System:              NTFS

   Partition Type:           Microsoft Basic Data
   Bootable:                 Is bootable
   Media Type:               Generic
   Protocol:                 SATA
   SMART Status:             Verified
   Volume UUID:              1AED6166-2505-4FEE-BFCB-CB3C7D3AC1E6

   Total Size:               215.3 Gi (231188844544 B) (451540712 512-byte blocks)
   Free Space:               0.0 B (0 B) (0 512-byte blocks)

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

Tardis:~ Ted$
Note the section "Volume UUID" ... this is the UUID of your Windows partition. Select the UUID and copy it with CMD+C. The UUID is the "1AED6166-2505-4FEE-BFCB-CB3C7D3AC1E6" part.

Now, we're going to write to the file system table, and tell it NOT to mount that partition upon login. To do that, we're going to use vim, a fantastic command line text editor.

Run this command to create and open the file /etc/fstab so that you can add some text to it:
Code:
sudo vim /etc/fstab

You will have to type your password to continue. This is normal, we need super user privileges to write to /etc/fstab ... please note that as you type your password, asterisks will NOT show for the letters that you type.

Do exactly what I tell you to do from this point on, and all will be well. I can help you further if you're having trouble figuring it out.

Press "i" ... this will put you into "insert mode" in vim, so that you may type some stuff. Now, type this:
Code:
UUID=XXX none ntfs rw,noauto 0 0

Remember to replace XXX with your UUID. You can press CMD+V to paste it.

Now we need to save the file. The easiest way to do that is to hit escape, and the hold SHIFT, and press Z twice. So SHIFT+ZZ. That will save the file and close vim.

Now restart your computer and your bootcamp drive should not be mounted. If you want to mount it, you can open Disk Utility and mount it.
 
In Windows you can add a period in front of the drive's name to make Finder not show it, not having to modify any system files. (it will still appear in the sidebar though, but you can right click and remove from there)
 
Sorry I hadn't replied to the thread. Busy weekend.

I'll try adding the period technique first. If that does not seem to cut it, then I'll give that terminal stuff a whirl.

Thanks for the input =)
 
Sorry I hadn't replied to the thread. Busy weekend.

I'll try adding the period technique first. If that does not seem to cut it, then I'll give that terminal stuff a whirl.

Thanks for the input =)

I just tried it, results below. The proper way of doing it is adding it to the fstab and telling it just not to mount at login.

It's better because you don't have to rename your Windows partition, and because if you want to mount it to the Desktop, you just open Disk Utility and mount it. With the period, you can't have it on the Desktop.
 

Attachments

  • Picture 1.png
    Picture 1.png
    539.8 KB · Views: 105
No problem. Step by step instructions:

Fire up the terminal (/Applications/Utilities/Terminal) and [do that other stuff]

Hey there, thanks for posting this. I have the same disk set up as you do, which makes it easier.

But, I'm having a little difficulty.

I get to this part just fine:
Code:
UUID=disk0s3 none ntfs rw,noauto 0 0
in that Insert Mode.

Now, what I have a question about is how to save and exit the insert mode. I tried your SHIFT+ZZ routine... which gave me two capitol Zs and neither saved nor exited from insert mode!

So... little help? Thanks!
 
Hey there, thanks for posting this. I have the same disk set up as you do, which makes it easier.

But, I'm having a little difficulty.

I get to this part just fine:
Code:
UUID=disk0s3 none ntfs rw,noauto 0 0
in that Insert Mode.

Now, what I have a question about is how to save and exit the insert mode. I tried your SHIFT+ZZ routine... which gave me two capitol Zs and neither saved nor exited from insert mode!

So... little help? Thanks!

You are putting the volume identifier in that line instead of the UUID. It shouldn't be "disk0s3" it should be the volume UUID.

So it should look like this:
Code:
UUID=1AED6166-2505-4FEE-BFCB-CB3C7D3AC1E6 none ntfs rw,noauto 0 0

But your UUID will be different than mine.

Also, my bad on the vim part. You need to hit escape before pressing shift+ZZ.
 
Okay, gotcha. Yeah, I'm obviously a newbie with this Terminal stuff. Thanks for bearing with me.

Okay, now that I've understood how to save, I'm having a difficulty at an above step. Particularly, I'm not seeing my UUID.
Here's the code I'm getting:
Code:
Ev:~ Ev$ diskutil info disk0s3
   Device Identifier:        disk0s3
   Device Node:              /dev/disk0s3
   Part Of Whole:            disk0
   Device / Media Name:      Untitled

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

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

   Total Size:               16.9 Gi (18096320512 B) (35344376 512-byte blocks)
   Free Space:               10.9 Gi (11686764544 B) (22825712 512-byte blocks)

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

Any idea why its not showing up there? Thanks!
 
That's really weird. I'm guessing it's not showing up because you're using NTFS-3G.

Try opening Disk Utility, right clicking on your windows partition and going to Information. Does it show your Universal Unique Identifier there?

Mine looks like this:
picture1sbp.png
 
Tried that as well. Got the attached pic now.

What on earth is going on here? Thanks for all the help!
 

Attachments

  • No UUID.png
    No UUID.png
    89.6 KB · Views: 120
Note: I disabled NTFS-3G and tried again and still am not getting the UUID:
Code:
Ev:~ Ev$ diskutil info disk0s3

   Device Identifier:        disk0s3
   Device Node:              /dev/disk0s3
   Part Of Whole:            disk0
   Device / Media Name:      Untitled

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

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

   Total Size:               16.9 Gi (18096320512 B) (35344376 512-byte blocks)
   Free Space:               10.9 Gi (11686645760 B) (22825480 512-byte blocks)

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

Weird... :confused:
 
I have a Win7 installed on a separate drive and it has created two partitions that automount in OSX that I want to remove... "BOOTCAMP" and "System Reserved". The former has a UUID I can add to fstab... but "System Reserved" doesn't have a UUID and it has a space so I suspect I can't refer to it by volume name. I also can't rename the volume (I get an error - not allowed).

WTF can I do to stop this stupid partition from mounting in OSX?

Info on this partition...
 

Attachments

  • Picture 1.png
    Picture 1.png
    103.3 KB · Views: 86
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.