SHARE
TWEET

Untitled

a guest Sep 17th, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Paste at shell prompt and get:
  2. #
  3. # sdd  88665 hours (10.11 years) 0.29TiB ST3320620AS    
  4. # sdb  84030 hours ( 9.58 years) 0.29TiB ST3320620AS    
  5. # sda  82499 hours ( 9.41 years) 0.29TiB ST3320620AS    
  6. # sdi  59563 hours ( 6.79 years) 1.82TiB ST2000DL003-9VT1
  7. # sdh  52815 hours ( 6.02 years) 0.45TiB ST500DM002-1BD14
  8. # sdj  41970 hours ( 4.78 years) 2.73TiB WDC WD30EZRX-00D
  9. # sdg  31050 hours ( 3.54 years) 0.91TiB Hitachi HUA72201
  10. # sde  10779 hours ( 1.22 years) 0.91TiB SanDisk SDSSDH31
  11. # sdc   4210 hours ( 0.48 years) 0.29TiB ST3320418AS    
  12. # sdk     30 hours ( 0.00 years) 1.75TiB KINGSTON SUV5001
  13. #
  14. # Requires: smartctl, lslbk and GNU bc.
  15.  
  16. lsblk -bdno NAME,SIZE | while read dev size; do model=$(</sys/block/$dev/device/model); hours=$(sudo smartctl -a /dev/${dev} | awk '/Power_On_Hours/ { print $10 }'); years=$(bc <<< "scale=2; $hours / 24 / 365.25"); size_tib=$(bc <<< "scale=4; $size / 1024 / 1024 / 1024 / 1024"); printf "%s %6d hours (%5.2f years) %.2fTiB %s\n" $dev $hours $years $size_tib "$model"; done | sort -rnk 2
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top