How to hide on desktop unmounted partitions

François Patte francois.patte at mi.parisdescartes.fr
Mon Jul 27 09:09:26 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le 26/07/2015 19:54, François Patte a écrit :
> Bonjour,
> 
> I have on my disks some partitions which are not mounted at boot
> time and they appear as icons on the desktop of every user... I
> want to hide them.
> 
> Before systemd, I added some rules in udev directories 
> (/etc/udev/rules.d) to hide these partions:
> 
> KERNEL=="sda1", ENV{UDISKS_PRESENTATION_HIDE}="1" KERNEL=="sda2",
> ENV{UDISKS_PRESENTATION_HIDE}="1" ACTION=="add",
> KERNEL=="0000:00:02.0", SUBSYSTEM=="pci", RUN+="/bin/sh -c 'echo 1
> > /sys/bus/pci/devices/0000:00:02.0/remove'"
> 
> And partitions sda1 and sda2 do not appear on desktop...
> 
> Is it possible to do the same with systemd-udevd? What is the
> right syntax?
> 
> One more question: these partitions are members of raid arrays and
> lvm groups, is it possible to use md2 or /dev/mapper/foo instead of
> sda1, sda2....

So! I answer to myself... This can be usefull for people who have
several systems installed and who use xfce (I don't know if the same
problem occurs for kde or gnome): icons of partitions of other system
show on the desktop.

Create a file (98-local.rules for instance) in /etc/udev/rules.d with:

ENV{ID_FS_UUID}=="17e0b155-4d77-4769-b568-723329c5f656", \
ENV{UDISKS_IGNORE}="1"

for each partition you want to hide.

You can find the right syntax, ENV{ID_FS_UUID} for instance, with the
command:

udevadm info /dev/md2

After reboot, icons do not show on the desktop.


- -- 
François Patte
UFR de mathématiques et informatique
Laboratoire CNRS MAP5, UMR 8145
Université Paris Descartes
45, rue des Saints Pères
F-75270 Paris Cedex 06
Tél. +33 (0)1 8394 5849
http://www.math-info.univ-paris5.fr/~patte
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlW19UYACgkQdE6C2dhV2JUrKACgj8XmF3ManpG9cVVtDC819C08
diQAnjO2B7PbgaXyX915DhenTbiwMm+U
=G7tl
-----END PGP SIGNATURE-----


More information about the users mailing list