You are not logged in.

#1 2014-07-26 17:16:32

yuanjie.huang
Member
Registered: 2010-01-04
Posts: 15

Cannot safely remove usb HDD attached to USB 3.0 Port

I find it impossible to safely remove USB HDD connected to USB 3.0 port on my latop. Both my usb drives will stop spinning when ejected in Win, but they both got re-attached immediately after "safely remove" from file manager under Arch.
I've also tried to detach with udisksctl and udisks from command line, both can stop the drive, but it got powered on immediately.

Could any one shed some light on where this problem comes from? Here's my kernel log.

[  721.933113] usb 4-1: new SuperSpeed USB device number 5 using xhci_hcd
[  721.947262] usb-storage 4-1:1.0: USB Mass Storage device detected
[  721.947414] scsi11 : usb-storage 4-1:1.0
[  722.950281] scsi 11:0:0:0: Direct-Access     TOSHIBA  External USB 3.0 0    PQ: 0 ANSI: 6
[  722.950691] sd 11:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)
[  722.950964] sd 11:0:0:0: [sdb] Write Protect is off
[  722.950967] sd 11:0:0:0: [sdb] Mode Sense: 43 00 00 00
[  722.951245] sd 11:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  722.953415]  sdb: sdb1
[  722.954295] sd 11:0:0:0: [sdb] Attached SCSI disk
[  744.733559] sd 11:0:0:0: [sdb] Synchronizing SCSI cache
[  744.735731] usb 4-1: USB disconnect, device number 5
[  745.118281] usb 4-1: new SuperSpeed USB device number 6 using xhci_hcd
[  745.132463] usb-storage 4-1:1.0: USB Mass Storage device detected
[  745.132655] scsi12 : usb-storage 4-1:1.0
[  746.135605] scsi 12:0:0:0: Direct-Access     TOSHIBA  External USB 3.0 0    PQ: 0 ANSI: 6
[  746.136061] sd 12:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)
[  746.136302] sd 12:0:0:0: [sdb] Write Protect is off
[  746.136307] sd 12:0:0:0: [sdb] Mode Sense: 43 00 00 00
[  746.136567] sd 12:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  746.138741]  sdb: sdb1
[  746.139683] sd 12:0:0:0: [sdb] Attached SCSI disk
[  854.342087] sd 12:0:0:0: [sdb] Synchronizing SCSI cache
[  854.500949] usb 4-1: USB disconnect, device number 6
[  854.887979] usb 4-1: new SuperSpeed USB device number 7 using xhci_hcd
[  854.902249] usb-storage 4-1:1.0: USB Mass Storage device detected
[  854.902437] scsi13 : usb-storage 4-1:1.0
[  855.905315] scsi 13:0:0:0: Direct-Access     TOSHIBA  External USB 3.0 0    PQ: 0 ANSI: 6
[  855.905740] sd 13:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)
[  855.905997] sd 13:0:0:0: [sdb] Write Protect is off
[  855.906000] sd 13:0:0:0: [sdb] Mode Sense: 43 00 00 00
[  855.906240] sd 13:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  859.290231]  sdb: sdb1
[  859.291215] sd 13:0:0:0: [sdb] Attached SCSI disk
[  866.911179] sd 13:0:0:0: [sdb] Synchronizing SCSI cache
[  867.557740] usb 4-1: USB disconnect, device number 7
[  867.944920] usb 4-1: new SuperSpeed USB device number 8 using xhci_hcd
[  867.959046] usb-storage 4-1:1.0: USB Mass Storage device detected
[  867.959166] scsi14 : usb-storage 4-1:1.0
[  868.961970] scsi 14:0:0:0: Direct-Access     TOSHIBA  External USB 3.0 0    PQ: 0 ANSI: 6
[  868.962445] sd 14:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)
[  868.962693] sd 14:0:0:0: [sdb] Write Protect is off
[  868.962696] sd 14:0:0:0: [sdb] Mode Sense: 43 00 00 00
[  868.962934] sd 14:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

Offline

#2 2014-07-26 17:22:52

Pse
Member
Registered: 2008-03-15
Posts: 413

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

Have you tried the "eject" command and/or hdparm?

Last edited by Pse (2014-07-26 17:23:02)

Offline

#3 2014-07-26 18:48:14

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,394

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

I know this is not a solution, but as a workaround, you may call the "sync" command and wait for it to finish just before unplugging the hdd at least to be sure to not corrupt the filesystem.

Anyway, do you have the issue on a usb2 port too?


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#4 2014-07-27 08:31:27

yuanjie.huang
Member
Registered: 2010-01-04
Posts: 15

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

Pse wrote:

Have you tried the "eject" command and/or hdparm?

yes, but no luck either sad

Offline

#5 2014-07-27 09:09:53

yuanjie.huang
Member
Registered: 2010-01-04
Posts: 15

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

kokoko3k wrote:

I know this is not a solution, but as a workaround, you may call the "sync" command and wait for it to finish just before unplugging the hdd at least to be sure to not corrupt the filesystem.

Anyway, do you have the issue on a usb2 port too?

Thanks for the suggestion, I am doing this now.

I got a laptop with only 3.0 ports and desktop with both 2.0 and 3.0 ones. The USB HDDs could not be ejected on all 3.0 ports, but works fine with 2.0 port on the desktop box.
Under Windows, they can be safely stoppped by ejecting. Thus I think it might be an software issue that only bugs linux kernel on 3.0 ports.
The 3.0 ports are provided by Intel chipset natively in both machine.

Offline

#6 2014-07-27 22:24:12

Pse
Member
Registered: 2008-03-15
Posts: 413

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

How about hdparm? Check the man page, lots of commands to try.

Last edited by Pse (2014-07-27 22:25:02)

Offline

#7 2015-06-12 17:31:43

jackjackk
Member
Registered: 2010-07-21
Posts: 40

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

Same problems here, both with USB3&2 ports:
- HD re-detected immediately after safe removal, making that option useless;
- after unmounting, HD still spinning, so not exactly safe to remove.

I know life is too short to safely remove, but I also know these HDs are extremely fragile.
Any update on these issues?

Thanks

Offline

#8 2015-06-12 22:10:30

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

@jackjackk -- stop using automounting.

Offline

#9 2015-06-13 00:06:03

jackjackk
Member
Registered: 2010-07-21
Posts: 40

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

@Head_on_a_Stick -- sounds like a good idea.
Do you happen to know how to do it? After a bit of searching I just found some obsolete/not working gconftool and udev-rules solutions. In my case, automounting seems to be related to entries in journalctl like the following:

Activating via systemd: service name='org.freedesktop.UDisks2' unit='udisks2.service'

but not sure if disabling that service is safe (and equivalent to just disabling automounting), or how to do it.

Thanks

Offline

#10 2015-06-13 10:06:49

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

jackjackk wrote:

Do you happen to know how to do it?

# pacman -Rns gvfs udisks udisks2

Should do it...

For a genuine solution to your problem, why not check out our most excellent ArchWiki:
https://wiki.archlinux.org/index.php/Udisks

Offline

#11 2015-06-14 09:05:05

jackjackk
Member
Registered: 2010-07-21
Posts: 40

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

Let say I want to keep the automounting.

The 'Safely remove' / udisksctl power-off feature works fine with my previous USB3 HD (WD Elements).  Just with my new HD (Seagate Backup Plus Fast) the device gets reconnected immediately after powering off.

Apparently I'm not alone experiencing such problems (e.g. https://bugs.launchpad.net/ubuntu/+sour … g/1441104). Yet I couldn't find any solution, even on the excellent ArchWiki.

I tried to hunt for differences between my old and new HD. An hdparm -I will give me incomplete/garbled information on the new drive, which may suggest some sort of incompatibility at some level (kernel? udisks? gvfs?). Not sure how to proceed in this quest.

Offline

#12 2015-06-14 10:02:57

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,412
Website

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

Your link doesn't work.

I'm not sure what's meant with "reconnected" here. Does the drive reappear right after you've unpowered it? Or does it just power on without the device node (e.g /dev/sdb1) being created again?

If former, you can use udisksctl unmount instead of udisksctl poweroff. That way it's not "powered off", but it won't be mounted again (at least for udisks2). If latter, it's more a cosmetical issue.

Last edited by Alad (2015-06-14 10:08:55)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#13 2015-06-14 10:07:38

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

Alad wrote:

Your link doesn't work.

The OP has included the close-bracket inside the [᠎/url] tag wink

Here it is:
https://bugs.launchpad.net/ubuntu/+sour … ug/1441104

Offline

#14 2015-06-14 10:13:47

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,412
Website

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

Head_on_a_Stick wrote:
Alad wrote:

Your link doesn't work.

The OP has included the close-bracket inside the [᠎/url] tag wink

Here it is:
https://bugs.launchpad.net/ubuntu/+sour … ug/1441104

Thanks. Well then as said, he should go with udisksctl unmount so that the drive doesn't "disappear" and "reappear". Of course good luck convincing your DE/GVFS/whatever in doing so, so you'll need an external solution.

Last edited by Alad (2015-06-14 10:15:13)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#15 2015-06-14 20:14:58

jackjackk
Member
Registered: 2010-07-21
Posts: 40

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

Thanks @Alad and @Head_on_a_Stick.

For the records, you must umount the drive before the 'udisksctl power off'.
After unmounting it, it stays so, and this is when I unplug it now.  Whether this is just cosmetically different from a prior powering-off (with heads parking and what not), I am not sure, time will probably tell.

I also ingenuously wrote to Seagate, which of course does not support Linux users. I didn't know for USB storage you may have compatibility issues too.

Offline

#16 2015-08-11 21:24:25

jackjackk
Member
Registered: 2010-07-21
Posts: 40

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

In the end I disabled automounting on gnome with

gsettings set org.gnome.desktop.media-handling automount false
gsettings set org.gnome.desktop.media-handling automount-open false

The HD is still displayed in nautilus (=> it's not powered off and completely safe to remove) but this is as good as I could get.

Offline

#17 2015-08-13 20:49:55

Hydranix
Member
Registered: 2013-02-10
Posts: 55

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

Edit: Necro Thread......

Last edited by Hydranix (2015-08-13 20:57:46)

Offline

#18 2015-09-24 11:27:50

4ronie4
Member
Registered: 2015-09-24
Posts: 20

Re: Cannot safely remove usb HDD attached to USB 3.0 Port

I have de same issue with my hdd "WD My Passport" and I tried disabling automount on gnome and now it doesn't automount but the HD it's still spinning. On the other hand, "udiskctl power-off" command turns off the device for 1 or 2 seconds and then it turns on again and displays at nautilus.
Anyone knows if it will be fixed this bug?

Offline

Board footer

Powered by FluxBB