USB disks with spindown linux kernel problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I do have problems with external USB disks, that pretty much lead
to them being useless because linux does not recognize them during
booting or usb_storage module loading. The only way to recognize
them is to plug them into the running system. 

Drives are Western Digital Elements, 2TB.  Kernel is 2.6.29 or 2.6.31

not fully regocnized by linux (tried 2.6.29/2.6.31) when i boot.
I usually have usb in the kernel, but to test explicitly, i put
it into a module and did "modprobe -r usb_storage; modprobe usb_storage".
I get:

| 11:50:06 usbcore: deregistering interface driver usb-storage
| 11:51:13 Initializing USB Mass Storage driver...
| 11:51:13 scsi20 : SCSI emulation for USB Mass Storage devices
| 11:51:13 usb-storage: device found at 2
| 11:51:13 usb-storage: waiting for device to settle before scanning
| 11:51:13 scsi21 : SCSI emulation for USB Mass Storage devices
| 11:51:13 usbcore: registered new interface driver usb-storage
| 11:51:13 USB Mass Storage support registered.
| 11:51:13 usb-storage: device found at 4
| 11:51:13 usb-storage: waiting for device to settle before scanning
| 11:51:18 usb-storage: device scan complete
| 11:51:18 usb-storage: device scan complete
| 11:51:19 scsi 21:0:0:0: Direct-Access     WD       Ext HDD 1021     2002 PQ: 0 ANSI: 4
| 11:51:19 scsi 20:0:0:0: Direct-Access     WD       Ext HDD 1021     2002 PQ: 0 ANSI: 4
| 11:51:19 sd 20:0:0:0: Attached scsi generic sg3 type 0
| 11:51:19 sd 21:0:0:0: Attached scsi generic sg4 type 0

The disks where in standby when i was doing this test. I then have
/dev/sg devices, but no /dev/sd devices for them. The disks where
also not spun up by this (which can be seen because there is a white
LED which in standby blinks slowly, and it would blink fast when it
would start te disk, and steady when the disk runs).

When i try to access the /dev/sg devices created, then linux tries to
spun up the disks. Without success. The lights on the disks never get out
of slow/idle blinking.  Linux nevertheless creates /dev/sdX, but no
partitions, and the /dev/sdX devices can not be read from.

| 11:51:55 sd 20:0:0:0: [sdd] Spinning up disk...
| 11:54:01 sd 21:0:0:0: [sde] Spinning up disk..........not responding...
| 11:54:01 .not responding...
| 11:54:37 sd 20:0:0:0: [sdd] READ CAPACITY failed
| 11:54:37 sd 20:0:0:0: [sdd] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
| 11:54:37 sd 20:0:0:0: [sdd] Sense Key : Not Ready [current]
| 11:54:37 sd 20:0:0:0: [sdd] Add. Sense: Logical unit is in process of becoming ready
| 11:54:37 sd 21:0:0:0: [sde] READ CAPACITY failed
| 11:54:37 sd 21:0:0:0: [sde] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
| 11:54:37 sd 21:0:0:0: [sde] Sense Key : Not Ready [current]
| 11:54:37 sd 21:0:0:0: [sde] Add. Sense: Logical unit is in process of becoming ready
| 11:54:49 sd 20:0:0:0: [sdd] Test WP failed, assume Write Enabled
| 11:54:49 sd 20:0:0:0: [sdd] Assuming drive cache: write through
| 11:54:49 sd 21:0:0:0: [sde] Test WP failed, assume Write Enabled
| 11:54:49 sd 21:0:0:0: [sde] Assuming drive cache: write through
| 11:55:26 sd 20:0:0:0: [sdd] Spinning up disk...
| 11:57:31 sd 21:0:0:0: [sde] Spinning up disk..........not responding...
| 11:57:31 .not responding...
| 11:58:08 sd 20:0:0:0: [sdd] READ CAPACITY failed
| 11:58:08 sd 20:0:0:0: [sdd] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
| 11:58:08 sd 20:0:0:0: [sdd] Sense Key : Not Ready [current]
| 11:58:08 sd 20:0:0:0: [sdd] Add. Sense: Logical unit is in process of becoming ready
| 11:58:08 sd 21:0:0:0: [sde] READ CAPACITY failed
| 11:58:08 sd 21:0:0:0: [sde] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
| 11:58:08 sd 21:0:0:0: [sde] Sense Key : Not Ready [current]
| 11:58:08 sd 21:0:0:0: [sde] Add. Sense: Logical unit is in process of becoming ready
| 11:58:20 sd 20:0:0:0: [sdd] Test WP failed, assume Write Enabled
| 11:58:20 sd 20:0:0:0: [sdd] Assuming drive cache: write through
| 11:58:20 sd 20:0:0:0: [sdd] Attached SCSI disk
| 11:58:20 sd 21:0:0:0: [sde] Test WP failed, assume Write Enabled
| 11:58:20 sd 21:0:0:0: [sde] Assuming drive cache: write through
| 11:58:20 sd 21:0:0:0: [sde] Attached SCSI disk

Manually trying to spin them up does not work either:

 # sdparm --command=start /dev/sg4
     /dev/sg4: WD        Ext HDD 1021      2002

But the disks slow idle/standby blinking does not change. Same when
using the /dev/sdX device.

When i power-cycle the disk, it will start up (steady light) and
linux will correctly recognize it. Looks as follows for one disk:

| 12:13:08 usb 5-2: USB disconnect, address 2
| 12:13:32 usb 5-2: new high speed USB device using ehci_hcd and address 9
| 12:13:33 usb 5-2: New USB device found, idVendor=1058, idProduct=1021
| 12:13:33 usb 5-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
| 12:13:33 usb 5-2: Product: Ext HDD 1021
| 12:13:33 usb 5-2: Manufacturer: Western Digital
| 12:13:33 usb 5-2: SerialNumber: 574341565932353937303239
| 12:13:33 usb 5-2: configuration #1 chosen from 1 choice
| 12:13:33 scsi22 : SCSI emulation for USB Mass Storage devices
| 12:13:33 usb-storage: device found at 9
| 12:13:33 usb-storage: waiting for device to settle before scanning 
| 12:13:38 usb-storage: device scan complete
| 12:13:38 scsi 22:0:0:0: Direct-Access     WD       Ext HDD 1021     2002 PQ: 0 ANSI: 4
| 12:13:38 sd 22:0:0:0: Attached scsi generic sg3 type 0 
| 12:13:38 sd 22:0:0:0: [sdd] 3907024896 512-byte logical blocks: (2.00 TB/1.81 TiB)
| 12:13:38 sd 22:0:0:0: [sdd] Test WP failed, assume Write Enabled
| 12:13:38 sd 22:0:0:0: [sdd] Assuming drive cache: write through
| 12:13:38 sd 22:0:0:0: [sdd] Test WP failed, assume Write Enabled
| 12:13:38 sd 22:0:0:0: [sdd] Assuming drive cache: write through
| 12:13:38 sdd: sdd1
| 12:13:38 sd 22:0:0:0: [sdd] Test WP failed, assume Write Enabled
| 12:13:38 sd 22:0:0:0: [sdd] Assuming drive cache: write through
| 12:13:38 sd 22:0:0:0: [sdd] Attached SCSI disk

When the device is powered up thusly, it will also reply correctly
to smartctl (smartctl -d sat). When it is in it's idle state, it
does also not work:

| # smartctl -d sat -a /dev/sde
| smartctl 5.40 2010-02-10 r3065 [i686-pc-linux-gnu] (local build)
| Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net
| 
| Smartctl: Device Read Identity Failed (not an ATA/ATAPI device)
| 
| A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

After the drive was once running and linux created even the /dev/sdXi 
partition entries, the drive can be restarted from linux by just
accessing the /dev file read/write - or of course when it is mounted,
the disk will also spin up again.

So i wonder: If linux can wake up the drive after the divice nodes
are there what the heck is it missing before it has created device
nodes.

I can also start the drive from power save with "sdparm --command=start"
on both the /dev/sg<i> and /dev/sdX devices when the device was
plugged in during linux runs, but when the device nodes where only
created upon bootstrap or modload of usb_storage, then the sdparm start
command is a total NOP.

Somehow i think that there is something wrong in Linux initialization

Any ideas / comments / suggestions ?

Thanks a lot
    Teorless

Notes:
I have enclosures working fine that do not automatically go into
standby. I use hd-idle to spin down the hard disks. No problems.
Except the other enclosures where a) cheaper, and b) i thought for
archive storage it's great to have an enclosure that switches off 
power to the hard disk so the electronics does not age at all, and
it might also be better protected from any power level issue (spikes, etc)
And i just replaced the new enclosures onto the cables and USB ports
where these working enclosures where used, so no controller/cable problem.
And i ran enclosures with/without external USB bus, so no USB bus
problem.

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux