Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have an external USB hard drive plugged in, and after a few minutes, when there's been no activity against it, it automatically spins down, stops, and is unmounted. Is there a way to keep it spinning so I don't lose the mount?

Cheers

share|improve this question
3  
What do you mean lose the mount? Just because it spins down doesn't mean the mount goes away. –  psusi May 27 '11 at 15:53
    
Is this a feature of your external drive? Specifying the type might help? –  Roalt May 27 '11 at 17:22
    
I can't see why it would auto-unmount in this situation but I'm interested to find out. –  boehj May 27 '11 at 22:12
add comment

2 Answers 2

up vote 1 down vote accepted

I had been looking for that answer for a Seagate FreeAgent drive, the 2 answers I found were 1) use the Seagate utility on a Windows machine to disable auto-spindown, or this page which explains how to do the same on Linux using sdparm. (but as psusi pointed out, when the drive goes into auto-spindown it shouldn't unmount, at least on recent kernels.

share|improve this answer
    
What I mean by "losing the mount" is that if I do a: cd /media/wd20/ and then sit there until it spins down, when doing a "ls" from that same point gives me an input/output error. Doing a "cd -" "cd -" to come back after that solves the problem when the disk spins up again. –  213441265152351 May 28 '11 at 9:54
    
Okay so it sounds more like timing-out rather than unmounting. I've seen something similar on Xubuntu opening Thunar on a spun-down drive, though the window opens and the drive spins up almost immediately after the error. Never got it in Ubuntu with Gnome. –  mvario May 28 '11 at 17:31
add comment

If you just need to make it work now, you can set up a loop to touch a file every 30 seconds:

while true; do
    touch /media/disk/.tempfile
    sleep 15
done

One way to use this is to make a bash file with that script and make another one containing:

screen -mdS "some name for the screen" "name of the bash file that you created earlier"

For example: screen -mdS spin spin.sh

That way you can close the ssh session without ending the script.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.