LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to turn off (spindown) SATA HDD on Debian after 10 min inactivity (https://www.linuxquestions.org/questions/linux-software-2/how-to-turn-off-spindown-sata-hdd-on-debian-after-10-min-inactivity-795360/)

jtag 03-14-2010 01:51 PM

How to turn off (spindown) SATA HDD on Debian after 10 min inactivity
 
I wold like to know how to turn off (spindown) SATA HDD on Debian after 10 min inactivity (using a script).
I wold like to setup a NAS based on Debian. The NAS will be hallways ON but I want the NAS HDD to gos off after 10 of inactivity. When I access the NAS server the HDD should go back ON (after a small delay).

Thank you,

GrapefruiTgirl 03-14-2010 01:58 PM

You may find success by grabbing `hdparm` or `sdparm` or the more complex `sg3_utils` package (whichever best applies to your particular drive) and querying the drive for its power-saving and spindown options, if it has any.

You can use these tools to query the HDD for all sorts of things, and to set many options that control how the drive operates.

Another useful tool for querying info from the drive, is the SMART toolset (smartd and smartctl) though I cannot recall right off, if this can be used to SET any parameters, or if it's only purpose is getting status/health info from the drive.

In short: sdparm or hdparm should be what you're looking for. You can set parameters via one of these tools, in your rc.local init script or some comparable means.

Sasha


All times are GMT -5. The time now is 09:30 PM.