udev and how to find a harddisk
- From: Goran <xamiw@xxxxxxxx>
- Date: Wed, 18 Oct 2006 14:02:14 +0200
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
- Follow-Ups:
- Re: udev and how to find a harddisk
- From: Bill Marcum
- Re: udev and how to find a harddisk
- References:
- help: duplicate MAC address
- From: Lestat V
- help: duplicate MAC address
- Prev by Date: Re: Find sth
- Next by Date: Re: how to start the sound system
- Previous by thread: help: duplicate MAC address
- Next by thread: Re: udev and how to find a harddisk
- Index(es):
Relevant Pages
|