View unanswered posts | View active topics It is currently Mon Sep 16, 2019 10:43 pm



Reply to topic  [ 5 posts ] 
 USB Hard Drive Spindown Issue 
Author Message

Joined: Tue Sep 01, 2009 2:04 pm
Posts: 9
Post USB Hard Drive Spindown Issue
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.


Wed Jul 21, 2010 2:24 pm
Profile

Joined: Tue Sep 07, 2010 3:29 pm
Posts: 2
Post Re: USB Hard Drive Spindown Issue
I use the following command to spindown my Samsung G2 Portable 640g
Code:
sudo sdparm --flexible --command=stop /dev/sdb

Of course, replace the /dev/sdb with you own device
if you don't have the sdparm package just install it by
Code:
sudo apt-get install sdparm


Works great on my FitPC2i


Tue Sep 07, 2010 3:35 pm
Profile

Joined: Tue Sep 01, 2009 2:04 pm
Posts: 9
Post 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...


Tue Sep 07, 2010 5:27 pm
Profile

Joined: Tue Sep 07, 2010 3:29 pm
Posts: 2
Post 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?


Wed Sep 08, 2010 8:53 am
Profile

Joined: Tue Sep 01, 2009 2:04 pm
Posts: 9
Post Re: USB Hard Drive Spindown Issue
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?


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.

http://code.google.com/p/spindown/


Wed Sep 08, 2010 6:02 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.