I've installed hdparm like this:
sudo apt install hdparm
sudo hdparm -y /dev/sda # Legt HDD sofort schlafen
sudo nano /etc/hdparm.conf
spindown_time = 240
sudo hdparm -B 127 -S 240 /dev/sda
sudo hdparm -W 0 /dev/sda1
sudo /usr/lib/pm-utils/power.d/95hdparm-apm resume
I still didn't get the spindown. So I've added hd-idle:
sudo apt-get install build-essential fakeroot debhelper -y
tar -xvf hd-idle-1.05.tgz && cd hd-idle
sudo dpkg -i ../hd-idle_*.deb
sudo nano /etc/default/hd-idle
HD_IDLE_OPTS="-i 1200 -l /var/log/hd-idle.log"
sudo systemctl restart hd-idle
Roughly following the guide from - https://www.htpcguides.com/spin-down-and-manage-hard-drive-power-on-raspberry-pi/
I've monitored the spindowns with:
less +F /var/log/hd-idle.log
I still didn't get the spindowns. Looking at the HDD-LED I could see and hear that something accessed the drive and thus keep it spinning. So I've added two monitoring tools.
sudo apt-get install inotify-tools
inotifywait -m /mnt/backup/
sudo apt install blktrace
sudo btrace /dev/sda
Btrace showed lines with "... [smartd]", so I disabled it.
sudo systemctl stop smartd
sudo systemctl disable smartd
and "... [pool]", which is part of the udisk2 crypt-mounting stuff.
sudo systemctl stop udisks2
sudo systemctl disable udisks2
After disabling both daemons I got my spindown.