linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fwd: Safely remove option shows with Micro SD Card connected to Linux through an Android phone
       [not found] <CANc+2y5iLuZG5wPab5Hf0-mAngpkO+72XZR3FK9kgR8-kAKZ1Q@mail.gmail.com>
@ 2012-12-11 18:04 ` prasannatsmkumar
  2012-12-11 20:37   ` Alan Stern
  0 siblings, 1 reply; 11+ messages in thread
From: prasannatsmkumar @ 2012-12-11 18:04 UTC (permalink / raw)
  To: linux-kernel, linux-usb, nautilus-list

Hi All,

I connected an Android phone using USB cable to my machine running
Linux (Linux 3.0, 3.2, 3.5). Mounted the SD card in phone in system
(phone is just a pass through I guess). When I choose "Safely Remove"
option in nautilus file manager (gnome's default file manager) I got
an error saying

"Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
USB device: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-5)
SYNCHRONIZE CACHE: OK
STOP UNIT: FAILED: No such file or directory"

and it goes to unmounted state (yes it should go to and this is not a
problem). But I am not able to find the reason for the above error
message pop-up. If I choose "Eject" option then things are fine (I
think Eject does more than un-mounting the file system).

I think "safely remove" tries to cut the power supply to the device
but eject does not do that. Is that correct? If the device cannot be
powered down (due to battery charging) why this option is shown? Is
kernel exposing such capability to the user space?

I am not sure whether this is the correct place to ask this question.
If this is not the correct place please direct me to correct place.

Note: Previous attempt to send this mail to linux-kernel and linux-usb
mailing list failed. So resending this again. Please bear with me
nautilus-list people.

Thanks and Regards,
PrasannaKumar

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Fwd: Safely remove option shows with Micro SD Card connected to Linux through an Android phone
  2012-12-11 18:04 ` Fwd: Safely remove option shows with Micro SD Card connected to Linux through an Android phone prasannatsmkumar
@ 2012-12-11 20:37   ` Alan Stern
  2012-12-12  6:26     ` Robert Hancock
  2012-12-13 16:41     ` prasannatsmkumar
  0 siblings, 2 replies; 11+ messages in thread
From: Alan Stern @ 2012-12-11 20:37 UTC (permalink / raw)
  To: prasannatsmkumar; +Cc: linux-kernel, linux-usb, nautilus-list

On Tue, 11 Dec 2012, prasannatsmkumar wrote:

> Hi All,
> 
> I connected an Android phone using USB cable to my machine running
> Linux (Linux 3.0, 3.2, 3.5). Mounted the SD card in phone in system
> (phone is just a pass through I guess). When I choose "Safely Remove"
> option in nautilus file manager (gnome's default file manager) I got
> an error saying
> 
> "Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
> USB device: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-5)
> SYNCHRONIZE CACHE: OK
> STOP UNIT: FAILED: No such file or directory"

STOP UNIT means spin down the disk or eject the disc.  Since your phone
doesn't have a disk drive or an optical disc, no wonder this step
failed.

> and it goes to unmounted state (yes it should go to and this is not a
> problem). But I am not able to find the reason for the above error
> message pop-up. If I choose "Eject" option then things are fine (I
> think Eject does more than un-mounting the file system).
> 
> I think "safely remove" tries to cut the power supply to the device
> but eject does not do that. Is that correct?

No, neither option cuts power.  The main difference is that "safely
remove" disables the USB connection, so that if the device has an "okay
to unplug now" light, the light will turn on.

> If the device cannot be
> powered down (due to battery charging) why this option is shown? Is
> kernel exposing such capability to the user space?
> 
> I am not sure whether this is the correct place to ask this question.
> If this is not the correct place please direct me to correct place.

You probably should get in touch with the people who maintain the 
Nautilus program if you want to know why it does something.

Alan Stern


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Fwd: Safely remove option shows with Micro SD Card connected to Linux through an Android phone
  2012-12-11 20:37   ` Alan Stern
@ 2012-12-12  6:26     ` Robert Hancock
  2012-12-12 15:41       ` Alan Stern
  2012-12-13 16:41     ` prasannatsmkumar
  1 sibling, 1 reply; 11+ messages in thread
From: Robert Hancock @ 2012-12-12  6:26 UTC (permalink / raw)
  To: Alan Stern; +Cc: prasannatsmkumar, linux-kernel, linux-usb, nautilus-list

On 12/11/2012 02:37 PM, Alan Stern wrote:
> On Tue, 11 Dec 2012, prasannatsmkumar wrote:
>
>> Hi All,
>>
>> I connected an Android phone using USB cable to my machine running
>> Linux (Linux 3.0, 3.2, 3.5). Mounted the SD card in phone in system
>> (phone is just a pass through I guess). When I choose "Safely Remove"
>> option in nautilus file manager (gnome's default file manager) I got
>> an error saying
>>
>> "Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
>> USB device: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-5)
>> SYNCHRONIZE CACHE: OK
>> STOP UNIT: FAILED: No such file or directory"
>
> STOP UNIT means spin down the disk or eject the disc.  Since your phone
> doesn't have a disk drive or an optical disc, no wonder this step
> failed.

The reason it's likely doing a STOP UNIT on USB storage devices is that 
this is preferable for at least USB-connected HDs (at least where the 
USB to SATA, etc. converter bothers to implement the translation). For 
many drives, it's better for the disk's lifespan to power it down 
normally (as it would be if it was in a machine that was being shut 
down) so it can unload its heads in a controlled fashion, rather than 
just cutting the power on the running disk and causing an emergency head 
retract.

Some types of devices may not support that command or may not do 
anything useful with it, but "No such file or directory" seems a strange 
error to run into.

>
>> and it goes to unmounted state (yes it should go to and this is not a
>> problem). But I am not able to find the reason for the above error
>> message pop-up. If I choose "Eject" option then things are fine (I
>> think Eject does more than un-mounting the file system).
>>
>> I think "safely remove" tries to cut the power supply to the device
>> but eject does not do that. Is that correct?
>
> No, neither option cuts power.  The main difference is that "safely
> remove" disables the USB connection, so that if the device has an "okay
> to unplug now" light, the light will turn on.
>
>> If the device cannot be
>> powered down (due to battery charging) why this option is shown? Is
>> kernel exposing such capability to the user space?
>>
>> I am not sure whether this is the correct place to ask this question.
>> If this is not the correct place please direct me to correct place.
>
> You probably should get in touch with the people who maintain the
> Nautilus program if you want to know why it does something.
>
> Alan Stern
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Fwd: Safely remove option shows with Micro SD Card connected to Linux through an Android phone
  2012-12-12  6:26     ` Robert Hancock
@ 2012-12-12 15:41       ` Alan Stern
  2012-12-13 16:48         ` prasannatsmkumar
  2012-12-13 16:50         ` prasannatsmkumar
  0 siblings, 2 replies; 11+ messages in thread
From: Alan Stern @ 2012-12-12 15:41 UTC (permalink / raw)
  To: Robert Hancock; +Cc: prasannatsmkumar, linux-kernel, linux-usb, nautilus-list

On Wed, 12 Dec 2012, Robert Hancock wrote:

> On 12/11/2012 02:37 PM, Alan Stern wrote:
> > On Tue, 11 Dec 2012, prasannatsmkumar wrote:
> >
> >> Hi All,
> >>
> >> I connected an Android phone using USB cable to my machine running
> >> Linux (Linux 3.0, 3.2, 3.5). Mounted the SD card in phone in system
> >> (phone is just a pass through I guess). When I choose "Safely Remove"
> >> option in nautilus file manager (gnome's default file manager) I got
> >> an error saying
> >>
> >> "Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
> >> USB device: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-5)
> >> SYNCHRONIZE CACHE: OK
> >> STOP UNIT: FAILED: No such file or directory"
> >
> > STOP UNIT means spin down the disk or eject the disc.  Since your phone
> > doesn't have a disk drive or an optical disc, no wonder this step
> > failed.
> 
> The reason it's likely doing a STOP UNIT on USB storage devices is that 
> this is preferable for at least USB-connected HDs (at least where the 
> USB to SATA, etc. converter bothers to implement the translation). For 
> many drives, it's better for the disk's lifespan to power it down 
> normally (as it would be if it was in a machine that was being shut 
> down) so it can unload its heads in a controlled fashion, rather than 
> just cutting the power on the running disk and causing an emergency head 
> retract.
> 
> Some types of devices may not support that command or may not do 
> anything useful with it, but "No such file or directory" seems a strange 
> error to run into.

That's the error code returned by the USB stack when a request is 
cancelled synchronously.  But it is intended for internal kernel use 
only; it should not appear at the userspace level.  Without knowing the 
details of what the program did, it's hard to tell how that code got 
there.

Alan Stern


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Fwd: Safely remove option shows with Micro SD Card connected to Linux through an Android phone
  2012-12-11 20:37   ` Alan Stern
  2012-12-12  6:26     ` Robert Hancock
@ 2012-12-13 16:41     ` prasannatsmkumar
  2012-12-13 18:10       ` Alan Stern
  1 sibling, 1 reply; 11+ messages in thread
From: prasannatsmkumar @ 2012-12-13 16:41 UTC (permalink / raw)
  To: Alan Stern; +Cc: linux-kernel, linux-usb, nautilus-list

On Wed, Dec 12, 2012 at 2:07 AM, Alan Stern <stern@rowland.harvard.edu> wrote:
> STOP UNIT means spin down the disk or eject the disc.  Since your phone
> doesn't have a disk drive or an optical disc, no wonder this step
> failed.

Yes of course it does not have a optical disc or disk drive. But I
thought if there is no such thing nautilus should not try to spin
down. Linux kernel has nothing to do with this problem though.

>
> No, neither option cuts power.  The main difference is that "safely
> remove" disables the USB connection, so that if the device has an "okay
> to unplug now" light, the light will turn on.

I have seen lights going off in my pen drive, so naturally as an user
I assumed that nautilus request the kernel to cut down the power and
kernel did that. After choosing "Safely Remove" option my device node
(/dev/sdb or whatever) still exists?

>
> You probably should get in touch with the people who maintain the
> Nautilus program if you want to know why it does something.

Yeah sure. Nautilus people are in this list. I will communicate with them.

Thanks and Regards,
PrasannaKumar

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Fwd: Safely remove option shows with Micro SD Card connected to Linux through an Android phone
  2012-12-12 15:41       ` Alan Stern
@ 2012-12-13 16:48         ` prasannatsmkumar
  2012-12-13 16:50         ` prasannatsmkumar
  1 sibling, 0 replies; 11+ messages in thread
From: prasannatsmkumar @ 2012-12-13 16:48 UTC (permalink / raw)
  To: Alan Stern; +Cc: Robert Hancock, linux-kernel, linux-usb, nautilus-list

On Wed, Dec 12, 2012 at 9:11 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
> That's the error code returned by the USB stack when a request is
> cancelled synchronously.  But it is intended for internal kernel use
> only; it should not appear at the userspace level.  Without knowing the
> details of what the program did, it's hard to tell how that code got
> there.

I am not much aware of the nautilus code. May be people who work on
Nautilus will be able to provide this information.

Can any nautilus contributor or one who has idea of nautilus code
explain this? Having safe to remove and eject are great and fine
tuning them will be very useful for users.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Fwd: Safely remove option shows with Micro SD Card connected to Linux through an Android phone
  2012-12-12 15:41       ` Alan Stern
  2012-12-13 16:48         ` prasannatsmkumar
@ 2012-12-13 16:50         ` prasannatsmkumar
  1 sibling, 0 replies; 11+ messages in thread
From: prasannatsmkumar @ 2012-12-13 16:50 UTC (permalink / raw)
  To: Alan Stern; +Cc: Robert Hancock, linux-kernel, linux-usb, nautilus-list

On Wed, Dec 12, 2012 at 9:11 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
> That's the error code returned by the USB stack when a request is
> cancelled synchronously.  But it is intended for internal kernel use
> only; it should not appear at the userspace level.  Without knowing the
> details of what the program did, it's hard to tell how that code got
> there.

Makes sense. Seeing the reason having this is really helpful I think.
A good information :).

Forgot to copy all so sending this reply again.

Thanks,
PrasannaKumar

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Fwd: Safely remove option shows with Micro SD Card connected to Linux through an Android phone
  2012-12-13 16:41     ` prasannatsmkumar
@ 2012-12-13 18:10       ` Alan Stern
  2012-12-13 18:22         ` prasannatsmkumar
  0 siblings, 1 reply; 11+ messages in thread
From: Alan Stern @ 2012-12-13 18:10 UTC (permalink / raw)
  To: prasannatsmkumar; +Cc: linux-kernel, linux-usb, nautilus-list

On Thu, 13 Dec 2012, prasannatsmkumar wrote:

> On Wed, Dec 12, 2012 at 2:07 AM, Alan Stern <stern@rowland.harvard.edu> wrote:
> > STOP UNIT means spin down the disk or eject the disc.  Since your phone
> > doesn't have a disk drive or an optical disc, no wonder this step
> > failed.
> 
> Yes of course it does not have a optical disc or disk drive. But I
> thought if there is no such thing nautilus should not try to spin
> down. Linux kernel has nothing to do with this problem though.

Right.  Bear in mind that nautilus may not have any way of finding out
whether the device has removable media, other than requesting for the
media to be ejected.  But if it doesn't know then failure of the 
request shouldn't be reported as an error.

> > No, neither option cuts power.  The main difference is that "safely
> > remove" disables the USB connection, so that if the device has an "okay
> > to unplug now" light, the light will turn on.
> 
> I have seen lights going off in my pen drive, so naturally as an user
> I assumed that nautilus request the kernel to cut down the power and
> kernel did that. After choosing "Safely Remove" option my device node
> (/dev/sdb or whatever) still exists?

No, it is gone.  At least, I think so -- I'm not sure exactly what 
nautilus does when you select "Safely Remove".  The kernel's USB stack 
has a "remove" interface that is meant for this sort of thing; I've 
been assuming that this is what nautilus uses.

Alan Stern


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Fwd: Safely remove option shows with Micro SD Card connected to Linux through an Android phone
  2012-12-13 18:10       ` Alan Stern
@ 2012-12-13 18:22         ` prasannatsmkumar
  2012-12-13 19:19           ` Alan Stern
  0 siblings, 1 reply; 11+ messages in thread
From: prasannatsmkumar @ 2012-12-13 18:22 UTC (permalink / raw)
  To: Alan Stern; +Cc: linux-kernel, linux-usb, nautilus-list

On Thu, Dec 13, 2012 at 11:40 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
> On Thu, 13 Dec 2012, prasannatsmkumar wrote:
>
>> On Wed, Dec 12, 2012 at 2:07 AM, Alan Stern <stern@rowland.harvard.edu> wrote:
>> > STOP UNIT means spin down the disk or eject the disc.  Since your phone
>> > doesn't have a disk drive or an optical disc, no wonder this step
>> > failed.
>>
>> Yes of course it does not have a optical disc or disk drive. But I
>> thought if there is no such thing nautilus should not try to spin
>> down. Linux kernel has nothing to do with this problem though.
>
> Right.  Bear in mind that nautilus may not have any way of finding out
> whether the device has removable media, other than requesting for the
> media to be ejected.  But if it doesn't know then failure of the
> request shouldn't be reported as an error.

Is kernel not exposing this information? The other OS shows "Eject"
for the android device and for other pen drive I get a "safely remove"
option - stated this assuming the options in nautilus and the other OS
mean the same.

Thanks,
PrasannaKumar

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Fwd: Safely remove option shows with Micro SD Card connected to Linux through an Android phone
  2012-12-13 18:22         ` prasannatsmkumar
@ 2012-12-13 19:19           ` Alan Stern
  2012-12-14  6:18             ` prasannatsmkumar
  0 siblings, 1 reply; 11+ messages in thread
From: Alan Stern @ 2012-12-13 19:19 UTC (permalink / raw)
  To: prasannatsmkumar; +Cc: linux-kernel, linux-usb, nautilus-list

On Thu, 13 Dec 2012, prasannatsmkumar wrote:

> On Thu, Dec 13, 2012 at 11:40 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
> > On Thu, 13 Dec 2012, prasannatsmkumar wrote:
> >
> >> On Wed, Dec 12, 2012 at 2:07 AM, Alan Stern <stern@rowland.harvard.edu> wrote:
> >> > STOP UNIT means spin down the disk or eject the disc.  Since your phone
> >> > doesn't have a disk drive or an optical disc, no wonder this step
> >> > failed.
> >>
> >> Yes of course it does not have a optical disc or disk drive. But I
> >> thought if there is no such thing nautilus should not try to spin
> >> down. Linux kernel has nothing to do with this problem though.
> >
> > Right.  Bear in mind that nautilus may not have any way of finding out
> > whether the device has removable media, other than requesting for the
> > media to be ejected.  But if it doesn't know then failure of the
> > request shouldn't be reported as an error.
> 
> Is kernel not exposing this information?

What I wrote earlier was wrong, sorry.

No, the kernel does not export it.  But user programs can get the
information directly from the device in exactly the same way that the
kernel does, by issuing an INQUIRY command.

>  The other OS shows "Eject"
> for the android device and for other pen drive I get a "safely remove"
> option - stated this assuming the options in nautilus and the other OS
> mean the same.

Alan Stern


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Fwd: Safely remove option shows with Micro SD Card connected to Linux through an Android phone
  2012-12-13 19:19           ` Alan Stern
@ 2012-12-14  6:18             ` prasannatsmkumar
  0 siblings, 0 replies; 11+ messages in thread
From: prasannatsmkumar @ 2012-12-14  6:18 UTC (permalink / raw)
  To: Alan Stern; +Cc: linux-kernel, linux-usb, nautilus-list

On Fri, Dec 14, 2012 at 12:49 AM, Alan Stern <stern@rowland.harvard.edu> wrote:
> On Thu, 13 Dec 2012, prasannatsmkumar wrote:
>
>> On Thu, Dec 13, 2012 at 11:40 PM, Alan Stern <stern@rowland.harvard.edu> wrote:
>> > On Thu, 13 Dec 2012, prasannatsmkumar wrote:
>> >
>> >> On Wed, Dec 12, 2012 at 2:07 AM, Alan Stern <stern@rowland.harvard.edu> wrote:
>> >> > STOP UNIT means spin down the disk or eject the disc.  Since your phone
>> >> > doesn't have a disk drive or an optical disc, no wonder this step
>> >> > failed.
>> >>
>> >> Yes of course it does not have a optical disc or disk drive. But I
>> >> thought if there is no such thing nautilus should not try to spin
>> >> down. Linux kernel has nothing to do with this problem though.
>> >
>> > Right.  Bear in mind that nautilus may not have any way of finding out
>> > whether the device has removable media, other than requesting for the
>> > media to be ejected.  But if it doesn't know then failure of the
>> > request shouldn't be reported as an error.
>>
>> Is kernel not exposing this information?
>
> What I wrote earlier was wrong, sorry.

No problem :).


> No, the kernel does not export it.  But user programs can get the
> information directly from the device in exactly the same way that the
> kernel does, by issuing an INQUIRY command.

I will try to file a bug in nautilus project. As I am not in the
nautilus mailing list my mails are not getting delivered.

>
>>  The other OS shows "Eject"
>> for the android device and for other pen drive I get a "safely remove"
>> option - stated this assuming the options in nautilus and the other OS
>> mean the same.
>
> Alan Stern
>

Thanks,
PrasannaKumar

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-12-14  6:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CANc+2y5iLuZG5wPab5Hf0-mAngpkO+72XZR3FK9kgR8-kAKZ1Q@mail.gmail.com>
2012-12-11 18:04 ` Fwd: Safely remove option shows with Micro SD Card connected to Linux through an Android phone prasannatsmkumar
2012-12-11 20:37   ` Alan Stern
2012-12-12  6:26     ` Robert Hancock
2012-12-12 15:41       ` Alan Stern
2012-12-13 16:48         ` prasannatsmkumar
2012-12-13 16:50         ` prasannatsmkumar
2012-12-13 16:41     ` prasannatsmkumar
2012-12-13 18:10       ` Alan Stern
2012-12-13 18:22         ` prasannatsmkumar
2012-12-13 19:19           ` Alan Stern
2012-12-14  6:18             ` prasannatsmkumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).