Number of hours a disk was used since factory release?

Daisuke

Contributor
Joined
Jun 23, 2011
Messages
1,041
What would be the CLI command to display the number of hours a disk was used since factory release? Not sure if this is correct:
Code:
# smartctl -a /dev/da1 | egrep 'FLAG|Power_On_Hours'
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  9 Power_On_Hours          0x0032   045   045   000    Old_age   Always       -       48910

My goal is to determine how many hours a second hand disk was used, prior inserting it into pool. Thank you.
 
Last edited:

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Try smartctl -a /dev/<disk device> and look for the power on hours attribute.
 

Daisuke

Contributor
Joined
Jun 23, 2011
Messages
1,041
I updated the OP @Samuel Tai, I wanted to make sure Power_On_Hours reflects the true number of hours a disk was used. I expected this disk to have many more hours, not just 48910hrs / 5.5 years.

Edit: I noticed this:
Code:
# smartctl -Al selftest /dev/da1 | egrep 'FLAG|Power_On_Hours|LifeTime|offline'
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  9 Power_On_Hours          0x0032   045   045   000    Old_age   Always       -       48910
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%     36027         -

To me it makes more sense if the total number of hours is 48910 + 36027 = 84937hrs / 9.6 years. I know this because the disk is about 9-10 years old.

Can anyone share is this is correct?
 
Last edited:

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
I updated the OP @Samuel Tai, I wanted to make sure Power_On_Hours reflects the true number of hours a disk was used. I expected this disk to have many more hours, not just 48910hrs / 5.5 years.

Edit: I noticed this:
Code:
# smartctl -Al selftest /dev/da1 | egrep 'FLAG|Power_On_Hours|LifeTime|offline'
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  9 Power_On_Hours          0x0032   045   045   000    Old_age   Always       -       48910
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%     36027         -

To me it makes more sense if the total number of hours is 48910 + 36027 = 84937hrs / 9.6 years. I know this because the disk is about 9-10 years old.

Can anyone share is this is correct?

On one of my drives, I have power on hours at 13426, and the last offline test at 13406, which leads me to believe the test hours are included in the power on hours. This makes sense, as this was a brand new drive from Amazon I purchased about 1.5 years ago. Note, if your drive is 9-10 years old, but power on hours only reflects 5.5 years, then it's possible it sat unused in stock for 4.5 years.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
# smartctl -Al selftest /dev/da1 | egrep 'FLAG|Power_On_Hours|LifeTime|offline' ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 9 Power_On_Hours 0x0032 045 045 000 Old_age Always - 48910 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Short offline Completed without error 00% 36027 -
What that is telling you is that the last short SMART test was run when the disk had 36027 hours of spin time on it.

The power on hours counter is exactly that... just because the disk is that old doesn't mean it's been powered up the whole time since manufacture.

BTW... that should be telling you it's long overdue to revise your SMART test schedule (since you haven't run one in almost one and a half years of spin time)
 

Daisuke

Contributor
Joined
Jun 23, 2011
Messages
1,041
Note, if your drive is 9-10 years old, but power on hours only reflects 5.5 years, then it's possible it sat unused in stock for 4.5 years.
Much appreciated, so the real number of used hours is the one displayed by Power_On_Hours.

BTW... that should be telling you it's long overdue to revise your SMART test schedule (since you haven't run one in almost one and a half years of spin time)
Thanks for the advice, what's the proper way to set a schedule and run a SMART test? Thank you.
 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,925
what's the proper way to set a schedule and run a SMART test?
It's all here:

https://www.truenas.com/docs/core/tasks/smarttests/#automatic-smart-tests

For the schedule settings I use:

1637543351539.png


Top line for the long tests, bottom line for the short.
 
Last edited:

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Note that some disks have rather limited ranges they can store for this value and will roll over after a few years.
 
Top