| View previous topic :: View next topic |
| Author |
Message |
iamben Apprentice

Joined: 10 May 2004 Posts: 278
|
Posted: Sun Aug 12, 2007 2:53 am Post subject: kde's "safely remove" needs full rw on device to s |
|
|
im using kde/hal to handle mounts/unmounts of my usb storage devices, so i put my user in the plugdev group. the device shows up in system:/media just great, and when i click to browse to it, it automounts perfectly and i can read/write/delete anything i like.
however, when i right click the device and choose "safely remove", it pops up an error dialog stating "device was unmounted but could not be ejected". just to be clear, it DOES successfully unmount, so i can safely unplug it just fine, but it complains about the "eject" portion not working. its still functional but the error box EVERY time is annoying.
i looked around and finally figured out that you must have full read/write on the device node for the device (ie /dev/sde1 for my usb drive) for the 'eject' to succeed (and hence NOT give an error). i could put my users in the disk group and it works, but thats WAY more than i want to give normal users.
is this something that should be remedied? i'll probably fix mine by coming up with some udev rules to make sure my usb storage devices get root:plugdev ownership rather than root:disk, but what does everyone else think? should this be fixed in kde, hal, or udev? or am i crazy, and this shouldnt be fixed at all? |
|
| Back to top |
|
 |
ttuegel Apprentice

Joined: 18 Jan 2005 Posts: 176 Location: Illinois, USA
|
Posted: Thu Aug 16, 2007 9:12 pm Post subject: |
|
|
When I first encountered this problem, I encountered two solutions, one on the Debian bugzilla and one on Ubuntu's (I think...). Long story short, I can't find them now, but your two options are to make a udev rule that creates usb drive devices in group "plugdev" or editing the konqueror context menu to make the eject command fail silently.
My $0.02: It should be fixed in udev, not just in Konqueror, as other programs in other environments may need to use 'eject'. Also, CDs are removable devices, and that's how they are handled.
I'm relieved to know I'm not the only one with this issue, but at the same time, an error this... glaring?... probably shouldn't have crept in in the first place... |
|
| Back to top |
|
 |
anz Apprentice


Joined: 05 Feb 2003 Posts: 279 Location: Vienna
|
Posted: Fri Aug 17, 2007 11:57 pm Post subject: |
|
|
Dear ttuegel & iamben,
after upgrading to kde-3.5.7 I have the same "problem": choosing "safely remove" unmounts the usb device but enters an error warning "The device was successfully unmounted, but could not be ejected" (Error - kio_media_mounthelper).
dmesg shows no error. _________________ Greetings from Vienna |
|
| Back to top |
|
 |
ttuegel Apprentice

Joined: 18 Jan 2005 Posts: 176 Location: Illinois, USA
|
Posted: Sun Aug 19, 2007 3:42 pm Post subject: |
|
|
Alright, finally got around to writing a correct udev rule for this. Basically, this assigns any removable disk to group "plugdev" instead of "disk". Here is my /etc/udev/rules.d/50-udev.rules file before and after:
| /etc/udev/rules.d/50-udev.rules Before wrote: | # disk devices
KERNEL=="sd*", NAME="%k", GROUP="disk"
KERNEL=="dasd*", NAME="%k", GROUP="disk"
KERNEL=="ataraid*", NAME="%k", GROUP="disk" |
| /etc/udev/rules.d/50-udev.rules After wrote: | # disk devices
KERNEL=="sd*", NAME="%k", GROUP="disk"
KERNEL=="dasd*", NAME="%k", GROUP="disk"
KERNEL=="ataraid*", NAME="%k", GROUP="disk"
# removable disks
SUBSYSTEM=="block", KERNEL=="sd*", ATTRS{removable}=="1", GROUP="plugdev" |
Now everything in KDE works as expected. |
|
| Back to top |
|
 |
blubbi Guru


Joined: 27 Apr 2003 Posts: 564 Location: Halle (Saale), Germany
|
Posted: Wed Aug 22, 2007 4:03 pm Post subject: |
|
|
Had the same problem here.
But I would recommend to create your own rules file, so you dont have to hasle around with updates later.
| Code: | | echo -e '# removable disks\nACTION=="add", SUBSYSTEM=="block", KERNEL=="sd[a-z][0-9]", ATTRS{removable}=="1", GROUP="plugdev"\n' >> /etc/udev/rules.d/51-local.rules |
Notice, this will only work with USB Devices, or more specific, with devices which come with the "removable" attribute. ATTRS{removable}=="1"
This rule does not work with eSATA drives (at least it didn't in my case)
You could substitute ATTRS{removable}=="1" with ATTRS{model}=="YOUR MODELINFO FROM UDEVINFO" but than you need to SUBSYSTEM=="block" to SUBSYSTEM=="scsi". To be mor specifi you could add more identifyer from the section where SUBSYSTEMS=="scsi" occures
To geht the information use:
| Code: | | udevinfo -a -p $(udevinfo -q path -n /dev/sdX) |
regards
blubbi |
|
| Back to top |
|
 |
ElSenorPantelone n00b

Joined: 24 Jan 2006 Posts: 72
|
Posted: Wed Aug 29, 2007 5:16 pm Post subject: |
|
|
| Thanks blubbi, good solution. |
|
| Back to top |
|
 |
wyv3rn Apprentice

Joined: 18 Aug 2005 Posts: 154 Location: USA
|
|
| Back to top |
|
 |
dopey Apprentice

Joined: 10 Feb 2003 Posts: 235
|
Posted: Fri Aug 31, 2007 4:51 pm Post subject: |
|
|
| apparently my firewire disks don't appear as removable. So the udev solution doesn't work with firewire either. |
|
| Back to top |
|
 |
uncleringo Tux's lil' helper


Joined: 21 Jul 2004 Posts: 146
|
Posted: Mon Sep 03, 2007 12:12 pm Post subject: |
|
|
I can't unmount my kde-mounted usb keys without su'ing to root. I used to be able to, but it started to not work a few months ago. This is the first time I've properly checked the forums for this problem since it's not too much hassle to su to root and type umount. My regular user is in the plugdev group, and I've modified my udev config to make my usb key mount as root:plugdev, but i'm still unable to umount as a regular user.
Any ideas?
My usb device looks like:
| Code: | | brw-rw---- 1 root plugdev 8, 33 Sep 3 13:06 /dev/sdc1 |
I'm not sure what the 'b' is in the permissions but does group need this too? |
|
| Back to top |
|
 |
paulj Guru


Joined: 30 Sep 2004 Posts: 518 Location: Wales, UK
|
Posted: Sat Oct 13, 2007 7:02 am Post subject: |
|
|
| blubbi wrote: | Had the same problem here.
But I would recommend to create your own rules file, so you dont have to hasle around with updates later.
| Code: | | echo -e '# removable disks\nACTION=="add", SUBSYSTEM=="block", KERNEL=="sd[a-z][0-9]", ATTRS{removable}=="1", GROUP="plugdev"\n' >> /etc/udev/rules.d/51-local.rules |
|
Thanks Blubbi - that fixed it for me!
One small question - I assume the rules are read when udev is started. What is the simplest way to get the new rules included? Would it be to:
| Code: |
/etc/init.d/udev-postmount restart
| or
| Code: |
/etc/init.d/hald restart
|
or is it best to restart the computer (which is actually what I did)?
Thanks again! |
|
| Back to top |
|
 |
blubbi Guru


Joined: 27 Apr 2003 Posts: 564 Location: Halle (Saale), Germany
|
Posted: Sat Oct 13, 2007 2:10 pm Post subject: |
|
|
udev should be notified via inotify that there were files changed and reread the new rules.
But you could run | Code: | | udevcontrol reload_rules | to read the rules |
|
| Back to top |
|
 |
paulj Guru


Joined: 30 Sep 2004 Posts: 518 Location: Wales, UK
|
Posted: Sat Oct 13, 2007 7:38 pm Post subject: |
|
|
| blubbi wrote: |
udev should be notified via inotify that there were files changed and reread the new rules.
|
I never thought to check! I guessed the mechanism relied on restarting the service.
| blubbi wrote: |
But you could run | Code: | | udevcontrol reload_rules | to read the rules |
I'll remember this for next time.
Thanks! |
|
| Back to top |
|
 |
Nikoli n00b

Joined: 13 Nov 2007 Posts: 35
|
|
| Back to top |
|
 |
blubbi Guru


Joined: 27 Apr 2003 Posts: 564 Location: Halle (Saale), Germany
|
Posted: Sat Jan 26, 2008 1:01 pm Post subject: |
|
|
Options:
-u Unmount given URL
-m Mount given URL (default)
-e Eject given URL via kdeeject
-s Unmount and Eject given URL (necessary for some USB devices)
mmmh, what happens with CD/DVDs? Did out test it, are the ejected?
Ejecting a USB drive is not that wrong IMHO. If I remember, ejecting a micro disk spins it down.
regards
blubbi _________________ -->Please add [solved] to the initial post's subject line if you feel your problem is resolved.
-->Help answer the unanswered
http://olausson.de |
|
| Back to top |
|
 |
Nikoli n00b

Joined: 13 Nov 2007 Posts: 35
|
Posted: Sat Jan 26, 2008 1:24 pm Post subject: |
|
|
For ejecting CD/DVD there is another file /usr/kde/3.5/share/apps/konqueror/servicemenus/media_eject.desktop
I have no problems with CD/DVD and with usb flash.
Ejecting USB is really formal, I think it is for prevention errors with some incorrect devices. |
|
| Back to top |
|
 |
leosgb Apprentice

Joined: 07 Mar 2006 Posts: 272 Location: Rio de Janeiro, Brazil
|
Posted: Tue Feb 05, 2008 4:56 am Post subject: |
|
|
| Thanks for the tip guys! But I think that one wants to receive any error message... to disable it means to not know there is something wrong! |
|
| Back to top |
|
 |
RoundsToZero Guru


Joined: 17 Nov 2003 Posts: 478 Location: New York, NY
|
Posted: Tue Feb 05, 2008 5:02 am Post subject: |
|
|
What I did was make my /usr/bin/eject setuid root but group plugdev and not executable by other (non-plugdev) users.
| Code: | | -rwsr-x--- 1 root plugdev 21044 2007-02-07 02:26 /usr/bin/eject |
|
|
| Back to top |
|
 |
beatryder Veteran


Joined: 08 Apr 2005 Posts: 1138
|
Posted: Wed Feb 06, 2008 6:26 pm Post subject: |
|
|
do any of you guys have pmount installed?
| Code: |
Lisa ~ $ which pmount
/usr/bin/pmount
|
I have no problems using kde to unmount my devices, I am also in the usb and plugdev groups.
If you guys want any of my configs, just ask and I'll be glad to share. _________________ Dont make it idiot proof, make it work.
Neucode.org
<suppressed key> |
|
| Back to top |
|
 |
jstead1 Guru


Joined: 01 Aug 2003 Posts: 427 Location: Oswego, NY where the snow is deep
|
Posted: Wed Apr 23, 2008 8:20 pm Post subject: |
|
|
This stopped working recently, because the group permissions for removable devices changed to read only. I added a MODE="660" to change the group permissions to read write again, so the lines in 51-local rules would be something like
| Code: | # removable disks
ACTION=="add", SUBSYSTEM=="block", KERNEL=="sd[a-z][0-9]", ATTRS{removable}=="1", GROUP="plugdev", MODE="660" |
_________________ jim |
|
| Back to top |
|
 |
carpman Advocate

Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Thu May 15, 2008 9:09 am Post subject: |
|
|
useful thread will try some suggestions _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
| Back to top |
|
 |
SeaTiger l33t


Joined: 22 Nov 2007 Posts: 603 Location: Toronto, Ontario, Canada
|
Posted: Fri May 16, 2008 4:34 am Post subject: |
|
|
I am using gnome and don't seems to have this problem, I also have my normal account (non-root) in the following group: | Code: | cdrom
cdrw
usb
plugdev |
|
|
| Back to top |
|
 |
|