Hiding disk partitions
Posted: 2015-10-03 | Author: slackalaxy | Filed under: desktop, system | Tags: 99-hide-partitions.rules, cfdisk, hide, partition, thunar, udev |Leave a commentMy laptop has a Windows 7 disk partition, as well as a System and a Lenovo recovery partitions. I do not need these to be shown in my file browser (Thunar) nor in the open/save file dialogs.
I first run cfdisk, to see the partitions:
Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------
Unusable 1.05*
sda1 Boot Primary ntfs [SYSTEM_DRV] 1572.87*
sda2 Primary ntfs [Windows7_OS] 104857.60*
sda5 NC Logical reiserfs 20972.57*
sda6 NC Logical reiserfs 10486.81*
sda7 NC Logical reiserfs 2098.21*
sda8 NC Logical reiserfs 2098.21*
sda9 NC Logical swap 2098.21*
sda10 NC Logical reiserfs 339144.09*
sda3 Primary ntfs [Lenovo_Recovery] 16777.22*
Unusable 1.08*
In my case, the partitions I want to hide are: sda1, sda2 and sda3. Then I created a file called 99-hide-partitions.rules in /etc/udev/rules.d/ with the following contents:
KERNEL=="sda1",ENV{UDISKS_IGNORE}="1"
KERNEL=="sda2",ENV{UDISKS_IGNORE}="1"
KERNEL=="sda3",ENV{UDISKS_IGNORE}="1"
Reboot!
Now the annoying partitions are gone. Tip is from this discussion at LQ.
