hw-test/scripts/scan-hdd

19 lines
318 B
Text
Raw Normal View History

2016-12-12 16:34:29 -06:00
#!/bin/bash
if [ -z $OUTPUT_DIR ] ; then
source scan-dmidecode
fi
2016-12-12 16:35:27 -06:00
DISKS=`smartctl --scan | cut -d ' ' -f 1`
2016-12-12 18:43:35 -06:00
DISKS=/dev/sdb
2016-12-12 16:34:29 -06:00
for DISK in ${DISKS}
do
2016-12-12 18:41:53 -06:00
echo -n "$DISK:" >> $OUTPUT_DIR/disk.lst
smartctl -i $DISK \
| grep -i 'serial number' \
| cut -d ':' -f 2 \
| sed 's/\s\+//' \
>> $OUTPUT_DIR/disk.lst
2016-12-12 16:34:29 -06:00
done
2016-12-12 16:35:27 -06:00