Ubuntu

secure remove of external USB-HDD produces error

Reported by Martin Thoma on 2009-10-31
554
This bug affects 133 people
Affects Status Importance Assigned to Milestone
udisks
Confirmed
Medium
nautilus (Fedora)
Unknown
Unknown
udisks (Ubuntu)
Low
Unassigned
Nominated for Lucid by ticket

Bug Description

Binary package hint: nautilus

1) Ubuntu 9.10
2) Nautilus 1:2.28.1-0ubuntu1
3) I just wanted to remove the USB-HDD by clicking on the eject-button. I expected it to take a few seconds and then the icon of the hdd should disappear
4) I got this error:
"Laufwerk konnte nicht gestoppt werden" (something like "Unable to stop drive")
Error detaching: helper exited with exit code 1: sense buffer empty
Error SYNCHRONIZE CACHE for /dev/sdc: Success sense buffer empty
Error STOP UNIT for /dev/sdc: No such file or directory

ProblemType: Bug
Architecture: i386
Date: Sat Oct 31 13:43:27 2009
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/bin/nautilus
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
NonfreeKernelModules: nvidia
Package: nautilus 1:2.28.1-0ubuntu1
ProcEnviron:
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-14.48-generic
SourcePackage: nautilus
Uname: Linux 2.6.31-14-generic i686

Martin Thoma (themoosemind) wrote :
Pedro Villavicencio (pedro) wrote :

do you get the same error if you eject the drive by the command line? please execute: sudo eject /dev/sdc and paste the output here, thanks.

Changed in nautilus (Ubuntu):
importance: Undecided → Low
assignee: nobody → Ubuntu Desktop Bugs (desktop-bugs)
status: New → Incomplete
Martin Thoma (themoosemind) wrote :

No, I didn't get it with the command line.
Now I tried to reproduce this error, but I couldn't ... perhaps it is fixed?

Pedro Villavicencio (pedro) wrote :

could be yes, let's close it and please re open if you face the issue again, thanks.

Changed in nautilus (Ubuntu):
status: Incomplete → Fix Released
manolo (mac-man2005) wrote :

I have this problem too. All the other methods to eject/unmount the devece are succesful (including sudo eject /dev/sdc).
When clicking on "Safely remove drive" from nautilus I get:

  Unable to stop 120 GB Hard Disk

  Error detaching: helper exited with exit code 1: sense buffer empty
  Error SYNCHRONIZE CACHE for /dev/sdc: Successsense buffer empty
  Error STOP UNIT for /dev/sdc: No such file or directory

Ubuntu 9.10 - Karmic Koala
kernel version 2.6.31-14-generic

Martin Thoma (themoosemind) wrote :

I could now reproduce this error, too.

I think this is a duplicate of https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/462364

Roland J. (roland-jorz) wrote :

Same here,

Unable to stop 250 GB Hard Disk
Error detaching: helper exited with exit code 1: sense buffer empty
Error SYNCHRONIZE CACHE for /dev/sdb: Success
sense buffer empty
Error STOP UNIT for /dev/sdb: No such file or directory

On terminal the answer was
roland@roland-laptop:~$ sudo eject /dev/sdc
[sudo] password for roland:
eject: unable to find or open device for: `/dev/sdc'
roland@roland-laptop:~$ sudo eject /dev/sdb
roland@roland-laptop:~$

manolo (mac-man2005) wrote :

@Pedro Villavicencio
@Martin Thoma

I suppose it's time to reopen this bug report, isn't it?

Martin Thoma (themoosemind) wrote :

@manolo: I think so, too. I changed the status to confirmed. Is this correct?

Changed in nautilus (Ubuntu):
status: Fix Released → Confirmed
Pedro Villavicencio (pedro) wrote :

Thanks folks, the error is coming from devicekit-disks reassigning for now.

affects: nautilus (Ubuntu) → devicekit-disks (Ubuntu)
Changed in devicekit-disks (Ubuntu):
assignee: Ubuntu Desktop Bugs (desktop-bugs) → nobody

When safely removing a device with the option from the context menu the following error is generated.

"Unable to stop device
Error detaching: helper exited with exit code 1: sense buffer empty
Error SYNCHRONIZE CACHE for /dev/sdc: Success sense buffer empty
Error STOP UNIT for /dev/sdc: No such file or directory"

A screenshot of the warning dialogue, taken from a downstream duplicate: http://launchpadlibrarian.net/36693130/USB_Flash_Memory_error.png
This image says:
"Unable to stop USB Flash Memory
Error detaching: helper exited with error code 1: synchronize
cache(10): Fixed format, current; Sense key: Key=9
 Additional sense: Logical unit not ready, cause not reportable
  Info fld=0x0 [0]
Error SYNCHRONIZE CACHE for /dev/sdd: Success
start stop unit: transport: Host_status=0x07 [DID_ERROR]
Driver_status=0x00 [DRIVER_OK, SUGGEST_OK]

Error STOP UNIT for /dev/sdd: No such file or directory"

This bug was reported originally by Martin Thoma at Launchpad in Ubuntu at <https://launchpad.net/bugs/466575>.

description: updated
Changed in devicekit:
status: Unknown → Confirmed
Sense Egbert Hofstede (sense) wrote :

Setting the status to Triaged since the triaging is done here.
Thanks to all participants so far!

Changed in devicekit-disks (Ubuntu):
status: Confirmed → Triaged
Oliver Joos (oliver-joos) wrote :

Same error here whenever I "Safely Remove" my Nokia N81.

If I "Unmount" and unplug it, the N81 complains about incorrect disconnection ("data may be lost").

And if I "Eject" and unplug it, then *sometimes* it works for both sides (N81 says "cable may be removed now")! Sometimes the same error is shown like after safely remove it.

Oliver Joos (oliver-joos) wrote :

I just checked Lucid 10.04 alpha 2 (released 13th January 2010):

"Safely Remove" my Nokia N81 still triggers this error.

"Unmount" and unplug the N81 still makes it complain about incorrect disconnection (which is correct, I think!)

"Eject" and unplug it now seems to work always! (as opposed to Karmic)

Oliver Joos (oliver-joos) wrote :

To clarify my previous comment: In Lucid alpha 2 Unmount and Eject do what I expect.

Nemo_bis (nemobis) wrote :

I have the same problem with an MP3 player, which has a "RockChip USBDISK User: 8,2 GB File system" and adds also a "RockChip USBDISK SD" to the "Computer" screen of Nautilus (memory can be expanded with a microSD, and this "card reader" is detected, I suppose).

If I "Safely Remove" it, it's unmounted (at least, Nautilis gives me the "Mount" option) but the device doesn't confirm the correct removal, and after some time thhis error is displayed:

«Error detaching: helper exited with exit code 1: synchronize cache(10): transport: Host_status=0x05 [DID_ABORT]
Driver_status=0x00 [DRIVER_OK, SUGGEST_OK]

Error SYNCHRONIZE CACHE for /dev/sdb: Success
start stop unit: pass through os error: No such device
Error STOP UNIT for /dev/sdb: No such device»

I press "OK" and the device confirms the correct removal.
"Eject", "Unmount" or "sudo eject" give no error, but have no effect, except that as above the device is unmounted (at least, Nautilis gives me the "Mount" option).

If I "Safely Remove" "RockChip USBDISK SD" and then "RockChip USBDISK User: 8,2 GB File system", I receive two errors:

«"Impossibile fermare l'unità" [Italian for "It's impossible to stop the drive"]
Device is not a drive»

«"Impossibile fermare l'unità"
DBus error org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.»

And then the device confirms the correct removal.

Ubuntu 9.04
kernel 2.61.31-14.48 generic
nautilus 1:2.28.1-0ubuntu3
devicekit-disks 007-2ubuntu4

Nemo_bis (nemobis) wrote :

Instead of "Device is not a drive" (in the second procedure) now I've had:

«Error detaching: helper exited with exit code 1: Cannot open /dev/sdb: No such device or address»

Nemo_bis (nemobis) wrote :

Sorry, there's another possible error instead of the last one:

«Method "DriveDetach" with signature "as" on interface "org.freedesktop.DeviceKit.Disks.Device" doesn't exist»

Ah, and removal requires ~55 s (quite long...).

Martin Pitt (pitti) on 2010-02-15
affects: devicekit-disks (Ubuntu) → udisks (Ubuntu)
affects: devicekit → udisks
Changed in udisks (Ubuntu):
status: Triaged → Confirmed
pyrgus (trash56) wrote :

Same here:

When I want to 'secure remove' my fantec MM-CR35US 500GB FAT32 media player, then I get the same error message.

See http://img109.imageshack.us/img109/1513/bildschirmfotohdd.png

---
Ubuntu 9.10 64bit
linux-image-2.6.31-19-generic (2.6.31-19.56)

Date: Sat Apr 10 16:49
DistroRelease: Ubuntu 10.04 beta
ExecutablePath: /usr/bin/nautilus
Package: nautilus 2.30.0
Uname: Linux 2.6.32-19-generic x86_64

See http://img688.imageshack.us/img688/7269/errorbx.jpg

---
Ubuntu 10.04 64bit
Linux 2.6.32-19-generic x86_64

pyrgus (trash56) wrote :

Sorry, your link is not working properly.

Hello everyone, I'm completely new to the forum and I am a bit lost, I have the same problem as discussed in trying to remove a USB drive of 320 GB using right click and I get this error

Detaching Error: helper exited with exit code 1: synchronize cache (10): transport: Host_status = 0x07 [DID_ERROR]
Driver_status = 0x08 [DRIVER_SENSE, SUGGEST_OK]

SYNCHRONIZE CACHE Error for / dev / sdc: Success
start stop unit: transport: Host_status = 0x07 [DID_ERROR]
Driver_status = 0x08 [DRIVER_SENSE, SUGGEST_OK]
Error STOP UNIT for / dev / sdc: No such file or directory

This unit had already used in Ubuntu and had no error, but now install Ubuntu on the entire hard drive and am using a SWAP partition, previously installed Ubuntu and Windows on one disc and was not using a swap partition, only the partition EXT4

I hope you can help me, thanks, greetings from Mexico

Same problem in released Ubuntu 10.04:
Using "Safely remove drive" to unmount my Nokia N900, following error is displayed:

Unable to stop drive
Error detaching: helper exited with error code 1: Detaching device /dev/sdc
USB device: /sys/devices/pci0000:00/0000:00:02.1/usb1/1-4)
SYNCHRONIZE CACHE: OK
STOP UNIT: FAILED:

Oliver Joos (oliver-joos) wrote :

With released 10.04 I get an error more like that of Gustavo (saying that SYNCHRONIZE CACHE failed). "Eject" works perfectly whereas "Safely Remove Drive" brings:

Unable to stop Nokia S60
Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
USB device: /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: FAILED: No such file or directory

newuser (16b) wrote :

Like Oliver Joos me too, with release 10.04 lts, ubuntu gets error amounting N900:

Unable to stop drive

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

Javed A Rahman (s.kaniff) wrote :

Ubuntu 10.04

Rightclick>"Safely remove drive" on 1TB external NTFS disk

Unable to stop drive

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

meow81 (whocares) wrote :

Impossibile fermare l'unità (impossible stop the unit)
Error detaching :helper exited with exit code1: Detaching device /dev/sdb
USB device : /sys/devices/pci0000:00/0000:00:02.0/usb3/3-5
SYNCHRONIZE CACHE : OK
STOP UNIT: start stop unit: transport: Host_status=0x07
[DID_ERROR]
Driver_status=0x08 [DRIVER_SENSE, SUGGEST_OK]
FAILED: No such file or directory

is a photocamera easypix dc 512

is possible to copy images and files from device to pc but is not possible to copy image from pc to device
is not possible to safety remove hardware, ubuntu 10.04 gives that error above reported.

meow81 (whocares) wrote :

me too in ubuntu 10.04

chr (chr-dbedia) wrote :

got same issue since ubuntu 8 (have been on 9 and now I'm on 10)

Error detaching: helper exited with exit code 1: Detaching device /dev/sdd
USB device: /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-2)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: FAILED: No such file or directory

USB device: Sony DSC-R1 digital camera - MMC and SD card (and I've had this issue also on some pendrives but don't have one to test it at the moment)
PC: Dell Inspiron 1720

quirks (quirks) wrote :

Having the same issue with two USB disks: SAMSUNG_SV2042H and Myson_Century__Inc._USB_Mass_Storage_Device_100.

I did some debugging and this is what I came up with:
When you right-click on a USB drive and choose "Safely remove drive", this is what happens in the background:
1. Nautilus calls udisks --umount <device file of USB drive>"
2. udisks contact a background-process named "udisks-daemon".
3. udisks-daemon inturn invokes "/usr/lib/udisks/udisks-helper-drive-detach".
4. udisks-helper-drive-detach calls some sg3-utils to synchronize the cache and stop the device ("sg_ll_sync_cache_10" at line ~184 and "sg_ll_start_stop_unit" at line ~202 in source file "job-drive-detach.c"). Both of these functions return an error message.

You can easily reproduce the error messages caused by sg3-utils by running the sg3-utils manually. In order to reproduce the first error message ("SYNCHRONIZE CACHE: FAILED: No such file or directory"), run this command:

sg_sync --verbose <device file of USB drive>
Example: sg_sync --verbose /dev/sdc

This yields the precise error message returned by the sg3 backend:

    synchronize cache(10) cdb: 35 00 00 00 00 00 00 00 00 00
synchronize cache(10): Fixed format, current; Sense key: Illegal Request
 Additional sense: Invalid field in cdb
bad field in Synchronize cache command

In order to reproduce the second error message ("STOP UNIT: FAILED: No such file or directory"), run this command:

sg_start --stop --verbose <device file of USB drive>
Example: sg_start --stop --verbose /dev/sdc

Again, this yields a more precise error message than the general "No such file or directory" as shown by the graphical front-end:

    Start stop unit command: 1b 00 00 00 00 00
start stop unit: Fixed format, current; Sense key: Illegal Request
 Additional sense: Invalid field in cdb
invalid field in cdb
START STOP UNIT command failed

In conclusion, it looks like the sg3-utils send the wrong commands to the SCSI layer or wherever these commands go (I am not that much into low level SCSI programming, my apologies). However, I don't see any adverse effects from these erroneous commands. Even though the sg3-utils functions return an error, udisk-daemon properly continues and cleanly unmounts the USB drive as far as I can tell (it invokes umount, which should sync the cache anyway). To try this out, I removed the two calls to the functions "sg_ll_sync_cache_10" and "sg_ll_start_stop_unit" from the source code of udisks "job-drive-detach.c" and recompiled the thing. Nautilus stopped whining about the failure of these two functions and the drives are unmounted perfectly. :-)

I would have attached a patch, but I do not really have a clue about what these two functions do precisely. In fact, it might have been a bad thing to remove the function calls from "job-drive-detach.c". I cannot say, if this may result in loss of data (someone with some SCSI programming knowledge please explain). Plus, I imagine that for most users it may actually be useful that these functions are called. So it would not really be a patch.

quirks (quirks) wrote :

Having done some tests with various drives, I have come to believe that it is actually safe to ignore the error messages produced by sg3-utils. I think so for the following reasons:

1. I could not find evidence that Hardy Heron (the release I used before Lucid) made use of sg3-utils to flush caches/stop devices before unmounting USB devices. And still, the filesystems were closed cleanly.
2. Even if Hardy made use of the problematic sg3-utils functions ("sg_ll_sync_cache_10" and "sg_ll_start_stop_unit"), they still would have failed, because the relevant code is identical.
3. Even though the sg3 functions fail, udisks-daemon still invokes the "umount" command, so the filesystem is not left in an inconsistent state, when the device is removed.

For these reasons, I slightly modified udisks-helper-drive-detach to simply not report back error messages to the user. It still invokes the error-producing sg3 functions, but does not pass the errors on to the user. This way, the functions are still called for devices where they can be executed successfully. And for the devices where they fail, it is not any different - only that the user does not know anything about this. Anyhow, I have come to believe that the errors are caused by a crappy implementation of the SCSI protocol by my USB disk, which is in arbitrary 3.5" disk in a cheap disk enclosure, which I bought separately. The controller of the enclosure seems to produce errors no matter what command you throw at it. :-/

I am attaching the modified version of "job-drive-detach.c", which only differs from the original version ("job-drive-detach.c.orig") by one statement (setting return value to success; line 213). For your convenience, I'm also attaching a precompiled version of "udisks-helper-drive-detach", which is responsible for passing the error to the user. If you are fed up with the error messages like me, place the file in /usr/lib/udisks and you won't be bothered anymore. Make sure to create a backup of the original file. Also you will have to place my modified version there, whenever an update overwrites it (which doesn't happen too often anyway).

Please note that this is not really a patch, as it does not fix the underlying problem. But I don't really mind, since it wasn't any different in Hardy. The only difference is that I didn't notice it back then and now I am bothered with it every time I unplug a device. If you think so, too, then you are welcome to use my modified version of "udisks-helper-drive-detach".

quirks (quirks) wrote :
quirks (quirks) wrote :
quirks (quirks) wrote :
Changed in udisks:
importance: Unknown → Medium
ticket (tickettothemoon2004) wrote :

I have a media player with an internal flash drive and a SD-insert.
Without the SD-insert, I can access the internal flash drive without any issues.
With the SD slot occupied, Ubuntu sees the two drives correctly, and I can usually eject one of them, but the second one always gives an error.

These messages have appeared at various times when trying to eject / unmount:
=======
Method "DriveDetach" with signature "as" on interface "org.freedesktop.UDisks.Device" doesn't exist

Error detaching: helper exited with exit code 1: Detaching device /dev/sde
USB device: /sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4)
SYNCHRONIZE CACHE: synchronize cache(10): transport: Host_status=0x05 [DID_ABORT]
Driver_status=0x00 [DRIVER_OK, SUGGEST_OK]

FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: start stop unit: pass through os error: No such device
FAILED: No such device

Error ejecting: eject exited with exit code 1: eject: unable to eject, last error: No such device

Method "DriveEject" with signature "as" on interface "org.freedesktop.UDisks.Device" doesn't exist
======
Lucid 10.4
Linux 2.6.32-24-generic #43-Ubuntu SMP
GNOME 2.30.2

Created an attachment (id=38891)
hwinfo dump

Same problem here Ubuntu 10.04

<code>Error detaching: helper exited with exit code 1: Detaching device /dev/sdc</code>
Kernel 2.6.32-24-generic #42-Ubuntu SMP Fri Aug 20 14:21:58 UTC 2010 x86_64 GNU/Linux
USB3 hdd Bus 002 Device 005: ID 174c:5106 ASMedia Technology Inc.
Ext4 partition on external hard drive
Automatic mount unmount appear to be ok but get this error when "safe remove" it.

Here is a hwinfo if it can help.

Created an attachment (id=38892)
Fail to stop the volume dialog window

<code>
Error detaching: helper exited with exit code 1: Detaching device /dev/sdc
USB device: /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-2)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: FAILED: No such file or directory
</code>

Léa GRIS (lea-gris) wrote :

Same problem here Ubuntu 10.04

<code>Error detaching: helper exited with exit code 1: Detaching device /dev/sdc</code>
Kernel 2.6.32-24-generic #42-Ubuntu SMP Fri Aug 20 14:21:58 UTC 2010 x86_64 GNU/Linux
USB3 hdd Bus 002 Device 005: ID 174c:5106 ASMedia Technology Inc.
Ext4 partition on external hard drive
Automatic mount unmount appear to be ok but get this error when "safe remove" it.

Here is a hwinfo dump if it can help.

Rocdufer (lepcis) wrote :

Hello. I have good quality 1 TB USB Hard Disk, that came with FAT32 file system and driver for the commercial OS. I did not care about changing this file system, and along some time it worked without error message. When removing safely, I have now this message:
«Unable to stop drive
Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
USB device: /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-2)
SYNCHRONIZE CACHE: OK
STOP UNIT: FAILED: No such file or directory»

However, I can clearly hear that the disk stops, and I also hear it start to run when I wish so; obviously, the message can be ignored.

I wonder if the disk file system is, or not, totally irrelevant for the optimum disk operation under Linux.

jedioetzi (jedioetzi) wrote :

on maverick
Method "DriveEject" with signature "as" on interface "org.freedesktop.UDisks.Device" doesn't exist
same usb key 1GB, on lucid works well

ticket (tickettothemoon2004) wrote :

I tried the fix posted above by "quirks 2010-07-25".

Alas it didn't fix the problem.

I have a media player with an internal drive and a plug-in SDHC class4 card.
The two drives show up fine when connecting the media player to the PC via USB.
The problem comes when ejecting the drives - as previously described.

I implemented quirks' fix as follows:

1. Downloaded the binary file "udisks-helper-drive-detach" from the launchpad page

2. Renamed the original file:
    cd /usr/lib/udisks
    sudo mv udisks-helper-drive-detach udisks-helper-drive-detach-orig

3. Copied the new file:
    sudo cp [path to downloaded file]/udisks-helper-drive-detach /usr/lib/udisks

4. Fixed permissions:
    sudo chmod a+x udisks-helper-drive-detach

On ejecting the drives I still get the pop up:

"Writing data to <drive>
To prevent data loss, wait until this has finished
before removing medium or disconnecting the drive"

which lasts for about 1 minute, then I get the error message popups:

"Unable to stop drive
Method "DriveDetach" with signature "as" on interface "org.freedesktop.UDisks.Device" doesn't exist"

"Unable to eject <drive>
Device is not a drive"

A reboot didn't solve the problem.
I would say that quirks' fix may have reduced the number of weird error messages appearing, but the fundamental problem of the 1 minute wait remains. Maybe my media player is doing something during this time (but this wasn't an issue at all when not using the SDHC class4 card and just the internal media player drive).

Ubuntu Release 10.04
Linux 2.6.32-25-generic
GNOME 2.30.2

ticket (tickettothemoon2004) wrote :

I have just discovered that if you use the 'Disk Utility' program (found in System -> Administration) to unmount the USB drives, then no errors are generated. After unmounting, the icons for the drives then appear as unmounted in nautilus.

You can then physically remove the USB device / media player and everything is fine, and the drive icons then disappear from nautilus.

You don't get the "Writing data to <drive>" pop up.

So the Disk Utility is doing the unmount in a different way to Nautilus?

(the above was tried with quirks's software mod installed)

ticket (tickettothemoon2004) wrote :

Problem still there after upgrade to 10.10.
Get-around using the disk utility to unmount drives still works.

Release 10.10
Kernel 2.6.35-22-generic
GNOME 2.32.0

Jahmon (jahmonspam-forum) wrote :

same bug here on 10.10 with all latest upgrades....

sudo eject /dev/sdb works fine.

Paco Avila (monkiki) wrote :

I got this error on Ubuntu 10.10 when umounting an Easy Player HD Jumbo Plus (BestBuy).

malheum (maxheise) wrote :
Download full text (3.7 KiB)

I have this error message too on Ubuntu 10.04 and 10.10, amd64. This is an external USB3.0 2,5" hard disk on an USB2.0 port (my laptop and my desktop don't have USB3.0 ports yet, but the external hdd came with one).

Error message:
Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
USB device: /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-2)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: FAILED: No such file or directory

Umounting from the command line produces no error:
$ sudo umount /media/ELSTER
$

The file system is ok:
$ sudo fsck -fv /dev/sdb1
fsck from util-linux-ng 2.17.2
e2fsck 1.41.12 (17-May-2010)
Durchgang 1: Prüfe Inodes, Blocks, und Größen
Durchgang 2: Prüfe Verzeichnis Struktur
Durchgang 3: Prüfe Verzeichnis Verknüpfungen
Durchgang 4: Überprüfe die Referenzzähler
Durchgang 5: Überprüfe Gruppe Zusammenfassung

      12 inodes used (0.00%)
       0 non-contiguous files (0.0%)
       0 non-contiguous directories (0.0%)
         # von Inodes mit ind/dind/tind Blöcken: 0/0/0
         Erweiterungstiefe Histogramm: 2
  352958 blocks used (1.81%)
       0 bad blocks
       1 large file

       0 regular files
       3 directories
       0 character device files
       0 block device files
       0 fifos
       0 links
       0 symbolic links (0 fast symbolic links)
       0 sockets
--------
       3 files

This is the usb device:
$ lsusb -v -d 174c:5106
Bus 002 Device 008: ID 174c:5106 ASMedia Technology Inc.
Device Descriptor:
  bLength 18
  bDescriptorType 1
  bcdUSB 2.10
  bDeviceClass 0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 64
  idVendor 0x174c ASMedia Technology Inc.
  idProduct 0x5106
  bcdDevice 0.01
  iManufacturer 2 ASMedia
  iProduct 3 AS2105
  iSerial 1 77AWT06ET
  bNumConfigurations 1
  Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 32
    bNumInterfaces 1
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0xc0
      Self Powered
    MaxPower 0mA
    Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 0
      bAlternateSetting 0
      bNumEndpoints 2
      bInterfaceClass 8 Mass Storage
      bInterfaceSubClass 6 SCSI
      bInterfaceProtocol 80 Bulk (Zip)
      iInterface 0
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x81 EP 1 IN
        bmAttributes 2
          Transfer Type Bulk
          Synch Type None
          Usage Type Data
        wMaxPacketSize 0x0200 1x 512 bytes
        bInterval 0
      Endpoint Descriptor:
        bLength 7
        bDescriptorType 5
        bEndpointAddress 0x02 EP 2 OUT
        bmAttribute...

Read more...

malheum (maxheise) wrote :
PMax (piero-masullo) wrote :

same bug here on 10.04 with all latest upgrades when i disconnect an external USB 2.0 2,5" hard disk 80 GB.

sudo eject /dev/sdb instead works fine.

Pedro Bessa (deltrem1984) wrote :

I have this problem too.

Changed in udisks:
importance: Medium → Unknown
Luca Borrione (luca.borrione) wrote :

Hello, just to advice you, while waiting for this bug to be correctly fixed, I successfully used the "USB Safe Removal application indicator" on my ubuntu maverick to safely eject an usb drive I have which causes this error (I own others which do not cause this error, so it depends on the device type).

you can download it at
http://dl.dropbox.com/u/7138409/indicator-usb/indicator.html

here a brief howto
http://netgator.blogspot.com/2010/10/safely-remove-usb-device-on-ubuntu.html

hope it can help users and doesn't make developers lazies! :)

Cheers :)

#####################################

ubuntu maverick Linux 2.6.35-25-generic

my usb drive is a MAXTOR S TM3250820A

Disco /dev/sdc: 250.1 GB, 250059350016 byte
255 testine, 63 settori/tracce, 30401 cilindri
Unità = cilindri di 16065 * 512 = 8225280 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Identificativo disco: 0x000a3410

Ivan Frederiks (idfred) wrote :

Same problem:

Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
USB device: /sys/devices/pci0000:00/0000:00:1a.7/usb1/1-4/1-4.4)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: FAILED: No such file or directory

I'm trying to "safely remove" a Nokia C5 from Ubuntu 10.10 x86 system.

Muharem Hrnjadovic (al-maisan) wrote :

Same here Ubuntu 10.10 and a LaCie 1TB external USB hard drive. I am using it with cryptsetup (encrypted backup partition) FWIW.

agnul (sucrabu) wrote :

Same here, Amazon 3rd-gen kindle, running ubuntu 10.10

CedricMC (cedricmc) wrote :

[Unable to stop unit]
Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
USB device: /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: FAILED: No such file or directory

Drive: LaCie Starck 500GB (EXT4)
System: Ubuntu 10.10 64 2.6.35-28-generic

Changed in udisks:
importance: Unknown → Medium
Andy (pwndy) wrote :

Error still in Ubuntu 11.04 x64 beta (USB 3.0 external drive):

Unable to stop 1.0 TB Hard Disk

Error detaching: helper exited with exit code 1: Detaching device /dev/sdc
USB device: /sys/devices/pci0000:00/0000:00:07.0/0000:02:00.0/usb8/8-1)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: start stop unit: transport: Host_status=0x07 [DID_ERROR]
Driver_status=0x08 [DRIVER_SENSE, SUGGEST_OK]

FAILED: No such file or directory

ginalfa (ginalfa) wrote :

Still persists on 11.04

USB device: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-6)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: FAILED: No such file or directory

when I attempt to safely remove a SAMSUNG USB3 external HDD

promet (prometx) wrote :

While attempting ticket's workaround (comment #42) using the "Disk Utility" application, I still experience the following error in 11.04:

"Error detaching: helper exited with exit code 1: Detaching device /dev/sdc
USB device: /sys/devices/pci0000:00/0000:00:05.0/0000:02:00.0/usb7/7-2)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: FAILED: No such file or directory"

X181 (olag-2) wrote :

with 11.04 - the Natty Narwhal nad transcend filesystem type: msdos

Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
USB device: /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-2)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: FAILED: No such file or directory

In Ubuntu 11.04 this bug still persists. The involved external drive is a Samsung S2 (1 TB, USB 3.0). I don't understand why is not working - I have two other external drives which are working perfectly. When I try to "Safely Remove Drive" the Samsung external hdd an error message (see the attached picture) is thrown:
Unable to stop drive:

Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
USB device: /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: FAILED: No such file or directory

jack (jumpinjack) wrote :

Here Ubuntu Natty, same problem with LaCie Rikiki 1T usb 3.0

Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
USB device: /sys/devices/pci0000:00/0000:00:1c.7/0000:45:00.0/usb3/3-2)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: FAILED: No such file or directory

Seb (sebbes77) wrote :

Same on Natty, with two different Android devices (Nexus One and Nexus S)

Error detaching: helper exited with exit code 1: Detaching device /dev/sdi
USB device: /sys/devices/pci0000:00/0000:00:02.1/usb1/1-7/1-7.1/1-7.1.3)
SYNCHRONIZE CACHE: OK
STOP UNIT: FAILED: No such file or directory

girisha (girishad) wrote :

I get the same warning msg when I try to safely remove my nexus S from Ubuntu. This is happening in 11.04 32 bit as well as in the 64 bit.

Anil Gobburi (anil-gobburi) wrote :

I get the same issue too when I am unmounting Kingston 16 GB Pendrive as well as Nokia 5800 XM(as mass storage Device)

Fabrice Moncade (fafanuclear) wrote :

I've got the same, but with a Western digital 1TB.

Mihai Capotă (mihaic) wrote :

Same bug with an Adata CH11 1 TB USB 3.0 hard disk connected to a USB 2.0 port:

$ udisks --detach /dev/sdb
Detach failed: Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
USB device: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-4)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: FAILED: No such file or directory

$ sudo sg_start --stop --verbose /dev/sdb
    Start stop unit command: 1b 00 00 00 00 00
start stop unit: Fixed format, current; Sense key: Illegal Request
 Additional sense: Invalid command operation code
command not supported
START STOP UNIT command failed

Does anybody know a workaround that would make the hard disk spin down so it can be safely disconnected?

Mihai Capotă (mihaic) wrote :

Answering my own question, hdparm will make the hard disk spin down, even though it reports an error:

$ sudo hdparm -Y /dev/sdb

/dev/sdb:
 issuing sleep command
 HDIO_DRIVE_CMD(sleep) failed: Invalid argument

E. Lewis (ed-lewis) wrote :

I get the same problem when removing a USB drive from /dev/sdb. The drive is a 250 GB hard disc formatted with the ext4 file system.
After getting this message, I just unplug it. I first unplug the USB cable and then hit the 'off switch' on the drive.
Other than the annoying dialogue, the error does not seem to give any problem.

Constantine (theaspect) wrote :

Same for 11.04

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

root@iEEEpc:/etc/default# uname -a
Linux iEEEpc 2.6.38-12-generic #51-Ubuntu SMP Wed Sep 28 14:25:20 UTC 2011 i686 i686 i386 GNU/Linux
root@iEEEpc:/etc/default# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.04
Release: 11.04
Codename: natty

Matt Stan (jmstanfield) wrote :

I have the same problem using a standard (no-keyboard) Kindle (Autumn 2011 Kindle version) on 10.04 LTS, Lucid Lynx.

Unable to stop Kindle Internal Storage
Error detaching: helper exited with exit code 1: Detaching device /dev/sdd
USB device: /sys/devices/pci0000:00/0000:00:1d.1/usb7/7-2)
SYNCHRONIZE CACHE: OK
STOP UNIT: FAILED: No such file or directory

Prakash J Kokkatt (pjkonweb) wrote :

I face the error with kindle touch 4th generation ebook reader.
Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
USB device: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-1)
SYNCHRONIZE CACHE: OK
STOP UNIT: FAILED: No such file or directory

white_gecko (natanaela) wrote :

I just got the same Error when I attached my new external HDD case. Strange is, I didn't get this error with the same HDD in my old case. The new case is a "fantec DB-ALU3" and it has USB 3.0. The old case was a "Conrad Electronic" Model No.: "CEX-HDD/U35s" with USB 2. The HDD is a WD 1TB with serial-ATA.

The exact error message is:

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

Marc López (marc10lopez) wrote :

The same error when I use the "remove safely drive" in Ubuntu 11.10 with a Kingston DataTraveler G2 (16 Gb) and with a Iomega external HDD (500 Gb). I only have the error with Nautilius, in Unity and LXDE it doesn't appear. I think that the first time that I saw this error was in version 8.10 or 9.04 with ext4, in 8.04 I can confirm that never has appeared me.

The error message is:

Unable to stop drive

    Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
    USB device: /sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2)
    SYNCHRONIZE CACHE: synchronize cache(10): Fixed format, current; Sense key: Key=9
     Additional sense: Logical unit not ready, cause not reportable
      Info fld=0x0 [0]
    FAILED: No such file or directory
    (Continuing despite SYNCHRONIZE CACHE failure.)
    STOP UNIT: start stop unit: transport: Host_status=0x07 [DID_ERROR]
    Driver_status=0x00 [DRIVER_OK, SUGGEST_OK]

    FAILED: No such file or directory

Przemysław Kulczycki (azrael) wrote :

I have the same error with external USB 3.0 disk. It happens both on Ubuntu 11.10 and 12.04, and both when using USB 3.0 and USB 2.0 ports.
Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
USB device: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-1)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: FAILED: No such file or directory

Przemysław Kulczycki (azrael) wrote :

root@laptop616:/home# eject /dev/sdb
eject: unable to eject, last error: Invalid argument

Przemysław Kulczycki (azrael) wrote :

My other USB 2.0 drive works fine.

Przemysław Kulczycki (azrael) wrote :

My USB 3.0 disk only unmounts partitions, it doesn't power off.

Pink Ink (pink-ink) wrote :

I get this error in Nautilus:
"Unable to stop 2 TB Hard Disk
Error detaching: helper exited with exit code 1: Detaching device /dev/sdc
USB device: /sys/devices/pci0000:00/0000:00:1c.2/0000:02:00.0/usb3/3-3)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: FAILED: No such file or directory"

The error only occurs, when I select "Safely Remove Drive" from the context menu. (In Nautilus I have selected the pane "Places" on the left side of the window. There the drive is shown. There the context menu was opened). After the error occured, the drive is removed (the eject button vanished).

The error DOES NOT OCCUR if I click on the eject symbol on the right of the device name. This works fine.

Software:
  Ubuntu 11.04 with latest updates,
  Nautilus 2.32.2.1
Hardware:
  2 TB HDD SAMSUNG HD203WI
  External USB 3.0 HDD Case by "Sinan Power".

One info from "hdparm -I /dev/sdc":
Configuration:
 cache/buffer size = unknown

Conclusions:
1.) The cache is said to be "unknown" by hddparm and nautilus' error message said "SYNCHRONIZE CACHE: FAILED: No such file or directory". Is there a correlation? Maybe the hdd-cache is not used, therefore there's no file, but Nautilus expects one?

2.) What does Nautilus do different when using the eject button (which works) in contrary to using the context menu entry "Safely Remove Drive" (which does not work)?

3.) Has it something to do with USB 3.0 maybe?

Pink Ink (pink-ink) wrote :

Addition to previous comment:
- using the context menu entry "Safely Remove Drive" fails from both Nautilus AND Desktop, but works from Unity Sidebar.
- command line: executing "eject /dev/sdc" as root works fine.

DeeKey (privateinf) wrote :

Unable to safely remove USB3 hardrive using Nautilus, but able to do it using Unity sidebar.

Here is my error message:

Error detaching: helper exited with exit code 1: Detaching device /dev/sdc
USB device: /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: FAILED: No such file or directory

Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu laptop testing tracker.

A list of all reports related to this bug can be found here:
http://laptop.qa.ubuntu.com/qatracker/reports/bugs/466575

tags: added: laptop-testing

The same problem on Ubuntu Precise:

sudo udisks --detach /dev/sdc
Detach failed: Error detaching: helper exited with exit code 1: Detaching device /dev/sdc
USB device: /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7)
SYNCHRONIZE CACHE: FAILED: No such file or directory
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: FAILED: No such file or directory

This error message matches exactly the the error message from Nautilus.

Apparently, Unity fails to safely remove the drive too.
Though it does not report a problem, it does not power down the device, and it is still available in Nautilus for mounting.
Truly removed devices disappear from the list of mountable devices until they are unplugged and plugged again.

On my computer USB thumb drives usually do not produce this error.
But USB HDD always produce this error.

My guess is that HDD contain more than one entry in the partition table, while thumb drives usually have only one, and this somehow matters.

I've filed this bug against udisks in bugzilla at freedesktop.org.
The resolution is distressing: the bug will not be fixed upstream.

Resolution --- WONTFIX

Comment # 1 on bug 55742 from David Zeuthen

udisks 1.x is in maintenance mode and only security critical bugs will get any
attention. Since there is no similar concept in the UDisks 2.x I'm closing this
bug WONTFIX.

Alex Cabal (acabal) wrote :

How old is udisks 2.x? Is the chance of it being included in Debian/Ubuntu along the lines of within 2 cycles, or more like 2+ years?

Kind of annoying because I have to use hdparms to spin down my external hdd's before disconnecting now. It's still not a good workaround because they never truly power down that way.

Oliver Joos (oliver-joos) wrote :

@aoandr: sad to hear that it is set to WONTFIX upstream. But IMHO this does not force it to WONTFIX for Ubuntu! A brave Ubuntero could fix it, and perhaps the patch will then swim upstream. So please let this bug be CONFIRMED.

Martin Pitt (pitti) wrote :

Not relevant for Ubuntu 12.10 any more, we moved to udisks2.

Changed in udisks (Ubuntu):
status: Confirmed → Invalid
Jane Atkinson (irihapeti) wrote :

What's going to happen to 12.04 (5 year support, after all)? Will there be a backport made available?

Jane Atkinson [2012-10-10 5:03 -0000]:
> What's going to happen to 12.04 (5 year support, after all)? Will there
> be a backport made available?

udisks2 itself could certainly be backported in theory, but it would
require backporting everything that actually _uses_ it as well; that's
half of the desktop infrastructure, and thus not going to happen.

This bug is not a deal-breaker, so I'm afraid it will just stay as it
is in stable releases.

Dave Gilbert (ubuntu-treblig) wrote :

Martin: I didn't think all of the ubuntu varients had moved onto Udisks2, only the main one.
On Quantal udisks still shows as a member of tasks:
ubuntu-desktop, ubuntu-usb, kubuntu-desktop, kubuntu-active-desktop, kubuntu-active, edubuntu-desktop, edubuntu-desktop-kde, edubuntu-usb, ubuntustudio-desktop

but udisks2 is a member of:
ubuntu-desktop, ubuntu-usb, kubuntu-dvd-live, kubuntu-active-dvd-live, edubuntu-desktop, edubuntu-desktop-kde, edubuntu-usb, xubuntu-desktop, mythbuntu-frontend, mythbuntu-desktop, mythbuntu-backend-slave, mythbuntu-backend-master, mythbuntu-backend-master, lubuntu-desktop, ubuntustudio-desktop

That's an odd non-overlapping in either direction set, with only the kubuntu dvd-live sets in the udisks2 camp.

Dave

Oliver K (ok23) wrote :

For some reason this seems to be hardware-dependant. I have so far "collected" four USB SATA docking stations or adapters. I do not see this bug on USB 2 at all (ICH 10). On USB 3 (Renesas/NEC) I see it on one of two docking stations. On that one, I see it every time, and on the other never at all. Also, I never saw this when disconnecting a stick, a memory card or a phone.

Just with one docking station (Icy Box IB 111 with integrated hub). It's not the hub either, second USB 3 dock works perfectly through the hub of the one producing the error. Also, the dock producing the error is hotplug capable, according to Icy Box.

Strange, but the hardware dependancy is obvious.

Also, I noticed when I correctly disconnect a drive on USB 3, kern.log says
Oct 20 01:39:08 FSC kernel: [12509.993534] usb 10-1.4: reset SuperSpeed USB device number 19 using xhci_hcd
Oct 20 01:39:08 FSC kernel: [12510.011574] xhci_hcd 0000:02:00.0: xHCI xhci_drop_endpoint called with disabled ep ffff88003eec3b80
Oct 20 01:39:08 FSC kernel: [12510.011578] xhci_hcd 0000:02:00.0: xHCI xhci_drop_endpoint called with disabled ep ffff88003eec3bc0
Oct 20 01:39:08 FSC kernel: [12510.028700] usb 10-1.4: USB disconnect, device number 19
Oct 20 01:40:42 FSC kernel: [12604.084118] usb 10-1: USB disconnect, device number 17
Oct 20 01:40:42 FSC kernel: [12604.084122] usb 10-1.1: USB disconnect, device number 18

When I disconnect with the error, nothing gets written to kern.log at all.

Oliver K (ok23) wrote :

Oh, forgot to add info: I run Lucid, and have the 3.0.26 kernel (oneiric-generic) (otherwise I get loads of stale endpoint errors on USB 3...).

gbachot (geert-bachot) wrote :

Same here, when I "safely remove" the external USB drive, Maxtor, 500GB.
It does unmount as it should, though.
Ubuntu 12.04.4, gnome-shell.

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

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.