Hiding Your FAT32 Boot Camp Partition

In response to OS X: Hiding and Mounting a Partition, Shazron asks:

"Thanks for the tip on Hiding and Mounting a Partition.

I'm trying to hide my fat32 Windows XP partition on my MacBook Pro however (using BootCamp), and running 'diskutil info' on that partition doesn't show an UUID. Any tips on how to hide the partition without a UUID?

Thanks :)"

Answer:

Well, Shazron is right, a FAT32 formatted volume is not assigned a UUID.  Let's see what we do have.  We're going to make sure that the "WINDOWSXP" partition does not mount:

# diskutil list
/dev/disk0
  #:                  type name              size      identifier
  0: Apple_partition_scheme                    *111.8 GB disk0
  1:    Apple_partition_map                    31.5 KB  disk0s1
  2:              Apple_HFS Zero              111.7 GB  disk0s3
/dev/disk1
  #:                  type name              size      identifier
  0:  GUID_partition_scheme                    *111.8 GB disk1
  1:                    EFI                    200.0 MB  disk1s1
  2:              Apple_HFS Macintosh          55.8 GB  disk1s2
  3:  Microsoft Basic Data WINDOWSXP          55.7 GB  disk1s3

In fact, we don't even need to run diskutil info on the partition - the secret lies in the fstab file.  In addition to UUID strings, fstab will also take a LABEL argument, in this case, making our entry look like this:

LABEL=WINDOWSXP none msdos rw,noauto 0 0

Also note the change from "hfs" to "msdos".  Now, on boot, a disk with that label will not mount automatically.  You can still mount it programatically, or by using Disk Utility.app.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Thanks

Thanks for the tip. I tried this on a Mac Mini with boot camp and an ntfs partition, but the volume mounts no matter what is in fstab. Did Apple change something in OS 10.4.7 that breaks this? It would be really nice to be able to not have the partition mount, as this is in a public lab, and users are easily confused.

Thanks! (BTW, I really enjoyed your MacWorld presentation, From Chime to Desktop)

You should be able to...

I don't know of any change that would have broken this. Admittedly, I don't have a genuine NTFS partition to look at right now. If you run 'diskutil list' from a shell, what does that show about the volume in question? You should be able to attack it with "LABEL" like I did here. Let me know if that helps. If not, post the results from the diskutil command.

Thanks for the comments about "Chime to the Desktop!" It was really enjoyable to do. Apparently, I'll see you out there again! Looks like I have several sessions this time (but that's always subject to change, and often does). In any case, I will be attending MacWorld 2007!

Here is the output:

Here is the output:

diskutil list:

/dev/disk0
#: type name size identifier
0: GUID_partition_scheme *74.5 GB disk0
1: EFI 200.0 MB disk0s1
2: Apple_HFS macxxxxa 43.0 GB disk0s2
3: Microsoft Basic Data Untitled 31.2 GB disk0s3

diskutil info /dev/disk0s3:

Device Node: /dev/disk0s3
Device Identifier: disk0s3
Mount Point: /Volumes/Untitled
Volume Name: Untitled
File System: NTFS
Partition Type: Microsoft Basic Data
Bootable: Is bootable
Media Type: Generic
Protocol: SATA
SMART Status: Verified
Total Size: 31.2 GB
Free Space: 20.3 GB
Read Only: Yes
Ejectable: No

/etc/fstab:
# Identifier, mount point, fs type, options, dump order, check order
LABEL=Untitled none msdos ro,noauto 0 0

As you can see, I changed the option to LABEL since NTFS also does not have a UUID, and the mount type to ro, since NTFS is read only under OS X (currently). The fstab is apparently ignored, and the NTFS volume gets mounted as soon as any user logs in. It looks like I may have to create a login hook to unmount the volume during login.

Craig

Try This

Interstingly, the fstab man page has an example for this:

LABEL=The\040Volume\040Name\040Is\040This none msdos ro

(The "\040" characters represent spaces in the name, if you have any). Apparently, you still need to add "noauto".

It is a bit strange, because my earlier tests with this were successful. However, mine were not with a Boot Camp partition (labeled "Untitled"), but with separate Mac-formatted NTFS and FAT32 disks.

Worst case: the login hook option is actually pretty good. In both cases, you have something to maintain, either an /etc/fstab file, or a login hook. ARD can help you with both. I hope to have a genuine NTFS-on-GUID to toy with sometime this week. If I nail it down, I'll post back.