HDD doesn't spin-down with hd-idle or hdparm

Router: Netgear Nighthawk X4S - R7800
OpenWRT: 19.07.3
External HDD: Seagate 4 TB

The HDD is connected to the USB port on the side of the router, mounted using ntfs-3g, and then shared with devices using a Samba server. Works very well, no complaints there.

Only problem is that I can't get the HDD to spin-down automatically. I tried hd-idle, I set it to shut off after 10 minutes of idle time. More than 15 minutes passed, it did not spin down.

I had to manually issue 'hd-idle t sda2' for it to stop spinning.

I then tried hdparm, set it to 20 minutes this time. It had no effect whatsoever, the HDD did not spin down.

I have a theory, the devices connected to the SMB server may be stopping the HDD from entering an idle state.

I logged into the server with my Windows PC, it asked me for the credentials, I selected the option for it to remember the credentials so I wouldn't have to type them every time.

Whenever I access the SMB server, it's seamless, it doesn't even take a second to load all the folders / thumbnails as it would when I physically plug the HDD in to my PC.

Same for my phone. I'm using MX Player on an Android phone to access content on the hard drive, and if I choose 'Local Network Storage' on the app, it immediately loads all the directories on the drive.

It makes me think the PC and Android device are both constantly accessing the drive in the background, preventing it from going in to an idle state and spinning down.

Not sure if that even makes sense, or if its possible, but that's what I think.

Is there any way to get around this and actually let the HDD spin down after the set time with either hd-idle or hdparm?

Usually this is handled by the HDD (via APM) itself however if there are frequent reads and write requests to the HDD it can't/won't spin down as requests are triggered before set timeout. Connected clients are most likely one cause bnut you may have more. That said, having a HDD spinning down and up frequently is usually considered more harmful than have it spinning all the time.

2 Likes

Fair enough. I've heard that before as well. However, this is one of those not so expensive 2.5" external HDDs, I'm not sure how long it will last if it's run 24/7 with no breaks.

Any idea what the other causes may be other than the two connected clients?