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?


  • 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

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.

|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. – 719016 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

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

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.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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