sg_start command does not spin-up or spin-down external USB drive.
Environment
- Red Hat Enterprise Linux 5
- sg3_utils-1.25-4
Issue
- with
sg_start, spin down or spin up of an external USB disk drive does not work.
# sg_start --stop /dev/sdc
Resolution
Either of the following could apply, see diagnostics section for determining which applies in the current case.
- the usb bridge chip between the usb bus and the disk doesn't fully support the start operation, or
- possibly Bug 553039 - sg_start --stop does not spin down external USB drive
NOTE: sg_start will not power down an external usb disk enclosure, it only spins down the disk. If the disk enclosure has a power light, it will remain lit.
Root Cause
If the usb bridge chip doesn't fully support the start operation, then root cause is hardware.
If the start isn't working because of the BZ, then a test sg_start can be created to verify. See comment #7 in the above BZ, it has a real simple fix for testing purposes.
Diagnostic Steps
A simple test can be performed to see if the stop/start sequence is working.
For example, the following are two usb disk enclosures both with the same WDC model disk inside. Running a simple test scripts though ends in two different results.
Disk USB -------------------------- ----------------------------------------------------------------------- sdc WDC WD32 00AAJS-22L7A0 ID 152d:2336 JMicron Technology Corp. iProduct: JM20336 SATA, USB Combo sdb WDC WD32 00AAJS-22L7A0 ID 152d:2336 JMicron Technology Corp. iProduct: USB2.0 Storage Device
As seen in the above output, they have almost identical usb bridge/controller chips within the two enclosures.
./stop-start.bsh sdc
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 176
Start stop unit command: 1b 00 00 00 00 00
Start stop unit command: 1b 00 00 00 01 00
start stop unit: Fixed format, current; Sense key: Unit Attention
Additional sense: Not ready to ready change, medium may have changed
unit attention
START STOP UNIT command failed
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 177Note that the start/stop count on the disk changed as expected. Now to test the 2nd usb disk enclosure.
./stop-start.bsh sdb
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 90
Start stop unit command: 1b 00 00 00 00 00
Start stop unit command: 1b 00 00 00 01 00
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 90And in this case the start/stop count didn't change. Additional testing with a patch from the aforementioned BZ didn't help or change the behavior. In this case, the usb chip in the sdb enclosure didn't fully support start/stop commands. So in the above case, the usb enclosure that is failing to spin down is due to hardware limitations within the usb bridge/controller chip.
The test script used was:
--- FILE: stop-start.bsh --- /usr/sbin/smartctl -a /dev/$1 | grep Start_Stop_Count sg_start -v --stop /dev/$1 sg_start -v --start /dev/$1 /usr/sbin/smartctl -a /dev/$1 | grep Start_Stop_Count /usr/sbin/smartctl -a /dev/$1 | grep Start_Stop_Count
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments