You are not logged in.

#1 2014-03-29 19:05:46

ackalker
Member
Registered: 2012-11-27
Posts: 201

External USB 2.0 hard drive reconnects on its own after power-down

I have an external USB 2.0 hard drive which I'm trying to power off (after unmounting all partitions, of course) using:

$ udisksctl power-off --block-device /dev/sdb

When I do this, the drive spins back up after a few seconds. Only when I issue the same command again does the drive stay powered off.

I'm running:

linux 3.13.7-1
udisks2 2.1.3-1

This is what I see in the journal log when I:

- Plug in the drive's USB cable
- Issue the power-off command
- After the drive spins up again, issue the command again

Mar 29 19:51:01 miki-desktop kernel: usb 1-5: new high-speed USB device number 10 using ehci-pci
Mar 29 19:51:01 miki-desktop kernel: usb-storage 1-5:1.0: USB Mass Storage device detected
Mar 29 19:51:01 miki-desktop kernel: usb-storage 1-5:1.0: Quirks match for vid 1058 pid 0704: 8000
Mar 29 19:51:01 miki-desktop kernel: scsi12 : usb-storage 1-5:1.0
Mar 29 19:51:01 miki-desktop mtp-probe[21301]: checking bus 1, device 10: "/sys/devices/pci0000:00/0000:00:04.1/usb1/1-5"
Mar 29 19:51:01 miki-desktop mtp-probe[21301]: bus: 1, device: 10 was not an MTP device
Mar 29 19:51:02 miki-desktop kernel: scsi 12:0:0:0: Direct-Access     WD       5000BMV External 1.75 PQ: 0 ANSI: 4
Mar 29 19:51:02 miki-desktop kernel: sd 12:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/465 GiB)
Mar 29 19:51:02 miki-desktop kernel: sd 12:0:0:0: [sdb] Write Protect is off
Mar 29 19:51:02 miki-desktop kernel: sd 12:0:0:0: [sdb] Mode Sense: 23 00 00 00
Mar 29 19:51:02 miki-desktop kernel: sd 12:0:0:0: [sdb] No Caching mode page found
Mar 29 19:51:02 miki-desktop kernel: sd 12:0:0:0: [sdb] Assuming drive cache: write through
Mar 29 19:51:02 miki-desktop kernel: sd 12:0:0:0: [sdb] No Caching mode page found
Mar 29 19:51:02 miki-desktop kernel: sd 12:0:0:0: [sdb] Assuming drive cache: write through
Mar 29 19:51:02 miki-desktop kernel:  sdb: sdb1 sdb2
Mar 29 19:51:02 miki-desktop kernel: sd 12:0:0:0: [sdb] No Caching mode page found
Mar 29 19:51:02 miki-desktop kernel: sd 12:0:0:0: [sdb] Assuming drive cache: write through
Mar 29 19:51:02 miki-desktop kernel: sd 12:0:0:0: [sdb] Attached SCSI disk
Mar 29 19:51:47 miki-desktop udisksd[21107]: Powering off /dev/sdb - successfully sent SCSI command START STOP UNIT
Mar 29 19:51:47 miki-desktop udisksd[21107]: Powered off /dev/sdb - successfully wrote to sysfs path /sys/devices/pci0000:00/0000:00:04.1/usb1/1-5/remove
Mar 29 19:51:47 miki-desktop kernel: usb 1-5: USB disconnect, device number 10
Mar 29 19:51:47 miki-desktop kernel: usb 2-5: new full-speed USB device number 9 using ohci-pci
Mar 29 19:51:48 miki-desktop kernel: usb 2-5: not running at top speed; connect to a high speed hub
Mar 29 19:51:48 miki-desktop kernel: usb-storage 2-5:1.0: USB Mass Storage device detected
Mar 29 19:51:48 miki-desktop kernel: usb-storage 2-5:1.0: Quirks match for vid 1058 pid 0704: 8000
Mar 29 19:51:48 miki-desktop kernel: scsi13 : usb-storage 2-5:1.0
Mar 29 19:51:48 miki-desktop mtp-probe[21555]: checking bus 2, device 9: "/sys/devices/pci0000:00/0000:00:04.0/usb2/2-5"
Mar 29 19:51:48 miki-desktop mtp-probe[21555]: bus: 2, device: 9 was not an MTP device
Mar 29 19:51:49 miki-desktop kernel: scsi 13:0:0:0: Direct-Access     WD       5000BMV External 1.75 PQ: 0 ANSI: 4
Mar 29 19:51:49 miki-desktop kernel: sd 13:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/465 GiB)
Mar 29 19:51:49 miki-desktop kernel: sd 13:0:0:0: [sdb] Write Protect is off
Mar 29 19:51:49 miki-desktop kernel: sd 13:0:0:0: [sdb] Mode Sense: 23 00 00 00
Mar 29 19:51:49 miki-desktop kernel: sd 13:0:0:0: [sdb] No Caching mode page found
Mar 29 19:51:49 miki-desktop kernel: sd 13:0:0:0: [sdb] Assuming drive cache: write through
Mar 29 19:51:49 miki-desktop kernel: sd 13:0:0:0: [sdb] No Caching mode page found
Mar 29 19:51:49 miki-desktop kernel: sd 13:0:0:0: [sdb] Assuming drive cache: write through
Mar 29 19:51:52 miki-desktop kernel:  sdb: sdb1 sdb2
Mar 29 19:51:52 miki-desktop kernel: sd 13:0:0:0: [sdb] No Caching mode page found
Mar 29 19:51:52 miki-desktop kernel: sd 13:0:0:0: [sdb] Assuming drive cache: write through
Mar 29 19:51:52 miki-desktop kernel: sd 13:0:0:0: [sdb] Attached SCSI disk
Mar 29 19:52:20 miki-desktop udisksd[21107]: Powering off /dev/sdb - successfully sent SCSI command START STOP UNIT
Mar 29 19:52:20 miki-desktop udisksd[21107]: Powered off /dev/sdb - successfully wrote to sysfs path /sys/devices/pci0000:00/0000:00:04.0/usb2/2-5/remove
Mar 29 19:52:20 miki-desktop kernel: usb 2-5: USB disconnect, device number 9

What is interesting is that on first connect, the drive is using ehci-pci driver, then after the first try powering it off, the drive appears to reconnect using the ohci-pci driver. Not just that, it appears to 'jump' from one USB bus to another. How is this even possible?

$ lspci
00:00.0 Host bridge: NVIDIA Corporation MCP73 Host Bridge (rev a2)
00:00.1 RAM memory: NVIDIA Corporation nForce 630i memory controller (rev a2)
00:01.0 RAM memory: NVIDIA Corporation nForce 630i memory controller (rev a1)
00:01.1 RAM memory: NVIDIA Corporation nForce 630i memory controller (rev a1)
00:01.2 RAM memory: NVIDIA Corporation nForce 630i memory controller (rev a1)
00:01.3 RAM memory: NVIDIA Corporation nForce 630i memory controller (rev a1)
00:01.4 RAM memory: NVIDIA Corporation nForce 630i memory controller (rev a1)
00:01.5 RAM memory: NVIDIA Corporation nForce 630i memory controller (rev a1)
00:01.6 RAM memory: NVIDIA Corporation nForce 630i memory controller (rev a1)
00:02.0 RAM memory: NVIDIA Corporation nForce 630i memory controller (rev a1)
00:03.0 ISA bridge: NVIDIA Corporation MCP73 LPC Bridge (rev a2)
00:03.1 SMBus: NVIDIA Corporation MCP73 SMBus (rev a1)
00:03.2 RAM memory: NVIDIA Corporation MCP73 Memory Controller (rev a1)
00:03.3 Co-processor: NVIDIA Corporation MCP73 Co-processor (rev a2)
00:03.4 RAM memory: NVIDIA Corporation MCP73 Memory Controller (rev a1)
00:04.0 USB controller: NVIDIA Corporation GeForce 7100/nForce 630i USB (rev a1)
00:04.1 USB controller: NVIDIA Corporation MCP73 [nForce 630i] USB 2.0 Controller (EHCI) (rev a1)
00:0a.0 PCI bridge: NVIDIA Corporation MCP73 PCI Express bridge (rev a1)
00:0b.0 PCI bridge: NVIDIA Corporation MCP73 PCI Express bridge (rev a1)
00:0c.0 PCI bridge: NVIDIA Corporation MCP73 PCI Express bridge (rev a1)
00:0d.0 PCI bridge: NVIDIA Corporation MCP73 PCI Express bridge (rev a1)
00:0e.0 IDE interface: NVIDIA Corporation MCP73 IDE (rev a2)
00:0f.0 Ethernet controller: NVIDIA Corporation MCP73 Ethernet (rev a2)
01:06.0 Multimedia audio controller: C-Media Electronics Inc CMI8738/CMI8768 PCI Audio (rev 10)
02:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV710 [Radeon HD 4550]
02:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] RV710/730 HDMI Audio [Radeon HD 4000 series]
$ lsusb
Bus 001 Device 009: ID 1058:0704 Western Digital Technologies, Inc. Passport External HDD
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 007: ID 15ca:0101 Textech International Ltd. MIDI Interface cable
Bus 002 Device 003: ID 04d9:1603 Holtek Semiconductor, Inc. Keyboard
Bus 002 Device 002: ID 046d:c001 Logitech, Inc. N48/M-BB48 [FirstMouse Plus]
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Before the first power-off attempt:

$ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci-pci/10p, 12M
    |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
    |__ Port 2: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
    |__ Port 2: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
    |__ Port 4: Dev 7, If 0, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 4: Dev 7, If 1, Class=Audio, Driver=snd-usb-audio, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/10p, 480M
    |__ Port 5: Dev 9, If 0, Class=Mass Storage, Driver=usb-storage, 480M

After the first power-off attempt:

$ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ohci-pci/10p, 12M
    |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
    |__ Port 2: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
    |__ Port 2: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
    |__ Port 4: Dev 7, If 0, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 4: Dev 7, If 1, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 5: Dev 10, If 0, Class=Mass Storage, Driver=usb-storage, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/10p, 480M

Does anyone know how to fix this problem? Is it a device quirk, a driver bug or something?

Last edited by ackalker (2014-03-29 19:21:04)

Offline

#2 2014-03-29 19:19:00

korn36
Member
Registered: 2014-01-14
Posts: 111

Re: External USB 2.0 hard drive reconnects on its own after power-down

Is there anything that may try to access te drive when you powered it off? Maybe the DE's file manager tries to access the drive?
Try booting without X, and check if when you issue the command on the console, does the drive stay off.

Offline

#3 2014-03-29 19:30:33

ackalker
Member
Registered: 2012-11-27
Posts: 201

Re: External USB 2.0 hard drive reconnects on its own after power-down

Just to be sure, I rebooted my system, shut down lightdm from another VT, made sure that really nothing is using the drive, no partitions are mounted, no services that could try to use the drive (except udisks2.service, could this one be the problem? But how am I supposed to use the udisksctl command when the service isn't running?).

Tried the same command again. same result: I needed to run it twice in a row for it to 'take'.

What I find even more fascinating: how can a USB device jump from one USB bus to another like that? I've honestly never seen anything like this before :-)

Last edited by ackalker (2014-03-29 19:35:29)

Offline

#4 2014-03-29 20:21:24

ackalker
Member
Registered: 2012-11-27
Posts: 201

Re: External USB 2.0 hard drive reconnects on its own after power-down

I've tested after temporarily removing libmtp (which was causing the mtp-probe test to run after plugging in the drive): same result, drive reconnects after first attempt to power it off.

Offline

#5 2014-03-29 20:41:39

korn36
Member
Registered: 2014-01-14
Posts: 111

Re: External USB 2.0 hard drive reconnects on its own after power-down

I wonder why does it switch from max 480mbps speed (USB 2.0) to max 12mbps (USB 1.1!) when you run the command first time.
No ideas currently...

Last edited by korn36 (2014-03-29 20:44:53)

Offline

Board footer

Powered by FluxBB