hdparm

Install

sudo apt install -y hdparm

CLI

# set drive set standby (spindown) timeout
sudo hdparm -S 60 /dev/sdb
 
# put drive in standby mode
sudo hdparm -y /dev/sdb
 
# show spindown status
sudo hdparm -C /dev/sdb

Configure persistent standby (spindown) timeout

cat <<EOF>> /etc/hdparm.conf
/dev/sda {
   spindown_time = 240
}
EOF

sudoers

cat <<EOF> /etc/sudoers.d/hdparm
%sudo ALL=(ALL) NOPASSWD: /sbin/hdparm -y /dev/sdb
#ALL ALL = NOPASSWD: /sbin/hdparm -y /dev/sdb
EOF

Links
https://linuxundich.de/hardware/festplatten-automatisch-im-betrieb-in-den-standby-schalten/