How to hide a hard drive partition on your Mac

HardDriveIconXGenerally when you either partition your Mac’s boot drive, or attach a secondary drive to your Mac, then provided the partition’s formatting is compatible with OS X, you should see it mount and be available in the Finder. However, there may be times when you might wish to keep a partition hidden, either because you do not use it, or because it is not intended to be shown in the first place.

Some examples of this are the “EFI” or “Recovery HD” partitions on your boot drive, that support system functions but are not intended to be accessed directly; however, in some cases (especially in dual-boot environments) you might find these showing up. Of course, modifying the contents of these may destabilize your system or prevent some features from working properly, so you might want to prevent these from mounting.

If you have partitions showing on your Mac that you would like to hide, then you can do so, but will need to get under the hood with some Terminal commands. Don’t worry, the methods used here are entirely harmless and can easily be undone:

1. Get the partition’s UUID

Disk Utility volume info window showing UUID

The volume’s UUID can be found and copied here in the Disk Utility info window (click image for larger view).

Open Disk Utility, where you should see the list of volumes (partitions) for each drive on your Mac. Select the drive you want to hide, and press Command-i to get information on it. Resize the info window that appears to reveal the entire Universal Unique Identifier (UUID) for the drive, and then select and copy the entire UUID.

The UUID can also be found in the Terminal by typing “diskutil info,” followed by a single space, and then dragging the desired hard drive to the Terminal window before pressing Enter. For instance, the following command will get info on a volume called “EFI”:

diskutil info /Volumes/EFI

You can then find “Volume UUID” in the output of this command to find the UUID needed to hide this partition.

2. Edit or create the “fstab” file

The “fstab” file is a hidden system file that is used to specify how partitions are handled in OS X, where you can have them mount at specific points other than the default, or mount only in read mode. We are going to use it to prevent the partition (identified by its UUID) from mounting.

To create or edit this file, open the Terminal and run the following command from an administrative account:

sudo pico /etc/fstab

This will open an editor, in which you will enter the syntax needed to hide the drive.

3. Add the fstab commands to hide the drive

Enter the following command, replacing the UUID consisting of zeros with the one you copied for your partition’s volume.

UUID=00000000-0000-0000-0000-000000000000 none hfs rw,noauto

What this command does is specify the identifier (the UUID), then the mount point (none), followed by the format (hfs), and then options (read/write, and no auto mount). The keys here are that the mount point is set to none, which prevents the drive from mounting, and noauto, which prevents an attempt to automatically mount it.

fstab file settings in OS X to prevent automatic drive mounting.

The UUID specified (arrow) in the fstab file will be set to not mount automatically.

You can specify as many drives you want in the fstab file, by adding one per line. When finished, to save the file press Control-O (this writes out the file), and then press Control-X to exit the editor.

With the fstab file updated and saved, you can now reboot your system, and the specified drives should no longer automatically mount. Keep in mind that this will only pertain to the current operating system, so if you dual-boot your Mac and see these drives load in more than one OS X installation you use, then you will have to follow these instructions to edit the fstab file for each OS.

While this can be used for hiding system partitions like the Recovery HD and EFI, you can also hide any other partitions you might not want inadvertently modified. Just similarly add them to the fstab file, followed by rebooting and they should also hide.

Undoing the changes

If for some reason you no longer want a partition hidden, then simply edit the fstab file and remove the line that specifies the partition. If you have not used the fstab file for other purposes, then you can also simply delete it by running the following command in an administrative account, followed by restarting:

sudo rm /etc/fstab

22 thoughts on “How to hide a hard drive partition on your Mac

  1. darkdreamer4u

    Can one still transfer files onto a hidden partition? Is it still usable in some way? If not, what’s the point? Just wondering…

    1. Topher Kessler Post author

      Good question! In essence, no. In order to transfer files the volume must be mounted. However, there is no reason to transfer files to or from the Recovery HD or EFI partitions. These are supposed to be hidden. Likewise, it may not be the best approach to have local secondary boot partitions be mounted. Even if you do not intentionally write to them, system services and applications you use may do so, and potentially interfere with them. Its for this reason that hiding these partitions can be beneficial, or at least it can be beneficial to simply clean up your desktop and not have them show if you’re never going to interact with them.

  2. darkdreamer4u

    Ok, now IF I wanted to hide a partition from prying eyes with this method, can I still mount the partition? I remember Norton Disk Doctor had a feature to mount ‘unmountable’ /invisible disks. So, maybe TechToolPro could do it and once mounted it could be used to transfer files onto it?

    1. Topher Kessler Post author

      Yes you can mount the drive. Open Disk Utility and you should see the volume grayed out. You can then select it and click the Mount button in the toolbar to make it available. Likewise, you can select the partition and unmount it using this same method, if needed.

  3. Chris Hart, Independent Apple Support Consultant

    Hiding things (files, folders, disks) is a trivial means of security. Anyone who knows what they’re doing will find it and explore it, without any difficulty whatsoever.

    If you really want to protect a disk, or partition, use FileVault2 to encrypt it. Use Disk Utility to do this and when you see the checkbox asking if you want to store the ‘key’ in your keychain, turn it off. That way, whenever you want to mount the volume (using Disk Utility), you will be prompted to enter the encryption password (otherwise it will not be mounted and will be completely inaccessible to everyone else on the planet).

    1. darkdreamer4u

      I’m aware of all this. Just trying to find a secondary use for the hiding feature.
      I also just looked at TechToolPro and it has the feature of mounting the edrive (which I have on my HD). There’s plenty room left on that hidden partition for files and it would be easier to instruct somebody (loved one, e.g., in a last will) to go to TechToolPro and open the edrive for access to files rather than giving out an encryption password that may change over time anyway.

  4. Hilltopper freeware easier to use. Go to Utilities / Visibility / select partition and choose hide / unhide.

    1. MaX

      Does OnyX use fstab?. I think that OnyX just hides or unmounts the mounted drive using diskutil (as Unmount Volumes does;, but does not prevent mounting when booting as TinkerTool System does using fstab. It is not the same.

      If you want to PREVENT mounting after booting (not mounting and then unmounting, which is far less convenient), you need to use fstab, which means following the directions of Topher Kessler’s article above, or using TinkerTool System as a Graphical User Interface (GUI) which Mac users love! Right?

      1. Joe Z.

        Using fstab seems to screw-up DiskWarrior (it hangs when attempting to rebuild the directory of the hidden partition).

        As administrator of my parent’s iMac (formerly mine–I now have a Mac mini), I’ve been looking for a simple “hide the partition” solution so my parents can’t see the Diagnostics partition I created but I can boot to it and run DiskWarrior to examine/repair the main partition. I also want to be able to boot from the main partition and run DiskWarrior (from my account) to examine/repair the Diagnostics partition.

        Currently the Diagnostics partition is hidden by making it type Apple_Boot instead of Apple_HFS. Unfortunately, DiskWarrior doesn’t see Apple_Boot partitions, so I can’t examine/repair the Diagnostics partition.

        The iMac is running OS X 10.7.5 Lion (the maximum version supported).

  5. MaX

    Great article. For a GUI, you can also use TinkerTool System
    selecting volumes at
    System – Exclude volumes from automatic mounting

  6. EdS

    I discovered that if you dismount the EFI partition, upon restart the partition seems to remain unmounted. I have one more experiment to try to push this further: Power off the Mac but leave the power on for the external devices, then power the Mac back up to see if the partitions still remain hidden. I know what happens if I also power off the drives.

    I appreciate the longer-term fix you offered, but this may be enough for some users.

  7. B. Jefferson Le Blanc

    The EFI partition and the Recovery HD partition are unmounted and invisible by default in OS X. They may show up on the Desktop from time to time but can easily be unmounted in Disk Utility. Barring idiosyncratic circumstances, their unmounted and invisible state will persist through computer restarts. You can, of course, use Disk Utility to unmount other volumes, but they will mount again the next time you start your Mac. While Topher’s Terminal techniques offer a more persistent solution than Disk Utility, they are labor intensive. Using Onyx or TinkerTool System to do the same job is far easier.

    As for storing files on an eDrive, first you have to own a copy of TechTool Pro (not a bad idea, actually). But there’s a far easier way to secure your files without having to mess with visibility or booting in an eDrive. Using Disk Utility you can create encrypted disk images of just about any size in which to store your sensitive information. Pick a good password, make a note of it and include that note in your will or other relevant paper file. You can store the encrypted disk image anywhere on your Mac and no one will be able to open it without the password. At the same time you can access it easily – as long as you remember the password – and close it up again when you’re done with it.

  8. Daniel Cohen

    This works on one of my machines but not on the other. Unless I am doing something wrong (quite possible) I think the difference is that I normally boot from partition 1. But what I want to do occasionally is boot from partition 2 (by pressing Option at start) and hide partition 1. And it seems to me that this might mean that partition 1 has already been noticed when partition 2 has started.

    I had another issue on the machine where your instructions work. They did not seem to work at first, but some checking around indicated that I should try changing rw,noauto to rw,noauto 0 0 and that worked. Of course there may be something weird in my machine.

  9. Llloyd

    any chance i can hide one partition in one user and then hide another partition in the other user?

  10. Ilja Shebalin

    Hi, Topher Kessler. I want to run two OS’s X on my Mac, one that is on my internal HDD, and other one external HDD. I want to make them fully invisible to each other. Do I have to create two fstab files, one for each OS X?

    1. Topher Kessler Post author

      Each OS will have its own rules for handling attached file systems, which will be separate from any other OS on your Mac. This means that you will need to edit your fstab for each OS separately, in order to have it handle your local hardware according to your needs.

  11. Khon

    Hi Topher, I have this issue, when Yosemite starts I have to choose to initialize or ignore or eject three disks. These are three hdd used in striping mode in windows 10 so it’s good to have them not visible. How can I do that?
    Thank you.

  12. Khon

    Ok solved adding 0 0 after noauto, anyway using the same syntax I can’t hide two partition on a ssd (“System Reserved” and “Windows 10”) any advice ?

  13. James J Sr.

    This worked for me but I could not use the “diskutil info /Volumes/EFI” command for some reason. I just used Disk Utility and hit the info button to get the UUID #. After pasting that # in with the rest of the command and presto, it was not mounted. The problem I see in the future is if I want to unhide the drive I can not get that UUID # from the Disk Utility info button any more. Any suggestions? How can I see the entire contents of the fstab file? BTW, I am a NEWBY at this Mac stuff and trying to learn and understand as much as I possibly can….

  14. Daniel Cohen

    Is there a method of hiding an encrypted partition so that it does not show up at all during boot? When I try the suggested method, I still get a prompt to unlock the partition, and I don’t want even to get that prompt.

Comments are closed.