Since two weeks my server is reporting some S.M.A.R.T-errors on one of my hard drives. For a quick overview about all drives (serial numbers, mode) and finding the one which has to been replaced, I’ve written a small script. The script produces a fancy list of all available drives on your Linux host. It uses hdparm in combination with sed for retrieving the drive information, so both are the only dependencies. With a few changes it could be used directly for generating content as Markdown.
Code #
|
|
Output #
| DEVICE | SERIALNO | MODEL |
|---|---|---|
| /dev/sda | WD-WMAZA5927357 | WDC WD20EURS-63S48Y0 |
| /dev/sdb | WD-WCAYY0133809 | WDC WD20EARS-00J2GB0 |
| /dev/sdc | WD-WCAYY0136723 | WDC WD20EARS-00J2GB0 |
| /dev/sdd | 000000001221090B8B09 | M4-CT128M4SSD2 |
| /dev/sde | WD-WCAYY0136514 | WDC WD20EARS-00J2GB0 |
| /dev/sdf | WD-WCAYY0136732 | WDC WD20EARS-00J2GB0 |
| /dev/sdg | WD-WCAZAA410704 | WDC WD20EARS-00MVWB0 |
Could by handy for later. 😃