External HDD idle?

You don’t need to install “hdparm” as it’s part of the system already. (See this post)

Just make your “autostart.sh” with needed lines from mentioned link…