Trouble with eject and USB devices

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Trouble with eject and USB devices

Sven Arvidsson
Hi,

I need som help tracking down this issue, figuring out if it's a bug, a
misconfiguration on my part or something else.

I have an Ipod (USB device) and when I use eject from nautilus or the
terminal, I get this error message: "eject: unable to open `/dev/sdb2'".

The Ipods are configured in HAL to be ejected, not only unmounted, for
the display to say "It's now safe to remove".

If I run eject as root, everything works fine.

I found an earlier thread about a similar issue, blaming udev, but
before I report a bug I'd like to get this confirmed.
http://lists.debian.org/debian-gtk-gnome/2005/02/msg00058.html

Thanks in advance,

--
Cheers,
Sven Arvidsson
http://www.whiz.se
PGP Key ID 760BDD22


signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Trouble with eject and USB devices

cddesjar
I've noticed that my IPod also experiences this and after I've
eventually ejected it the device stills gives the impression that it is
communicating with my computer (i.e. it says do not remove device on the
screen of the IPod).  I know that at least Ubuntu and Fedora have
figured out how to properly communicate with an IPod so that it can be
safely removed (i.e. that warning goes away and my battery icon comes
on).   Maybe looking into how Ubuntu and Fedora fixed this might shed
some light on how to what's wrong.
Cheers,
Chris Desjardins
MSc Candidate
University of Alberta
Edmonton Alberta T6G 2E9


Sven Arvidsson wrote:

> Hi,
>
> I need som help tracking down this issue, figuring out if it's a bug, a
> misconfiguration on my part or something else.
>
> I have an Ipod (USB device) and when I use eject from nautilus or the
> terminal, I get this error message: "eject: unable to open `/dev/sdb2'".
>
> The Ipods are configured in HAL to be ejected, not only unmounted, for
> the display to say "It's now safe to remove".
>
> If I run eject as root, everything works fine.
>
> I found an earlier thread about a similar issue, blaming udev, but
> before I report a bug I'd like to get this confirmed.
> http://lists.debian.org/debian-gtk-gnome/2005/02/msg00058.html
>
> Thanks in advance,
>
>  


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

Reply | Threaded
Open this post in threaded view
|

Re: Trouble with eject and USB devices

Alex Malinovich-2
On Wed, 2006-11-01 at 10:34 -0700, Christopher Desjardins wrote:
> I've noticed that my IPod also experiences this and after I've
> eventually ejected it the device stills gives the impression that it is
> communicating with my computer (i.e. it says do not remove device on the
> screen of the IPod).  I know that at least Ubuntu and Fedora have
> figured out how to properly communicate with an IPod so that it can be
> safely removed (i.e. that warning goes away and my battery icon comes
> on).   Maybe looking into how Ubuntu and Fedora fixed this might shed
> some light on how to what's wrong.

While I can't claim to know whether this is the "official" solution,
from personal experience with setting this up on my system, it seems
that one of the tests that the Ipod uses to determine whether it can be
unplugged or not is whether or not a USB connection is still
established, regardless of the filesystem status. The only reliable way
I've found to get the Ipod to SAY that it's safe to unplug it is to
unload the appropriate kernel module and thereby deactivate the USB
port. (This would probably be one of (ehci|uhci|ohci)-hcd in the
2.6-series kernels)

I don't believe this is a very good solution however since unloading
that module would also cause any other device using that particular USB
connection to lose connectivity. It would definitely be interesting to
see how Ubuntu and Fedora addressed this. Perhaps there's a way to send
a signal to a single USB port telling it to shut off?

--
Alex Malinovich
Support Free Software, delete your Windows partition TODAY!
Encrypted mail preferred. You can get my public key from any of the
pgp.net keyservers. Key ID: A6D24837

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Trouble with eject and USB devices

Sven Arvidsson
> I know that at least Ubuntu and Fedora have
> > figured out how to properly communicate with an IPod so that it can be
> > safely removed (i.e. that warning goes away and my battery icon comes
> > on).   Maybe looking into how Ubuntu and Fedora fixed this might shed
> > some light on how to what's wrong.

Trying Ubuntu is a good idea. I will download a live CD and see if I can
find anything interesting.

> While I can't claim to know whether this is the "official" solution,
> from personal experience with setting this up on my system, it seems
> that one of the tests that the Ipod uses to determine whether it can be
> unplugged or not is whether or not a USB connection is still
> established, regardless of the filesystem status. The only reliable way
> I've found to get the Ipod to SAY that it's safe to unplug it is to
> unload the appropriate kernel module and thereby deactivate the USB
> port. (This would probably be one of (ehci|uhci|ohci)-hcd in the
> 2.6-series kernels)
>
> I don't believe this is a very good solution however since unloading
> that module would also cause any other device using that particular USB
> connection to lose connectivity. It would definitely be interesting to
> see how Ubuntu and Fedora addressed this. Perhaps there's a way to send
> a signal to a single USB port telling it to shut off?
AFAIK, the Ipod waits for ioctl CDROM_EJECT sent by eject[0], not umount
which is why HAL is configured to use eject for Ipod and similar
devices[1].

Like I said before, this works if I explicitly run "eject /dev/sdb2" as
root. The device is unmounted, eject and the display lights up telling
me it's safe to remove.

I'm not sure why this doesn't work as a normal user, can this be a
problem with the way udev or HAL is configured?


0.
http://mail.gnome.org/archives/desktop-devel-list/2006-September/msg00482.html
1. /usr/share/hal/fdi/information/10freedesktop/10-usb-music-players.fdi
--
Cheers,
Sven Arvidsson
http://www.whiz.se
PGP Key ID 760BDD22


signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Trouble with eject and USB devices

Sven Arvidsson
In reply to this post by cddesjar
On Wed, 2006-11-01 at 10:34 -0700, Christopher Desjardins wrote:
> I've noticed that my IPod also experiences this and after I've
> eventually ejected it the device stills gives the impression that it is
> communicating with my computer (i.e. it says do not remove device on the
> screen of the IPod).  I know that at least Ubuntu and Fedora have
> figured out how to properly communicate with an IPod so that it can be
> safely removed (i.e. that warning goes away and my battery icon comes
> on).   Maybe looking into how Ubuntu and Fedora fixed this might shed
> some light on how to what's wrong.

I missed your initial nautilus bug about this. Anyway, I found this
Ubuntu bug that indicates that this is a kernel issue that Ubuntu has
patched.

https://launchpad.net/distros/ubuntu/+source/linux-source-2.6.15/+bug/11517

--
Cheers,
Sven Arvidsson
http://www.whiz.se
PGP Key ID 760BDD22


signature.asc (196 bytes) Download Attachment