Get a list of all disks and show the serial numbers
1 2 3 4 5 6 7 8 9 10 |
#!/bin/bash if [ ! -x /usr/sbin/hdparm ] ; then echo "Missing hdparm" exit 1 fi for disk in /dev/sd?; do echo "$disk: `hdparm -I $disk | grep "Serial Number:" | awk '{ print $3 }'`" done |