I need to hide an NTFS partition from listing in the nautilus. How can I achieve that?
Is there any tool to do that?
And how can I hide files in ubuntu (except . operator)
I need to hide an NTFS partition from listing in the nautilus. How can I achieve that?
Is there any tool to do that?
And how can I hide files in ubuntu (except . operator)
Hiding partitions from Nautilus via »Disks«
In Ubuntu 12.10 and onward, there is a utility called Disks which shows all the available disks and allows to modify mount options for each partition.
Amongst the various options, you can decide if the partition will be mounted at boot time or not, and if it will appear in the user interface. Admin privileges are needed to apply changes.
This guide may help you.
Thanks for this, very handy tutorial. I actually found a much easier way to do this in Ubuntu 14.04
No terminal required, maybe this is a new feature for 14.04 ? Not sure either way this was much easier and effective.
I rebooted again to double check windows system after this task was complete and dual boot worked perfectly. This is an awesome way if you don't have time to stuff about in case something goes wrong OR if you are still learning the fine art of terminal commands :P
Hope this helps.
Cheers
Tachyons presents a great answer that shows how to hide a partition to udisks applications (such as Dolphin). Relying on a fixed partition name is error-prone though, it's better to use UUID that are unique to a partition. This answer was tested with Kubuntu 13.10.
To do so, one first has to find a UUID. That can be found in multiple ways, one of them is by running the command
udisksctl info -b /dev/sda1
(where/dev/sda1
is your partition of course). The UUID is visible under IdUUID and the partition is not marked as hidden (ignored):Now, in order to hide this partition, create a udev rule that matches the partition by this UUID and hide it from udisks. For instance, if you want to hide the above NTFS partition (with UUID A10CDE7682786D73), and another ext4 partition (with UUID faae2c6a-0545-4bfa-a545-440c63467467), your
/etc/udev/rules.d/99-hide-partitions.rules
file should contain:The comments are optional, but recommended so that the UUID becomes less magic. Be sure not to mix up
=
with==
, one sets the variable, the other compares against a variable.After creating the rules file, apply it by rebooting or by running:
Now run the
udisksctl info -b /dev/sda1
command again and it should contain:The answer should now be updated. You can follow this guide, but with a difference: you don't have to write this (as was originally written in the other answer)
Instead, you should write this:
The rest is the same :)
You can't really hide partitions so that they absolutely 100% can't be mounted in Linux, short of physically removing the disks on which they reside. That said, I don't think you need that level of safety. I suspect you just don't want to accidentally click an icon and get into the NTFS partition. To do that, you can edit the /etc/fstab file. Add an entry like this for each partition you want hidden:
Suppose your ntfs partition is dev/sda1 Then use this code
.
See this Answer
.
Source
In Dolphin, which is not Nautilus but similar application for Kubuntu, I can just right click on the device in the left pane. Then a menu pops up an I can choose
Hide entry 'humpty dumpty'
. You might want to check if there is a similar option in Nautilus.In my version, 14.04.2, I have a slightly different menu in the Disks option to hide partitions.
1 Open Disks
2 Left click the drive with partitions you want to hide (it turns orange)
3 Left click the partition you want to hide (it turns orange)
4 Click the double-cog in the bar below the partitions
5 Click "Edit Mount Options"
6 Turn Automatic Mount Options Off
7 Uncheck "Mount at startup"
8 Uncheck "Show in user interface"
9 Click "OK"
10 Enter password
This took immediate effect in my computer.
Get your disk UUID:
Edit
/etc/fstab
as root:Create a protected /media/root folder (to prevent users to access the partition if mounted):
Several independant layers of protection against mounting and visibility:
noauto
prevents automatic mounting at startupnouser
requires being root to mount (NB: already the default behavior, and udisk is root)x-gvfs-hide
explicitely tells Nautilus to hide itx-udisks-auth
should require admin rights when mounting but it has no effect. I guess it needs additional configuration.Documentation:
mount
,fstab
,gvfs
.Note that the block device (eg.
/dev/sdX
) is still visible by all users, especially in theDisk
utility. It can still be manually mounted elsewhere by root, but not by a standard user by default. If you don't trust root or the system processes, you need to use one of the lower-level kernel approaches.To go further: After that, if you want to mount the block device invisibly, in a container-like approach, you can use
unshare
:BEWARE: Most/all answers, including the udev rule answers, just hide the partition from Nautilus but users can still mount it with standard permissions, through the Disk utility (
►
icon). Putting the fstab mount point in an unaccessible directory will prevent user access.This will be the easiest way to hide the "Weak" Windows Partitions from the "Robust" Ubuntu 14.4.
Ubuntu:
Click on: Search your computer and online sources
Write Disks in the dialog box, then Click on (Disks)
Click the partition you want to hide (it changes color)
Click the double-star (More Options) in the bar below the partitions
Select "Edit Mount Options"
Turn Automatic Mount Options (OFF)
Uncheck "Mount at startup"
Uncheck "Show in user interface"
Click "OK"
Enter password. ( YOU ARE DONE! )
This will take immediate effect but, reboot is necessary.
Windows:
No need to hide Ubuntus Partition from Windows! Windows automatically Ignores other non windows OS's Partitions.