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

2006-05-09 Thread Wolfgang Mader
>
> Of course, if you have volume labels on the partitions, they will be
> automatically mounted at /media/ - we don't _have_ to modify
> udev :-)

I get devices like
/dev/disk/by-label/
so I think my volumelabes are set up correctly. But why does kde not mount the 
volums under /media/ but under /media/sdxy ? What am I missing.

Of course I can use the /dev/disk/by-label but it would be nicer and more 
intuitive it kde would use the labels in media.

Cheers W. Mader


pgp6A82UgIyoc.pgp
Description: PGP signature


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

2006-05-02 Thread Derek Broughton
Florian Kulzer wrote:

> On Tue, May 02, 2006 at 10:13:06 -0300, Derek Broughton wrote:
>> Derek Broughton wrote:
> 
> [...]
> 
>> > Where do you figure that?  Every time I install a USB storage device
>> > it's automatically mounted, and yes, it's mounted at /media/
>> > (provided a
>> > partition label exists).  Why _shouldn't_ udev mount?  Hotplug could,
>> > and
>> > udev replaces it.  Non-removable storage is not automatically mounted
>> > (though it could be if you wanted it), but removables are handled
>> > differently.
>> 
>> Oops, sorry - YMMV :-)
>> 
>> I'm using Ubuntu, so it's entirely possible that this behaviour isn't
>> happening under Debian - but this doesn't change the fact that such
>> behaviour _is_ configurable.
> 
> The "RUN" key can be used to make udev execute a script when a device is
> created. I have never tried myself to automount devices that way, but I
> would assume that it is possible to do so. Ubuntu might use this, 

Sorry, I'm still not quite correct.  Ubuntu doesn't actually _mount_ USB
storage devices until you ask it to - it puts the device icon on the
desktop as you say Debian does.  However, the point I was failing to make
is that the partition's label is used as the mount point if you have one.
-- 
derek


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



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

2006-05-02 Thread Florian Kulzer
On Tue, May 02, 2006 at 10:13:06 -0300, Derek Broughton wrote:
> Derek Broughton wrote:

[...]

> > Where do you figure that?  Every time I install a USB storage device it's
> > automatically mounted, and yes, it's mounted at /media/ (provided a
> > partition label exists).  Why _shouldn't_ udev mount?  Hotplug could, and
> > udev replaces it.  Non-removable storage is not automatically mounted
> > (though it could be if you wanted it), but removables are handled
> > differently.
> 
> Oops, sorry - YMMV :-)
> 
> I'm using Ubuntu, so it's entirely possible that this behaviour isn't
> happening under Debian - but this doesn't change the fact that such
> behaviour _is_ configurable.

The "RUN" key can be used to make udev execute a script when a device is
created. I have never tried myself to automount devices that way, but I
would assume that it is possible to do so. Ubuntu might use this, or an
approach similar to what we discussed earlier in this thread. Debian
does not set this up by default, and many KDE users seem to be satisfied
with having the mounting happen when they click on the device icon on
the desktop. I think the Ubuntu behavior is not just an activated option
in a configuration file somewhere, but rather some dedicated customization
which required additional scripting etc. to set up.

-- 
Regards,
  Florian


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



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

2006-05-02 Thread Derek Broughton
Derek Broughton wrote:

> Christian Schuerer wrote:
> 
>> On Monday 01 May 2006 15:10, Derek Broughton wrote:
>>> > 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.
>>>
>>> Of course, if you have volume labels on the partitions, they will be
>>> automatically mounted at /media/ - we don't _have_ to modify
>>> udev :-)
>> 
>> Why should it be mounted automatically? Udev doesn't mount, it just
>> creates the device nodes
> 
> Where do you figure that?  Every time I install a USB storage device it's
> automatically mounted, and yes, it's mounted at /media/ (provided a
> partition label exists).  Why _shouldn't_ udev mount?  Hotplug could, and
> udev replaces it.  Non-removable storage is not automatically mounted
> (though it could be if you wanted it), but removables are handled
> differently.

Oops, sorry - YMMV :-)

I'm using Ubuntu, so it's entirely possible that this behaviour isn't
happening under Debian - but this doesn't change the fact that such
behaviour _is_ configurable.
-- 
derek


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



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

2006-05-02 Thread Anders E. Andersen

Robert Tilley skrev:

On Sunday 30 April 2006 07:38, Wolfgang Mader wrote:
  

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?




I would check /etc/fstab and verify that your device is set up correctly.  If 
your stick is something you use regularly, you should go ahead and put it in 
fstab.
  
Don't use fstab for memory sticks and other plugable media. Use 
udev/hal/pmount.


IMHO

Anders


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



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

2006-05-02 Thread Robert Tilley
On Sunday 30 April 2006 07:38, Wolfgang Mader wrote:
> 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?


I would check /etc/fstab and verify that your device is set up correctly.  If 
your stick is something you use regularly, you should go ahead and put it in 
fstab.

If not, check the configuration of udev.

Hope this helps, Bob
-- 
Q:  How many lawyers does it take to change a light bulb?
A:  You won't find a lawyer who can change a light bulb.  Now, if
you're looking for a lawyer to screw a light bulb...


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



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

2006-05-02 Thread Derek Broughton
Christian Schuerer wrote:

> On Monday 01 May 2006 15:10, Derek Broughton wrote:
>> > 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.
>>
>> Of course, if you have volume labels on the partitions, they will be
>> automatically mounted at /media/ - we don't _have_ to modify
>> udev :-)
> 
> Why should it be mounted automatically? Udev doesn't mount, it just
> creates the device nodes

Where do you figure that?  Every time I install a USB storage device it's
automatically mounted, and yes, it's mounted at /media/ (provided a
partition label exists).  Why _shouldn't_ udev mount?  Hotplug could, and
udev replaces it.  Non-removable storage is not automatically mounted
(though it could be if you wanted it), but removables are handled
differently.
-- 
derek


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



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

2006-05-01 Thread Christian Schuerer
On Monday 01 May 2006 15:10, Derek Broughton wrote:
> > 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.
>
> Of course, if you have volume labels on the partitions, they will be
> automatically mounted at /media/ - we don't _have_ to modify
> udev :-)

Why should it be mounted automatically? Udev doesn't mount, it just creates 
the device nodes. Device nodes by labels can be found at

/dev/disk/by-label/

Regards,

   Christian


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



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

2006-05-01 Thread Derek Broughton
Florian Kulzer wrote:

> On Sun, Apr 30, 2006 at 13:38:17 +0200, Wolfgang Mader wrote:
>> 
>> 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.
> 
> 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)
...
> As far as amarok is concerned, I would use a udev rule to create a
> symlink, e.g.
> 
> BUS=="usb", SYSFS{serial}=="xx", 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.

Of course, if you have volume labels on the partitions, they will be
automatically mounted at /media/ - we don't _have_ to modify
udev :-)
-- 
derek


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



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

2006-04-30 Thread Florian Kulzer
On Sun, Apr 30, 2006 at 13:48:20 -0300, Gurvan Huiban wrote:

[...]

> However, I think it should not be so complicated to set up something that 
> simple (there may be a small KDE usability issue here).

I agree and I suspect that there is indeed a better way to achieve this,
but I could not find anything about it on docs.kde.org. I made a wild
guess and tried %d in the hope that that would point to the device name,
but no such luck. I am not knowledgeable enough to dig through the
source code and find out what exactly is going on.

The behavior might simply be a symptom of KDE beginning to target users
who do not even know what "mounting" is and who just want a window to
open or a player to start when they insert media. There are other
packages to achieve automounting of USB devices, but these don't
integrate too well with KDE as far as I know.

-- 
Regards,
  Florian


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



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

2006-04-30 Thread Gurvan Huiban
On Sunday 30 April 2006 12:57, Florian Kulzer wrote:
> If you save this as "pmount-wrapper.sh" (without the two scissor lines)
> and make it executable for your user, you can set the command to
>
> pmount-wrapper.sh %u
>
> and the automounting should work. Of course, the script has to be
> somewhere in your $PATH so that it can be found, or you have to specify
> the full path explicitly in the command box.

It works great! Thank you!

However, I think it should not be so complicated to set up something that 
simple (there may be a small KDE usability issue here).

-- 

Gurvan Huiban

 "My mother used to make coffee this way...
   Hot...
Strong...
 And good."(from "Once upon in the West")


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



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

2006-04-30 Thread Florian Kulzer
On Sun, Apr 30, 2006 at 11:23:18 -0300, Gurvan Huiban wrote:
> On Sunday 30 April 2006 11:01, Florian Kulzer wrote:
> > > Actually, it works great. The only  thing that bothers me is that I don't
> > > know how to define my own actions? I searched, but I could not find how
> > > to do it.
> >
> > If I remember correctly, you can choose from a set of standard actions
> > when you insert a new media type for the first time. You can change this
> > later and also select other programs/commands to handle a given media
> > type if you go to "K-Menu > Control Center > Storage Media >
> > Notifications > Add / Toggle as Auto Action". (You also need to activate
> > the three options on the "Advanced" tab for this to work.)
> 
> That's correct. I missed it.
> 
> However, I can't make it work the way I would like to. For instance, let's 
> suppose that I want to mount automatically any removable device, without 
> opening Konqueror window.
> 
> I created and added to the unmounted removable device the "Automount" action, 
> executing the following command:
> pmount %u
> But it does nothing! (actually, I don't know exactly what is this %u. My 
> guess 
> is that it is a string corresponding to the /dev/device_detected).
> 
> And when I click on the help, it says something like "write me",  which is 
> not 
> so helpful :o)

Yes, I could not find any good help on this either. I then used

kdialog --msgbox %u

as the command. You get a message box which tells you that %u is
actually the URL to the device as konqueror needs it, i.e. something
like "system:/media/sda1". Not surprisingly, pmount does not like this
at all. I tried to use sed or cut to extract the relevant part of this
string and pipe it to pmount, but this does not work if I put it into
the command box directly, probably because %u does not fit into the
normal shell parameter expansion scheme.

In the end I had to do it using a short bash script:

8<
#! /bin/bash
# pmount-wrapper script to automount removable devices

pmount /dev${1#system:/media}
>8

If you save this as "pmount-wrapper.sh" (without the two scissor lines)
and make it executable for your user, you can set the command to

pmount-wrapper.sh %u

and the automounting should work. Of course, the script has to be
somewhere in your $PATH so that it can be found, or you have to specify
the full path explicitly in the command box.

-- 
Regards,
  Florian



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

2006-04-30 Thread D. Michael 'Silvan' McIntyre
On Sunday 30 April 2006 10:23 am, Gurvan Huiban wrote:

> And when I click on the help, it says something like "write me",  which is
> not so helpful :o)
>
> How can I define the action I want to run?

LOL!  I have no idea, but I'm glad to see I'm not the only one who wound up in 
that same place.  I decided to just let it sit there for a few package 
versions and see if the problems get sorted out for themselves without me 
having to get more gray hair.

-- 
D. Michael 'Silvan' McIntyre     Silvan <[EMAIL PROTECTED]>
Linux fanatic, and certified Geek;  registered Linux user #243621

Author of Rosegarden Companion http://rosegarden.sourceforge.net/tutorial/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



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

2006-04-30 Thread Gurvan Huiban
On Sunday 30 April 2006 11:01, Florian Kulzer wrote:
> > Actually, it works great. The only  thing that bothers me is that I don't
> > know how to define my own actions? I searched, but I could not find how
> > to do it.
>
> If I remember correctly, you can choose from a set of standard actions
> when you insert a new media type for the first time. You can change this
> later and also select other programs/commands to handle a given media
> type if you go to "K-Menu > Control Center > Storage Media >
> Notifications > Add / Toggle as Auto Action". (You also need to activate
> the three options on the "Advanced" tab for this to work.)

That's correct. I missed it.

However, I can't make it work the way I would like to. For instance, let's 
suppose that I want to mount automatically any removable device, without 
opening Konqueror window.

I created and added to the unmounted removable device the "Automount" action, 
executing the following command:
pmount %u
But it does nothing! (actually, I don't know exactly what is this %u. My guess 
is that it is a string corresponding to the /dev/device_detected).

And when I click on the help, it says something like "write me",  which is not 
so helpful :o)

How can I define the action I want to run?
-- 

Gurvan Huiban

 "My mother used to make coffee this way...
   Hot...
Strong...
 And good."(from "Once upon in the West")



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

2006-04-30 Thread Florian Kulzer
On Sun, Apr 30, 2006 at 10:35:17 -0300, Gurvan Huiban wrote:
> One question:
> 
> > 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.
> 
> Actually, it works great. The only  thing that bothers me is that I don't 
> know 
> how to define my own actions? I searched, but I could not find how to do it.

If I remember correctly, you can choose from a set of standard actions
when you insert a new media type for the first time. You can change this
later and also select other programs/commands to handle a given media
type if you go to "K-Menu > Control Center > Storage Media >
Notifications > Add / Toggle as Auto Action". (You also need to activate
the three options on the "Advanced" tab for this to work.)

-- 
Regards,
  Florian


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



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

2006-04-30 Thread Gurvan Huiban
One question:

> 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.

Actually, it works great. The only  thing that bothers me is that I don't know 
how to define my own actions? I searched, but I could not find how to do it.

-- 

Gurvan Huiban

 "My mother used to make coffee this way...
   Hot...
Strong...
 And good."(from "Once upon in the West")


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



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

2006-04-30 Thread Florian Kulzer
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}=="xx", 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


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]