I need to determine in a shell script if a given block device (e.g. /dev/sda) is a compact flash disk or a regular hard drive. Google did not help me out for once, and while udevadm info --query=all --name=sda gives me lots of information, theres nothing I recognize to mean "I'm definately (not) a flash drive" or "I'm definately (not) a hard drive".
Is it possible to distinguish these two types of storage devices?
I use Ubuntu 10.10.
hdparm -I, which shows the rotation speed (RPM, meaningless on a CF) on some drives. Many drives don't report the info though; perhaps there's another parameter you can use. – Gilles Apr 6 '11 at 23:06hdparm -I, the very first line after the device name says either "CompactFlash ATA device" or "ATA device, with non-removable media". If you'd like to post your comment as an answer, I'll accept it. – Lauritz V. Thaulow Apr 7 '11 at 7:27