One of the more important traits of a good home server is low power consumption. Hard drives can account for a big chunk if not the majority of power usage of a home server depending on the number of drives. Most hard drives can be put into sleep or stand-by mode to reduce power usage dramatically. Western Digital drives require a more forceful method which is where hd-idle tool comes into play. Hd-idle is a simple tool that can force both SATA and USB hard disk devices into stand-by mode.
Download latest hd-idle and unpack the archive.
tar xvzf hd-idle-1.05.tgz
Change current directory to that of the newly created hd-idle directory.
Compile the package.
Install the package.
sudo make install
Remove the downloaded archive and installation files.
sudo cd .. && rm hd-idle-1.05.tgz && rm -Rd hd-idle-1.05
Force the drives to sleep after 10 minutes.
hd-idle -t sda -i 600
Drives are specified with
-t option followed by the device name or all devices with
-a. Standby timer is set for the specified drives with
-i option in seconds.
Open rc.local configuration file.
sudo nano /etc/rc.local
Add the hd-idle command to the file just before
exit 0 line.
hd-idle -i 300
This will execute hd-idle command at boot time which will put drive to sleep after the specified period of time.