Display Linux / UNIX hard drive info
This shell script will loop through all hard drives in a system and display the following information:
- Device model
- Serial number
- Firmware
- Capacity
- Temperature
- S.M.A.R.T. info:
- Reallocated sector count
- Current pending sector count
- UDMA CRC error count
- test result (pass / fail)
Makes use of the smartctl utility
-
Download the shell script to your system.
-
Make it executable
chmod +x showDrives.sh
- Run the script, using one of the options below:
./showDrives.sh
OR
sh showDrives.sh
OR
bash showDrives.sh
|---------------------------------------------------------------------------------------------------------------|
| DISK | MODEL | SERIAL NUMBER | FIRMWARE | CAPACITY | TEMP | CPS | RS | UDMA | |
|---------------------------------------------------------------------------------------------------------------|
| ada0 | WD60EFRX-68L0BN1 | WD-WX11D38NJP38 | 82.00A82 | 6001 GB | 34 C | 0 |0 | 0 | PASSED |
| ada1 | WD60EFRX-68L0BN1 | WD-WX11D189VXT4 | 82.00A82 | 6001 GB | 34 C | 0 |0 | 0 | PASSED |
| ada2 | WD60EFRX-68L0BN1 | WD-WX11D28K3RX8 | 82.00A82 | 6001 GB | 34 C | 0 |0 | 0 | PASSED |
| ada3 | WD60EFRX-68L0BN1 | WD-WX21D1825SPA | 82.00A82 | 6001 GB | 34 C | 0 |0 | 0 | PASSED |
|---------------------------------------------------------------------------------------------------------------|