Hiding a mounted device in a nautilus

I am running Ubuntu Precise. In my /etc/init.d, I have a bash script that does the following on startup:

  • Cycle
  • Mounts an image on an NTFS drive. This image contains the ext2 file system with the home directory

  • Then it is mounted with the --rbind option, which mounts the house inside the image file in / home.

It still works well, although having open files in / home does not prevent the path from being unmounted.

Unfortunately, Nautilus displays a loop connection in the list of removable drives with an icon that allows the user to disable the loop loop. Disconnecting the drive on which it is installed / at home does not contribute to a well-functioning system.

How can I get Nautilus to display this circuit mounted device?

man udisk (7) says that one of the “influential properties of the device in the udev database” is:

UDISKS_PRESENTATION_HIDE

If set to 1, this is a hint for presentation-level software so that the device does not appear to the user.

I assume that setting this property in the / dev / loop should tell Nautilus not to show the device.

How to set UDISKS_PRESENTATION_HIDE in a bash script?

+5
source share
4 answers

Now the answer should be updated (at least for Ubuntu 12.10). You no longer need to write (as was written in another answer):

KERNEL=="sda1", ENV{UDISKS_PRESENTATION_HIDE}="1"
KERNEL=="sdb2", ENV{UDISKS_PRESENTATION_HIDE}="1"

Instead, you should write this:

KERNEL=="sda1", ENV{UDISKS_IGNORE}="1"
KERNEL=="sdb2", ENV{UDISKS_IGNORE}="1"

The rest is the same :)

+6
source

You need to write the following in /etc/udev/rules.d/99-hide-disks.rules:

KERNEL=="sdxy", ENV{UDISKS_PRESENTATION_HIDE}="1"

sdxy - /dev. , mount ( , ).

+4

Another approach is to install the device somewhere else than under / media. I chose under / run, which allows you to use / mnt for temporary mounting.

0
source

According to udisk on the archlinux wiki, and to summarize the other answers:
Add a file called/etc/udev/rules.d/99-hide-disks.rules

For udisk:

# hide the device sda1
KERNEL=="sda1", ENV{UDISKS_PRESENTATION_HIDE}="1"

For udisk2:

# hide the device sda1
KERNEL=="sda1", ENV{UDISKS_IGNORE}="1"

# hide the device sda2 using UUID
# use: blkid /dev/sda2    to get the UUID of /dev/sda2
ENV{ID_FS_UUID}=="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX", ENV{UDISKS_IGNORE}="1"
0
source

All Articles