-   Linux - Hardware (
-   -   Hardware Device List (

mackie_lin 11-25-2002 05:36 PM

Hardware Device List
Is there any way to get a list of all the hardware devices (USB, etc.) attached to the system and which device name (wrong word, but i can't think of the correct term right now) that they reside on? For example, /dev/sda or /dev/sdc3 etc. I need to know because for some reason, my floppy drive keeps changing names (at one point it was sda, then sdc, and now I have no idea) every time I boot into Linux.

Aussie 11-26-2002 12:34 AM

Devices that start with 's' are scsi devices, your floppy should be /dev/fd*. For various device lists you can do "cat /proc/*"
"cat /proc/pci" for pci
"cat /proc/scsi" for scsi and so on.

moses 11-26-2002 01:39 AM

Another option is to recompile your kernel to support devfs, which is a
dynamic device filesystem, rather than the node locked /dev that has been
so popular for so long. If you go this route, READ, READ, READ. You
can cause some major problems if you screw up, but once you've got it,
it's great.
For example:

bash-2.05a$ ls /dev/ide/
cd  hd  host0
bash-2.05a$ ls /dev/ide/host0/
bus0  bus1
bash-2.05a$ ls /dev/ide/host0/bus1/
target0  target1
bash-2.05a$ ls /dev/ide/host0/bus1/target0/
bash-2.05a$ ls /dev/ide/host0/bus1/target0/lun0/
disc  part1  part10  part2  part5  part6  part7  part8  part9

This shows my partitions on my first hard drive on my second
IDE bus of the first IDE host controller. . .

mackie_lin 11-26-2002 06:46 AM

I really don't think I am ready to recompile my kernel. The standard Mandrake kernel was too old for my computer, so my friend (over the phone) had me download and install a new one. This wasn't recompiling, but I still had no idea what he was having me do.

So basically, I have to use the method that Aussie suggested and then just guess through all of them until the floppy drive mounts? I'd think that a sophisticated OS like Linux would be able to automatically detect media devices instead of making the user guess and check. Strange.

Thanks for both of your help though. Maybe someone else has a suggestion/program that makes this a little more bareable?

moses 11-26-2002 12:46 PM

Linux does automatically detect devices (for the most part), it just isn't
always clear what the user wants those devices to be. Is your floppy
drive anything other than the (outdated) standard 1.44 MB floppy that
has its own controller on the MB?
You can also find the floppy drive name in the boot messages:
dmesg | less
look for something like:

    ide0: BM-DMA at 0xc400-0xc407, BIOS settings: hda:DMA, hdb:DMA
    ide1: BM-DMA at 0xc408-0xc40f, BIOS settings: hdc:DMA, hdd:DMA
hda: IBM-DTLA-305030, ATA DISK drive
hdc: IBM-DTTA-350840, ATA DISK drive
hdd: CD-ROM Drive/F5A, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
hda: 60036480 sectors (30739 MB) w/380KiB Cache, CHS=3737/255/63
hdc: 16514064 sectors (8455 MB) w/467KiB Cache, CHS=16383/16/63, UDMA(33)
hdb: ATAPI 48X DVD-ROM drive, 256kB Cache, UDMA(33)
Uniform CD-ROM driver Revision: 3.12
Partition check:
 /dev/ide/host0/bus0/target0/lun0: p1 p2 p3 < p5 p6 p7 p8 >
 /dev/ide/host0/bus1/target0/lun0: [PTBL] [1027/255/63] p1 p2 < p5 p6 p7 p8 p9 p10 >
Floppy drive(s): fd0 is 1.44M

This tells me that my floppy drive is /dev/fd0, I have the following hard
drive partitions:
/dev/hda1, /dev/hda2, /dev/hda3, /dev/hda5, hda6, hda7, hda8
/dev/hdc1, /dev/hdc2, hdc5, hdc6, hdc7, hdc8, hdc9, hdc10
That /dev/hdb is a DVD drive, that /dev/hdd is a CD drive.

mackie_lin 11-26-2002 05:10 PM

I checked that command you suggested, but it doesn't actually give me the name of the floppy drive. :(

mackie_lin 11-26-2002 05:25 PM

Oh, I found it! It really did stay /dev/sdc, I just forgot to run 'su; modprobe usb-storage' lol

thanks for all the help though!!

All times are GMT -5. The time now is 01:32 AM.