If you are going to use “hdparm” then either switch off the sleep option in HDD firmware, or make it it turn off with hdparm before HDD option kiks in.
hdparm -S 60 /dev/sda1 => spindown in 5min (sda1 => your HDD)
hdparm -S 120 /dev/sda1 => spindown in 10min
C/P
-S
Set the standby (spindown) timeout for the drive. The timeout specifies how long to wait in idle (with no disk activity) before turning off the motor to save power. The value of 0 disables spindown, the values from 1 to 240 specify multiples of 5 seconds and values from 241 to 251 specify multiples of 30 minutes.