Hide unmounted volumes in Nautilus

I’ve just updated my DELL Inspiron 6000 to Ubuntu Linux 7.04 (Feisty Fawn), before that I used 6.06 LTS (Dapper Drake). Having missed nearly one year of development, I noticed that Nautilus shows all partitions (no matter if mounted or not) in the places area. I’ll never need to mount DELL’s rescue and restore partitions and therefor don’t want them to be listed there. Here you go:
Open a terminal, become root:

sudo -s

Create a new folder and a new file with gedit:

mkdir /usr/share/hal/fdi/preprobe/95userpolicy
gedit /usr/share/hal/fdi/preprobe/95userpolicy/10ignore-disks.fdi

Copy the following to the file, create a new <match>– block for each partition you want to block:

<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
    <match key="block.device" string="/dev/sda1">
      <merge key="info.ignore" type="bool">true</merge>

It’s also possible to block a whole hard disk, e.g. /dev/sdb. Now save the file and restart HAL and DBUS:

/etc/init.d/dbus restart

That’s it, credits go to clausi at ubuntuusers.de and vtel57 at ubuntuforums.org.


  1. blah

    You have typos in your tutorial. In the quotations string= and also block.device

Comments are closed.