I need to disable the spin-down on an external USB drive because it spins down spontaneously while in use. The drive forgets the spindown-disable state across power outage so I need to reissue the hdparm command with each boot or hotplug. Where should I put the hdparm command to do this?
On Sun, 27 Feb 2011, Kenneth Porter wrote:
To: CentOS mailing list centos@centos.org From: Kenneth Porter shiva@sewingwitch.com Subject: [CentOS] Standard location for hotplug-time hdparm invocation
I need to disable the spin-down on an external USB drive because it spins down spontaneously while in use. The drive forgets the spindown-disable state across power outage so I need to reissue the hdparm command with each boot or hotplug. Where should I put the hdparm command to do this?
Not sure about hotpluging, but for the reboot /etc/rc.d/rc.local might be a good place to try this:
#!/bin/sh # # This script will be executed *after* all the other init # scripts. You can put your own initialization stuff in here # if you don't want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
# turn off DMA for hde WD drive # -d0 = off # -d1 = on # hdparm -d0 /dev/hde
# set sector count for multiple sector I/O # WD drives like a low setting # to prevent I/O data errors. # hdparm -m2 /dev/hde
Kind Regards,
Keith Roberts
----------------------------------------------------------------- Websites: http://www.karsites.net http://www.php-debuggers.net http://www.raised-from-the-dead.org.uk
All email addresses are challenge-response protected with TMDA [http://tmda.net] -----------------------------------------------------------------
--On Sunday, February 27, 2011 3:37 PM +0000 Keith Roberts keith@karsites.net wrote:
Not sure about hotpluging, but for the reboot /etc/rc.d/rc.local might be a good place to try this:
Googling turned up that suggestion a lot. But I realized that since this is a backup drive, it would be more useful to do it when it's plugged in. It seems like invoking hdparm from udev or one of its downstream relatives (hald, etc.) would be the logical place.
BTW, this came up because the drive is a Seagate GoFlex Desk which spins down and then won't come back up reliably. Googling around turned up this patch that looks like it shows up in a much later kernel, no earlier than 2.6.24: