# How to disable automount?

## arhenius

Hello.

I upgraded my gentoo machine and installed some new software which requires hal (the X server).

Now it seems I'm stuck with automount. I want to be able to manually mount and unmount my CDs, USB drive, etc. In fact I changed to gentoo because I was feed up about having automount in fedora. Is there a way to disable this feature? I feel like I'm back to M$ Window$...   :Sad: 

Best Regards

----------

## MaximeG

Hi,

I'd think it's more a KDE,Gnome,other option to set up.

Personnaly, even if my HAL detects when I plug something whether it'd be a CD or USB, it displays it but doesn't _mount_ it.

If I click on it (and I have the rights to mount/mounting folder) it mounts it.

I'm using KDE-4.2

Regards,

Maxime

----------

## arhenius

I use flux box and I don't have any kde or gnome setting I would be able to use. In fact I don't even have nautilus installed (only thunar). I suppose there should be some tweak in the hal configuration files, but I can't understand any of it.

----------

## MaximeG

Hi,

Unfortunately I don't know how to configure HAL.

But looks like it's the way you should look after.

By the way, if you don't like HAL, why did you install it ?

Or is it a _required_ dependency for something we can't get rid of.

Regards,

Maxime

----------

## arhenius

It's required by the new version of xorg-xserver. Or at least the only instructions I can find is to compile it with hal. It seems xserver is now using hal to manage the input devices. Therefore, it would be nice to restrict hal from doing everything but managing evdev's.

----------

## i13m

i am using this tip.

http://www.lesswatts.org/tips/disks.php under the hal cdrom polling section

so it does not automount the cd when i insert it. i have to double click the icon to get it mounted.

BUT, there may be other issues.

----------

## arhenius

Thanks. But I would also like do disable automount for pendiscks and other usb storage (like cellphones and cameras...)

----------

## sera

Something along those lines in an fdi file should work.

```
        <deviceinfo version="0.2">

           <device>

            <match key="@block.storage_device:storage.hotpluggable" bool="false">

              <match key="@block.storage_device:storage.removable" bool="false">

                <merge key="volume.ignore" type="bool">true</merge>

              </match>

            </match>

          </device>

        </deviceinfo>
```

 or

```

        <deviceinfo version="0.2">

           <device>

            <match key="@block.storage_device:storage.bus" string="usb">

              <merge key="volume.ignore" type="bool">true</merge>

            </match>

          </device>

        </deviceinfo>
```

The volume.ignore is the important part.

----------

## szczerb

 *arhenius wrote:*   

> It's required by the new version of xorg-xserver. Or at least the only instructions I can find is to compile it with hal. It seems xserver is now using hal to manage the input devices. Therefore, it would be nice to restrict hal from doing everything but managing evdev's.

 It's not required:

```
szczerb@nomad ~ $ grep "sys-apps/hal" /usr/portage/x11-base/xorg-server/xorg-server-1.5.3-r5.ebuild 

RDEPEND="hal? ( sys-apps/hal )

szczerb@nomad ~ $ grep "sys-apps/hal" /usr/portage/local/layman/x11/x11-base/xorg-server/xorg-server-1.6.1.ebuild 

RDEPEND="hal? ( sys-apps/hal )
```

Just don't set the hal USE flag  :Smile: 

----------

## Gusar

Hal basically just informs the rest of userspace that something in the machine has changed. You then need a handler that deals with that info. You said you use Thunar - there's your handler. So Thunar should be the correct place to look for turning automounting off.

Then there's also this: Hal is capable of looking into /etc/fstab and if it sees a matching entry there for a particular device, then said device get handled the way it says in fstab. It works that way in KDE3.5, no idea about Thunar.

----------

