HAL/DBUS how it affects you

Discussion topics, Linux related - not requests for help

Moderators: ChrisThornett, LXF moderators

HAL/DBUS how it affects you

Postby davecs » Mon Apr 25, 2005 6:57 pm

HAL is a new background program in Linux (or daemon as geeks call them). It depends also on a slightly older but still fairly new one called DBUS. What do they do? This is all to do with mounting your storage devices. And it works with KDE3.4 out of the box.

If you have upgraded to KDE3.4, there is a list of sidebar modules in Konqueror File Manager on the left. The one consisting of three tiny hexagons, orange, blue and green, is called "devices:/". By an oversight, this has been left in but doesn't work anymore. You can delete it, and put a new one in called "media:/". This is done by right-clicking below the last module, and selecting Add New ... > Folder. You should then set the name to Media, the url to media:/ and the icon to "kwikdisk". If you select media:/, you will see a graphical representation of all your hard drives. If HAL/DBUS are running, plug in a CD and it will mount, and it will be added to the icons. Better still, plug in a USB storage device. This will mount and appear also. But you can right-click on it, and select "Remove Safely". This will unmount it properly so that any data you wrote to it is written behind so you can now pull it out.

Once that's all working, you can hop over to KDE Control Centre > Desktop (Look and Feel in some distros) > Behaviour > Device Icons tab. You should enable all the devices you have, EXCEPT hard discs. Both mounted and unmounted. Now when you plug in your USB card, or put a CD in the drive, the icon will appear. The name under the icon defaults to the volume label of the drive, and if there isn't one, its size! Not helpful. By selecting it you can then press F2 to change it. Your change will be saved for next time, but each user (including root) has to do this separately. With this set up, plug in your USB key, after a pause, a mounted icon appears on the desktop. Right click it and select "Remove Safely", the icon changes to the unmounted version. Finally, pull it out, the icon disappears. Perfect!

Anyway, I have upgraded the kernel and KDE/HAL/DBUS via synaptic in PCLinuxOS and this works fine. This will be standard in the next release (0.9) which will be on the mirrors any time soon.

In Gentoo, for some reason, the "Remove Safely" bit did not work. So I added pmount. When you add pmount to hal and dbus, it works differently. When you plug an item in, an unmounted icon pops up. You can then mount it and unmount it to your hearts content before pulling it. The only proviso is that this only works for devices NOT in /etc/fstab.

Basically when you use HAL/DBUS, mount points are created automatically at /media/, and anyone can unmount them. With PMOUNT, mount points are prepared but not mounted. Provided there is no reference in fstab, anyone can mount, and the same person can unmount. If there is a reference in fstab, pmount just runs the normal mount command, so the default properties defined there will prevail.

All in all this is very exciting. It puts supermount, submount and autofs in the shade somewhat. I always had a feeling of disaster waiting to happen with supermount, especially when you could not unmount a writeable device. By the way, for Gnome users, there is a program called Gnome Volume Manager which uses pmount. So gnome users have to use the pmount method. All in all, Linux is moving ahead preparing for the "ordinary guy's" desktop.

To see HAL/DBUS in action, try downloading the PCLinuxOS live CD version 0.9 when it appears in the next week or so, and give it a spin. It may well be in other distros also, but I don't know which they are.
User avatar
davecs
LXF regular
 
Posts: 530
Joined: Sat Apr 09, 2005 11:13 pm
Location: Dagenham, Essex

RE: HAL/DBUS how it affects you

Postby nelz » Mon Apr 25, 2005 8:33 pm

You can avoid the problems with supermount and writeable media by adding the sync option to /etc/fstab. As long as you wait for the LED to go out, it is safe to unplug the device.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8552
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

RE: HAL/DBUS how it affects you

Postby davecs » Mon Apr 25, 2005 11:22 pm

I would like to see improvements to the HAL system. My idea is by using UDEV to give every device a unique name, (ie make /dev/usb/cfreader the Name and /dev/sdxn the Symlink,) you could allocate an icon symbol and title according to the device node.

Once that is done, every other auto-mounting system will be dust, I think.
User avatar
davecs
LXF regular
 
Posts: 530
Joined: Sat Apr 09, 2005 11:13 pm
Location: Dagenham, Essex


Return to Discussion

Who is online

Users browsing this forum: Bing [Bot] and 0 guests