Identifying Disks in Linux

Label all disks

Somewhere visible on each disk, label the serial number

Find which drive letter corresponds to each disk

Better to do it in advance than try and discover it in earnest ;-)

id_disk.sh
#!/bin/sh
 
letters=(a b c d e f g h i j k l m n o p q r s t u v w x y z 
aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az)
 
for i in "${letters[@]}"
do
	if [ -e /dev/sd$i ]; then echo "/dev/sd$i : " $(hdparm -I /dev/sd$i | grep Serial); fi
done

I did not know until this project how linux names SCSI devices after sdz, interesting. Not sure what happens after zz, aaa I suppose.

Update: Disk counting starts over after sdz using sdaa, sdab, sdac… (at least under Ubuntu Linux). Script updated to reflect this (verified with Ubuntu 9.10).

This script works nicely for making sure all the drives are showing up. It's much easier than counting drives manually, either in a gui or by entries in /dev. Direct the output of the script to a text file when running it and then open the resulting text file in a text editor with line numbers enabled.