I've got an external 2.5", 500G USB HDD from WesternDigital
- this one: http://images.google.com/images?q=WDBABV5000ABK-00.
Without being accessed, it spins down after 5-10s (seconds, not minutes!) automatically.
This behavior seems to be hardcoded in the hardware/firmware by WD and cannot be changed (if anyone knows better, please leave a comment). It can be very annoying, for example when starting a file manager or open a 'save as...'-dialog etc. because the hard drive has to spin up every time adding a delay of some seconds until the dialog appears. The same happens when reading or writing at a low speed (let's say ~ <10KiBytes/s) - the drive spins up and down multiple times a minute.
A dirty workaround is to keep the drive busy by touching and syncing in a short interval.
A quick way to do this via commandline:
while [ 1 ]; do echo "touch at - `date`"; touch /media/WD_500G_NTFS/tempfile; sleep 5s; sync; doneA bit nicer with the following script:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# this script finds out the mountpoint for the given DISKLABEL | |
# and touches the file ${MOUNTPOINT}/tempfile periodically every | |
# INTERVAL. | |
# adjust the following two values. | |
DISKLABEL="WD_500G_NTFS" | |
INTERVAL="5s" | |
# get line with our disklabel | |
MOUNTLINE=$(mount -l | grep "$DISKLABEL"); | |
# check if mounted | |
if [ "$MOUNTLINE" == "" ] | |
then | |
echo "Error: Partition with disklabel $DISKLABEL not mounted." | |
exit 1 | |
fi | |
# get mountpoint | |
# FIXME: | |
# not sure if awk command always returns | |
# the correct mountpoint or an empty string... | |
MOUNTPOINT=$(echo $MOUNTLINE | awk '{ print $3 }') | |
# check if mountpoint begins with /media/ to prevent errors by | |
# mountpoint extraction above. | |
# dirty. problem when partition is mounted somewhere else.. :-( | |
(echo $MOUNTPOINT | grep "\/media\/") &> /dev/null; RC=$? | |
if ! [ "$RC" = 0 ] | |
then | |
echo "Error: problem extracting mountpoint." | |
exit 2 | |
fi | |
echo "Found mountpoint for partition labeled '$DISKLABEL' at '$MOUNTPOINT'." | |
echo "Touching and syncing ${MOUNTPOINT}/tempfile every ${INTERVAL}..." | |
echo "Quit with ^C." | |
while true | |
do | |
touch ${MOUNTPOINT}/tempfile | |
sleep ${INTERVAL} | |
sync | |
done |
edit: inserted link to new post.