| #!/bin/bash | |
| DIR='/dev/disk/by-id/' | |
| #DIR='/dev/disk/by-vdev/' | |
| #DIR='/dev/disk/by-path/' | |
| PREFIX='ata-*' | |
| #PREFIX='pci-*' | |
| #PREFIX='*' | |
| while IFS= read -r -d '' disk | |
| do | |
| smartctl -a "$disk" \ | |
| | egrep "self-assessment test result|^ 5 |^187 |^19(6|7|8) " \ | |
| | egrep -v 'PASSED$| 0$' \ | |
| && echo -e "$disk\n" | |
| done < <(find "$DIR" -xtype b -name "$PREFIX" -not -name '*-part*' -print0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment