udev and how to find a harddisk



Hello,

I'm searching for a way to identify my harddisk with a script (somethink
similar to fdisk -l). For that I watched out in /sys/block/hd*
or /sys/block/sd*. But which entry shows me that I've found a read/write
(harddisk) device or just a read-only device (cdrom)?

When I do a 'cat /sys/block/hdc/range' (hdc is my cdrom) I'll get a '1'.
If I do the same with hda (harddisk) or sda (usb-stick) I'll get
'64' (hda) and '16' (usb-stick). So, could '/sys/block/hd*/range' or
'/sys/block/sd*/range' tell me if I found a harddisk (>1) or cdrom (=1)?

Bye

Goran


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx