Hiding disk partitions

My 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.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s