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 created 3 partitions on a hard drive.

I've tried renaming the partition with a dot in front, however it seems that the OS doesn't allow that.

How to make one of the 3 partitions hidden to the user?

share|improve this question
    
Hidden in what way? Not mounted by default? Mounted but not displayed as a volume? Something else? –  bahamat Jul 15 '12 at 3:48
    
Mounted but not displayed on the desktop –  theAmateurProgrammer Jul 15 '12 at 4:31
add comment

1 Answer

up vote 1 down vote accepted

My previous answer is preserved below.

You can use the chflags command to apply the hidden attribute:

chflags hidden /Volumes/Hide_this_disk

And to unhide:

chflags nohidden /Volumes/Hide_this_disk

These commands should take effect immediately.


You need to have the Apple Developer Command Line Tools installed. You can either get them from inside of Xcode (in Preferences under Downloads) or you can download them from Apple's Developer website (free registration required).

After it's installed you'll have the SetFile command:

SetFile -a V /Volumes/Hide_this_disk

This needs to be executed as root, and it won't vanish right away. But after remounting it, it won't be displayed in the Finder any more. You'll need to use Disk Utility (or diskutil) to mount and unmount the disk afterward since it won't be visible to unmount and it will still be available under /Volumes normally.

If it's an internal disk then I believe that it will auto-mount at boot, but I don't know for certain.

To make it visible again just run the same thing, but with a small v:

SetFile -a v /Volumes/Hide_this_disk

Again, you'll need to remount it.

share|improve this answer
    
Thanks, though I just realized that an easier way to do this is to use chflags instead. I think it does the same thing, but it doesn't require the command line tools installed. –  theAmateurProgrammer Jul 15 '12 at 6:49
    
Ah, that's right. I couldn't remember the name of the other command. Updating my answer to include that. –  bahamat Jul 15 '12 at 7:39
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.