I'm not sure if this is the right place to post this question to, but you have been so helpful so far that I thought I would give it a try.
I have a script that spins down my USB hard drive after 5 minutes of activity using:
sg_start --stop --pc=2 /dev/device
I confirm that the device is down with:
hdparm -C /dev/device
At this point, when I try list the files on this volume, I receive this error:
ls: reading directory .: Input/output error
I noticed that the device was being reassigned when coming out of sleep from /dev/sdb to /dev/sdc, so I wrote a udev rule to assign it a persistent device name /dev/DataDrive1. This worked, and now my my fstab references this device successfully. When coming out of sleep, the device name does not change. However, I still cannot access the volume, and receive the same error.
The only way to fix the issue is either to reboot, or to:
umount /dev/DataDrive1
mount -a
Can anyone please point me in the right direction? Any help would be greatly appreciated.
USB Hard Drive Spindown Issue
Re: USB Hard Drive Spindown Issue
I use the following command to spindown my Samsung G2 Portable 640g
Of course, replace the /dev/sdb with you own device
if you don't have the sdparm package just install it by
Works great on my FitPC2i
Code: Select all
sudo sdparm --flexible --command=stop /dev/sdb
if you don't have the sdparm package just install it by
Code: Select all
sudo apt-get install sdparm
Re: USB Hard Drive Spindown Issue
Thanks. Does your drive reassign its device (For example from /dev/sdb to /dev/sdc) upon spin-up?
How do you check the spin status? Another USB drive of mine would tell me the status with hdparm -C, but this one doesn't. I suppose I could go pick it up and see if it's spinning...
Thanks again for the reply...
How do you check the spin status? Another USB drive of mine would tell me the status with hdparm -C, but this one doesn't. I suppose I could go pick it up and see if it's spinning...
Thanks again for the reply...
Re: USB Hard Drive Spindown Issue
No, it does not reassign its device.
My knowledge of linux is limited so I can't tell you how to fix this. I'm sure there are plenty of forum posts discussing this.
To check if my devices indeed did a spindown, I just listened to them
I'm wondering how your script works to check for 5 minutes of inactivity, can you post that?
My knowledge of linux is limited so I can't tell you how to fix this. I'm sure there are plenty of forum posts discussing this.
To check if my devices indeed did a spindown, I just listened to them

I'm wondering how your script works to check for 5 minutes of inactivity, can you post that?
Re: USB Hard Drive Spindown Issue
I used this little program that I found on Google Code that just calls sdparm, sg_start, or whatever app you use to spin the drive down.mingoes wrote:No, it does not reassign its device.
My knowledge of linux is limited so I can't tell you how to fix this. I'm sure there are plenty of forum posts discussing this.
To check if my devices indeed did a spindown, I just listened to them
I'm wondering how your script works to check for 5 minutes of inactivity, can you post that?
http://code.google.com/p/spindown/