[SOLVED] Not able to power down Hitachi SimpleDrive mini USB HDD
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Not able to power down Hitachi SimpleDrive mini USB HDD
Hello
Anybody had much luck/experience powering down USB HDDs?
I've not been able to find the commands to power down a Hitachi SimpleDrive mini USB HDD. Maybe it's not possible.
According to Yan Li's Blog, "The problem: according to its user manual, you should disconnect the drive safely when it is not active, but in a Linux system how to do this is not very straightforward. You may notice that after you unmount it (whether through command-line or a desktop environment), the drive is still spinning and it's LED on. If you read it's user manual carefully you'll find that the manufacturer never said it's safe to disconnect it from your system in such condition.
The quick solution to this problem:
send SYNC, then STOP command to the device, this can be done easily in Linux by unbinding the device
suspend the USB port by echoing a "suspend" to the "/sys/bus/usb/devices/$DEVICE/power/level", where $DEVICE corresponding to the device of your USB device."
Sounds reasonable. I downloaded the latest version of Yan Li's script from his git, built a kernel with CONFIG_USB_SUSPEND enabled and tried it. No error messages but the HDD went right on spinning.
There were some reports of it being necessary to quiesce HDDs with sdparm first so I tried that but without sucess Here's the last attempt
Code:
root@CW8:~# sdparm --command=sync /dev/sdc
/dev/sdc: Hitachi HTS545050B9A300
root@CW8:~# sdparm --command=stop /dev/sdc
/dev/sdc: Hitachi HTS545050B9A300
root@CW8:~# sdparm --command=eject /dev/sdc
/dev/sdc: Hitachi HTS545050B9A300
root@CW8:~# /home/c/d/bin/try/suspend-usb-device.sh -v /dev/sdc
Found device /devices/pci0000:00/0000:00:13.5/usb1/1-5 associated to /dev/sdc; USB bus id is 1-5
Syncing device /dev/sdc
Stopping device /dev/sdc
Unbinding device 1-5
Checking whether /devices/pci0000:00/0000:00:13.5/usb1/1-5 can be suspended
Suspending /devices/pci0000:00/0000:00:13.5/usb1/1-5 by writing to /sys/devices/pci0000:00/0000:00:13.5/usb1/1-5/power/level
This tried on Slackware 13.0 32-bit running a 2.6.29.6-smp kernel.
If you run sync before unmounting, or run eject, it should be safe to pull the plug.
Thanks gnashley that's what I'm doing now. No choice! But I have two issues with it ...
Firstly, I'm with Yan Li in wanting to follow the manufacturer's recommendations.
Secondly I prefer not to waste electrical power. Even after umount, sync, stop and eject the spindle is still spinning and the drive is warm. Warm means dissipated energy means environmental damage -- and for for no benefit In this case the drive will be plugged into a 24x7 backup server so even a small waste adds up over a period.
EDIT: "sync" above refers to the sdparm command to flush the device's internal buffers, not the Linux sync command to flush kernel buffers to the file system.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.