History of drive power states

Hi

Are there any plans to display the history of drive power states e.g. via a graph or log etc.?
I’m wondering why my backup drive doesn’t appear to be spinning down (I can feel that it’s spinning but obvs physical monitoring isn’t very convenient).

There are several reasons for it to not spin down, one could be due to the Advanced Power Management setting, maybe the drive likes to spin, the drive is accessed periodically.

I think you will find that a large number of the forum users like to have the drives spin all the time, for a few different reasons: they believe the drive lasts longer if it doesn’t need to spinup/down/up all the time, faster access to data if the drive doesn’t need to take the time to spinup. Personal preference.

There is a lot on this topic in the forums and internet in general.

Yes I’m not here to enter the debate about idling drives - suffice to say there are multiple reasons to do so.
This is about monitoring functionality.

I have the drives concerned configured for :
HDD Standby 5
APM Level 1

I’m ditching Windows for storage as it just can’t idle drives. I tried out OMV and the UI confirms the physical check that the drives spun down so it’s definitely possible. Now I’m just trying out TrueNAS Scale for the same functionality.

I can display the current state via the CLI but I’m really looking for historical graphical representation.

$ for d in /dev/sd?; do echo -n "$d: "; sudo hdparm -C $d | grep state; done
/dev/sda: drive state is: active/idle
/dev/sdb: drive state is: active/idle
/dev/sdc: drive state is: unknown
/dev/sdd: drive state is: active/idle
/dev/sde: drive state is: unknown

When you say your “backup drive” isn’t spinning down, what kind of drive is this? Is this some kind of external USB drive? If so, those things are supposed to power down. Keeping them spinning will kill them early, because they don’t have proper cooling to run 24x7. They’re not like normal desktop or server HDDs, especially the little 2.5" ones. Normally these external drives are set to spin themselves down after a short period of inactivity for this reason, even while plugged in.

They are 3.5" SATA internal drives. As before, they went into standby mode with OMV so it’s not a h/w issue.

E2A: I’ve had far too many issues with drives in USB-attached external docks that I certainly won’t use them for any critical data. They appear to be a strictly consumer-grade item built to a price, which entails dodgy chips, PCB construction, components, drivers, PSUs etc.

Fair enough.

If you really want to monitor the drives, I would suggest you create a small BASH script, or better yet, a Python script which samples the drives and creates a CSV file (spreadsheet) each time the drives have a status change, include a time stamp of course.

If you wanted to make it a little fancier, have the script create a webpage on your machine and then look at it periodically. That would give it a more professional touch.

This would provide you with the data you are looking for. It would not provide the data in the TrueNAS GUI of course, if you kept it simple.

Hmm, it was my intention indeed to accomplish this very thing by leaving the CLI and scripting behind. I cut my teeth on AT&T SVR4 and I had naively assumed that there would be a power status monitor built-in that could display the power state.

I did think that the drive temp displays under reporting might be suitable as a pointer to what might be occurring but I can’t see any pronounced dips in values that I’d associate with a drive standby state.

It seems that furher digging into the power state info is required and to uncover if there is a fundamental issue present.

I’d have to look to see as I’m not sure if TrueNAS API would contain this kind of information, I really doubt it. But that still leads you down the path of a script in some way.

Well, if you really want the metrics, you are likely going to build your own script.

I was thinking, maybe you could use smartd to notify you of any changes vice repeatedly running a script. I’m not sure but if possible, it could be the best way forward.

1 Like

Tx for the tip. I’ll investigate and report back.
The temp values method is a dead end due to the power mgmt page stating “Temperature monitoring is disabled for standby disks.”