Heres one way...works with ide drives, not sure of scsi:
Code:
# dmesg | grep hd | grep DISK | wc -l
OK, here we go:
Code:
# echo $( dmesg | grep hd | grep DISK | wc -l ) "ide drives " \
$( dmesg | grep sd | grep DISK | wc -l ) "scsi drives"
(That should be on one line...I just hate having to scroll horizontally) This is probably not infallable...I don't know how scsi drives identify themselves in dmesg, and you may get a few false positives...