I have a luks setup with encrypted partition. And I don't want everyone on my computer to see that I have such partition. Unfortunately it shows up in the nautilus "devices" panel as "Encrypted partition".
Is there a way to prevent it from showing there? I managed to setup authentication with usb key and I don't want the encrypted partition show in the panel.
You can use the mount option x-gvfs-hide in
/etc/fstab
to hide it in nautilus, for example.For example, a line in
/etc/fstab
would become:Edit: Or you can create a fake line in
/etc/fstab
like thisfor the sole purpose of hiding it in nautilus. It will not be mounted so the mount point could not exist.
This question deserves an update for Ubuntu 16.04 with user friendly steps.
What you see on the left side of Nautilus are your partitions. Mounted ones have the eject button beside them, unmounted ones do not. To mount the partition click on the name. Then you can navigate the folders and files.
You want to hide partitions so they don't appear in Nautilus.
Start
Dash
the first option on theLauncher
Type
Disks
and you will see the applicationDisks
appear. Click on it.A screen similar to this appears:
Left click on a Disk. Then left click on the Partition you want to hide.
Right click on the gear (follows the Left Arrow and
-
) and selectEdit Mount Options
and this screen appears:Uncheck the option
Show in User Interface
.Click OK and enter password to apply changes. After the next reboot Nautilus won't show the partition. Note that this doesn't erase the partition or delete any data on it.
If you need clarification please post a comment below.
You can just add it to /etc/fstab (this will cause it to be mounted automatically at startup). If you specify a mount point outside /media you don't see it in Nautilus anymore.
For those who don't know how to do this here's an example:
If you had a logical volume /dev/sda2 of the filesystem-type ext3 that you want to mount to a directory Music, because it contains your Music, you have to add the following new line to /etc/fstab:
For other filesystems or names you just edit this line. Then, you save the file, make the mount point with
sudo mkdir /mnt/Music
, or whatever you want to name the mount point. If you don't want to reboot to see the change, just once executesudo mount -a
.To avoid command line, you can open Applications > Disks.
Select the partition you want to hide, click on the gear icon ("additional partition option") > Edit Mount Options and unchecked "Show in user interface". Reboot, the partition is now hidden.
Tested on Ubuntu 16.04 LTS
The following works for me on Ubuntu 18.04:
Create a
udevd
rule:$ sudo touch /etc/udev/rules.d/99-hide-disks.rules
with the following contents:
ENV{ID_FS_UUID}=="<UUID>",ENV{UDISKS_IGNORE}="1"
replace the
<UUID>
with the UUID of the partition that should be hidden in Nautilus.In order to apply these new settings to Nautilus without a reboot, execute the following commands:
$ sudo udevadm control --reload-rules
$ sudo udevadm trigger