[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: kde, udev, hal and friends...



On Sun, Apr 30, 2006 at 13:38:17 +0200, Wolfgang Mader wrote:
> Hallo list,
> 
> I have installed debian/sid on my machine. I own two usb-storrage-devices. On 
> one of them I have stored all my music. This music is known by amarok. But 
> the path under which this disc is available depend on the order of plugging 
> in the two storrage devices. One time it is /dev/sda1 an the other it is 
> under /dev/sdb1.
> 
> Now there is a way udev provides under /dev/disk/by-id/ to mount one device 
> allways at one mountpoint. But for this I have to make ernties to /etc/fstab. 
> Is this the right way to solve the problem, or is there a way to tell udev 
> not to create /media/sdxy but something like /media/devicename-partitionname?
> 
> The next problem is that I have no permissions as user if I mount  a device 
> after hal has noticed it. root is the owner. So I am not able to add files to 
> the disc. To solve this I did an 
> 
> chown myaccount:myaccount .
> 
> for the . - file on the disc. So I have the neede permisson, but I do not know 
> it there is a better way to solve this?

The pmount command was specifically created to address the problem of
pluggable devices and mount permissions. If you install the package
"pmount" and add your user to the "plugdev" group, you can mount all
pluggable devices and removable media without the need for a
corresponding fstab entry.  ("man pmount" has more details)

The best thing about this is that it is fully integrated into KDE: If
you have pmount, udev, hal and dbus installed, you can have an icon
appear on your desktop whenever a USB stick or a CD, DVD etc. is
inserted. This can be selected in the KDE control center; it is also
possible to configure default actions, for example to start a media
player if an audio CD is inserted. Normally you just click on the icon
and Konqueror will open it in a new window.

As far as amarok is concerned, I would use a udev rule to create a
symlink, e.g.

BUS=="usb", SYSFS{serial}=="xxxxxxxxxxxxxx", NAME="%k", SYMLINK="my_music"

This way the primary name of the device will be its normal kernel name,
but you will always get /dev/my_music pointing to the right /dev entry.
I would expect that the kio_slave will use pmount to mount the device if
you access /dev/my_music from amarok. I have never tried this last part
myself, though.

-- 
Regards,
          Florian



Reply to: