Linux – Display Power on hours of hard disk from shell

hard drivelinuxshell

Is there a program which can display the power on hours of a hard disk from a *nix shell? I'm rewriting a server benchmark program, and this would be a useful value to compare.

Best Answer

smartctl from the smartmontools package can display this information, provided the OS has "raw" access to the device. If you are using a hardware RAID, this information is typically not available without array-specific drivers and userland tools.

I'll leave it as an exercise for the reader to employ standard unix text processing tools to filter out the information you need.