7

In order to do disk rotation in a server, I need to know the current running time (online) time of a disk on a Linux CentOS release 6.3 (Final) system.

The disks are connected with SATA (e.g. /dev/sdc), are simple rotating type (Western Digital RE type disks), and are not organized in any RAID or similar.

I have tried to find it using smartctrl (as suggested in superuser.com/questions/279412), but was unable to find the information. Any suggestion for command ?

  • 2
    What do you mean you get no luck when running smartctrl? Do you get errors or what? How are the disks physically connected? Do you have a hardware RAID controller? You might not have an easy way to access any data with harware RAID. You really need to provide more details. – Zoredache Dec 10 '13 at 20:39
  • 1
    So what output do you get for smartctl --all /dev/sdc? You should see a section labeled Vendor Specific SMART Attributes with Thresholds. Do you see any values there? What exactly did you get? – Zoredache Dec 10 '13 at 20:54
  • Yes, thanks, found it, I assume it is "Power_On_Hours". Will update the post with result. – Morten Zilmer Dec 10 '13 at 20:58
15

Answer based on comments from @Zoredache:

Command is smartctl --all /dev/sdc and the section to look under is "Vendor Specific SMART Attributes with Thresholds", which has an attribute named "Power_On_Hours".

So command for just getting power on hours (runnning) is:

smartctl --all /dev/sdc | grep Power_On_Hours

Which can then show something like:

9 Power_On_Hours          0x0032   087   087   000    Old_age   Always       -       10171

The running time is thus: 10171 hours

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.