# How do I trace back a device file to a kernel component?

## Kobboi

How do I trace back a device file to a kernel component? I.e. if I boot from a livecd that can find my hard disk (controller), how do I know which device drivers were used? (Don't say lsmod, because on the livecd, almost every module is loaded, even the ref count can be tricky)

----------

## NeddySeagoon

Kobboi,

```
lspci -vv
```

----------

## kite14

An alternative could be: 

```
lspci -k
```

 for a more compact output.

-k option shows  kernel  drivers handling each device and also kernel modules capable of handling it.  Turned on by default when -v is given in the normal mode of  output.   (Currently  works only on Linux with kernel 2.6 or newer.)

----------

## pappy_mcfae

If you want definitive answers to which driver(s) to use, use lspci -n and this site. It will tell you the actual driver name and some alternate drivers (if available). I use this method daily working on other peoples' kernels.

Blessed be!

Pappy

----------

## Kobboi

I knew about the site, but that didn't solve my problem  :Crying or Very sad: 

----------

## naelq

how about giving us more info regarding your problem?  :Smile: 

like:

> your hardware/models

> lspci

> symptoms/errors

nael

----------

## pappy_mcfae

Yes. It's hard to troubleshoot without information.

Blessed be!

Pappy

----------

## Kobboi

I know, but I had no access to the machine at the time and I still wanted to vent my frustration  :Smile: 

```
# lspci

00:00.0 Host bridge: Intel Corporation 82Q35 Express DRAM Controller (rev 02)

00:01.0 PCI bridge: Intel Corporation 82Q35 Express PCI Express Root Port (rev 02)

00:02.0 VGA compatible controller: Intel Corporation 82Q35 Express Integrated Graphics Controller (rev 02)

00:02.1 Display controller: Intel Corporation 82Q35 Express Integrated Graphics Controller (rev 02)

00:03.0 Communication controller: Intel Corporation 82Q35 Express MEI Controller (rev 02)

00:03.2 IDE interface: Intel Corporation 82Q35 Express PT IDER Controller (rev 02)

00:03.3 Serial controller: Intel Corporation 82Q35 Express Serial KT Controller (rev 02)

00:19.0 Ethernet controller: Intel Corporation 82566DM-2 Gigabit Network Connection (rev 02)

00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 02)

00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 02)

00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 02)

00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 02)

00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 02)

00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 02)

00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 02)

00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 02)

00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 02)

00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 92)

00:1f.0 ISA bridge: Intel Corporation 82801IO (ICH9DO) LPC Interface Controller (rev 02)

00:1f.2 IDE interface: Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 4 port SATA IDE Controller (rev 02)

00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 02)

00:1f.5 IDE interface: Intel Corporation 82801I (ICH9 Family) 2 port SATA IDE Controller (rev 02)

03:00.0 Ethernet controller: 3Com Corporation 3c905 100BaseTX [Boomerang]

03:02.0 Serial controller: Moxa Technologies Co Ltd Smartio C168H/PCI (rev 02)

```

I have ata_piix compiled in-kernel.

----------

## Kobboi

 *kite14 wrote:*   

> An alternative could be: 
> 
> ```
> lspci -k
> ```
> ...

 

Weird, on the 2008.0 livecd, lspci does not have a -k option.

----------

## naelq

what HDD do you have? is it SATA/IDE? if it's SATA, then do you have AHCI mode set in BIOS?

nael

----------

## NeddySeagoon

Kobboi,

Its like this

----------

## kite14

 *Kobboi wrote:*   

> Weird, on the 2008.0 livecd, lspci does not have a -k option.

 

I confirm that.

-k option is available in current sys-apps/pciutils (v. 3.0.2).

----------

