How can i check if my disk is idle?

peterge

Explorer
Joined
Sep 22, 2021
Messages
57
I have set the power management for my toshiba hdds to 64 (spindown, medium power usge). How can i check, if my disks go to standy? The system is basically only used by me/some cron jobs about 3 times per day. What would be the best power setting? Its basically unneccessary to keep the hdd spinning whole day...
 
Joined
Jan 27, 2020
Messages
577

ATA drives​

The current power mode of an ATA drive can be checked using the command camcontrol epc $drive -c status -P, where $drive is the drive to check (e.g., ada0).

It should return Current power state: Standby_z(0x00) for a spun down drive.

SCSI drives​

The current power mode of a SCSI drive can be checked through reading the modepage 0x1a using the command camcontrol modepage $drive -m 0x1a, where $drive is the drive to check (e.g., da0).

A spun down drive should be in one of the standby states Standby_y or Standby_z.

 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Some good stuff which works well for CORE...
Great response if the topic weren't SCALE. There's no camcontrol in Debian.

For SCALE, I did some of the work to figure it out and forked that Github with it:


No idea for SCSI, but for ATA it worked out to be something like this:

hdparm -C /dev/$1 | & grep "standby"
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Geez, and I wanted to say use a stethoscope. :wink:

Its basically unneccessary to keep the hdd spinning whole day...
So hopefully you have read a few threads here and on the internet about NAS drives spinning down often and how this can shorten the life of the hard drive. The general advice here is to leave your drives spinning to reduce premature failure of the motor and/or driver circuits. You can park your heads if desired because the life on those operations has been extended over the years, but I don't like to park too often.

You can also examine the SMART data to see how many times your drive has spun up and head load count. These values are important to consider. If the spin up count is happening more than a few times a day then it's my opinion that you are doing something wrong. If the value goes up by a count on 1 per day, then you have it dialed in properly to sleep when not in use.

If you understand these concerns then please disregard.
 
Joined
Jan 27, 2020
Messages
577
Great response if the topic weren't SCALE. There's no camcontrol in Debian.

For SCALE, I did some of the work to figure it out and forked that Github with it:


No idea for SCSI, but for ATA it worked out to be something like this:

hdparm -C /dev/$1 | & grep "standby"
whoopsie, didn't catch at all that it is a SCALE related question. I'm pledging for separating the branches into two communities....:cool:
 

emk2203

Guru
Joined
Nov 11, 2012
Messages
573
Just want to add my 2¢ here:

A system-agnostic way which works on both SCALE and CORE would be
Code:
smartctl --nocheck standby -i $drive
; I am using
Code:
for drive in /dev/ada?; do smartctl --nocheck standby -i $drive | grep '^Power mode was:'; echo $drive; done
to check if the disks sleep or not. This should not wake them up, either. Taken from StackOverflow, not thoroughly tested if true or not.

EDIT after testing: It doesn't wake them up, but doesn't get results either. --nocheck standby means what it says: If disk in standby, leave it alone. So, I'm using
Code:
for drive in /dev/ada?; do sudo camcontrol epc $drive -c status -P; echo $drive; done
for now on CORE. It would be possible to ignore the missing output from the smartctl command as indication that the disk is in standby, though.

Regarding to disk life, I lean towards adopting the 100,000 power cycles per lifetime also for spin up/down, which gives me 5 times a day as a realistic measure (makes 5.5 years disk life).
 
Last edited:
Top