less than 1 minute read

I have a 12 TB WD Essentials USB hard drive connected to my Raspberry Pi 3B. It’s annoyingly loud, so I needed a solution to spin it down when not in use. There are several ways to do it, I found that hd-idle worked for me.

This post is a part of my Homelab Series. See the index here.

Install

Download the package for pi:

curl -s https://api.github.com/repos/adelolmo/hd-idle/releases/latest | awk -F\" '/browser_download_url.*.arm64.deb/{system("curl -OL " $(NF-1))}'

Install it:

sudo dpkg -i ./hd-idle*.deb

Config

Edit the config file:

sudo nano /etc/default/hd-idle

And make the following changes:

START_HD_IDLE=true
HD_IDLE_OPTS="-i 0 -a /dev/sda -i 600 -l /var/log/hd-idle.log"

Where /dev/sda is the hard drive you want to spin down after 600 seconds (=10 minutes).

Enable Service

sudo systemctl enable hd-idle
sudo systemctl start hd-idle

Check Logs

sudo cat /var/log/hd-idle.log
journalctl -u hd-idle.service | grep hd-idle| tail -n 20
sudo systemctl status hd-idle.service | tail -n 20