Automounting support in KDE

From Elvanör's Technical Wiki
Jump to navigation Jump to search

With the kdebase-kioslaves package, KDE gets some automounting support. More importantly, you can mount / unmount media straight from Konqueror. It seems to me that this support is still young and relatively immature. I hope things will improve in the future. Meanwhile, here what you can do to get it to work.

The Basics

  • Follow this Gentoo HOW-TO.
  • Make sure your normal user is in the groups plugdev, haldaemon and messagebus. The latter two are not mandatory according to the HOW-TO but I think it's best to have them anyway.
  • Note that having mount folders for removable media in /mnt is deprecated. The FHS standard recommends using /media/.

How does it works

  • When navigating to the media:/ URL in Konqueror, Konqueror displays a list of all the devices found in /etc/fstab, if they are present in the system (plugged in). It is important to understand that the only configuration file involved is /etc/fstab (KDE calls a program called fstab-sync to know when the file has been modified).
  • Make sure your fstab line is correct (notably that it contains the user option). Also, when providing the device location, use the real location, not a symlink. Apparently a symlink can cause troubles.
  • Once this is done, when navigating to media:/ you should see a list of all your media. Double clicking on any of them should mount them.
  • UPDATE (15/11/2007): With newer versions of KDE or hal, you don't need to even have a line in /etc/fstab. I also don't think the fstab-sync trick is used anymore, KDE should get the information via HAL.
  • If it doesn't work, try the following (I don't know exactly which one solved the problem):
    • Install pmount. Reboot.
    • Remove the CDROM line entirely in /etc/fstab.
    • Build your kernel without ATA support at all (use PATA support for CD-ROM).
    • Rebuild dbus-qt3-old, then kdebase-kioslaves. This is probably not the solution.

Warnings

  • Don't put empty lines in your /etc/fstab. Apparently, if your media lines are after an empty line, KDE won't recognize them.

What's still unclear

  • What is unclear to me is how the automounting system of KDE works. Sometimes a popup will appear asking for a default action. I don't understand exactly how this works and how can it be configured.