Portál AbcLinuxu, 12. června 2024 15:30

Jak zjistím, co mám za hardware?

Často je nutné vědět, jaký hardware máte v počítači, na němž používáte Linux. Pokud to z nějakého důvodu nevíte a nechcete to zjišťovat otevíráním počítače (případně to k ničemu nevede), existuje několik způsobů, jak to zjistit.

lspci

Příkaz lspci (ne-root uživatel jej musí spustit s uvedením celé cesty - /sbin/lspci) slouží k vypsání PCI zařízení a informací o sběrnici. Je možné z něho zjistit, jaké máte přídavné karty v počítači. Vzorový výpis vypadá takto:

0000:00:00.0 Host bridge: Intel Corp. 82845 845 (Brookdale) Chipset Host Bridge (rev 11)
0000:00:01.0 PCI bridge: Intel Corp. 82845 845 (Brookdale) Chipset AGP Bridge (rev 11)
0000:00:1d.0 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 01)
0000:00:1d.1 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 01)
0000:00:1d.7 USB Controller: Intel Corp. 82801DB/DBM (ICH4/ICH4-M) USB 2.0 EHCI Controller (rev 01)
0000:00:1e.0 PCI bridge: Intel Corp. 82801 PCI Bridge (rev 81)
0000:00:1f.0 ISA bridge: Intel Corp. 82801DB/DBL (ICH4/ICH4-L) LPC Bridge (rev 01)
0000:00:1f.1 IDE interface: Intel Corp. 82801DB/DBL (ICH4/ICH4-L) UltraATA-100 IDE Controller (rev 01)
0000:00:1f.3 SMBus: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller (rev 01)
0000:01:00.0 VGA compatible controller: nVidia Corporation NV18 [GeForce4 MX 440SE AGP 8x] (rev a2)
0000:03:00.0 Multimedia audio controller: Ensoniq ES1370 [AudioPCI]
0000:03:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
0000:03:02.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
0000:03:03.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
0000:03:04.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
0000:03:04.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)

lspci vypisuje rozpoznané čipsety, nikoliv názvy zařízení pod nímž jsou prodávány, takže někdy můžete i odhalit, že v Linuxu údajně nepodporované zařízení je vybaveno stejným čipsetem jako zařízení podporované a často takto ono zařízení rozchodit.

lspci lze přidat i parametr -v, což způsobí, že jeho výpis bude o něco podrobnější. Lze zadat i několik v, čímž získáme ještě podrobnější informace.

hwinfo

Bez parametrů poskytne program opravdu velké množství podrobností, chceme-li jen přehled, je zapotřebí to specifikovat pomocé přepínače --short. Pro dlouhý výpis doporučuji:
# hwinfo &>/dev/null
Uvádím příklad krátkého výpisu:
# hwinfo --short
cpu:
                       Intel(R) Pentium(R) 4 CPU 1.80GHz, 1825 MHz
keyboard:
  /dev/input/event4    Sun Microsystems Type 6 Keyboard
  /dev/input/event2    AT Translated Set 2 keyboard
mouse:
  /dev/input/mice      GenPS/2 Genius Wheel Mouse
printer:
  /dev/usb/lp0         7260
tv card:
                       Brooktree Bt878
graphics card:
                       Micro-Star International GeForce4 MX420
sound:
                       Ensoniq ES1370 [AudioPCI]
storage:
                       Floppy disk controller
                       Micro-Star International 82801DB Ultra ATA Storage Controller
network:
                       Realtek RT8139
                       Realtek RT8139
                       Realtek RT8139
network interface:
  bond0                Network Interface
  dummy0               Network Interface
  eql                  Network Interface
  eth0                 Ethernet network interface
  eth1                 Ethernet network interface
  eth2                 Ethernet network interface
  gre0                 Network Interface
  ip6tnl0              Network Interface
  lo                   Loopback network interface
  sit0                 Network Interface
  teql0                Network Interface
  tunl0                Network Interface
disk:
  /dev/hda             ST3120026A
  /dev/hdb             ST360021A
  /dev/sda             HP photosmart 7200
partition:
  /dev/hda1            Partition
  /dev/hda2            Partition
  /dev/hdb1            Partition
  /dev/hdb2            Partition
  /dev/hdb3            Partition
cdrom:
  /dev/hdc             CD-W540E
  /dev/hdd             HL-DT-ST DVDRAM GSA-4160B
floppy:
  /dev/fd0             Floppy Disk
usb controller:
                       Micro-Star International 82801DB USB (Hub #1)
                       Micro-Star International 82801DB USB (Hub #2)
                       Micro-Star International 845PE Max (MS-6580) Onboard USB EHCI Controller
bios:
                       BIOS
bridge:
                       Intel 82845 845 (Brookdale) Chipset Host Bridge
                       Intel 82845 845 (Brookdale) Chipset AGP Bridge
                       Intel 82801BA/CA/DB/EB PCI Bridge
                       Intel 82801DB LPC Interface Controller
hub:
                       Linux 2.6.12.2 ehci_hcd Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller
                       Linux 2.6.12.2 uhci_hcd Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1
                       Linux 2.6.12.2 uhci_hcd Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2
memory:
                       Main Memory
dvb card:
                       Brooktree Bt878 Audio Capture
unknown:
                       FPU
                       DMA controller
                       PIC
                       Timer
                       RTC
                       Keyboard controller
                       PS/2 Controller
                       Micro-Star International 82801DB/DBM SMBus Controller
  /dev/ttyS0           16550A
  /dev/ttyS1           16550A
                       HP photosmart 7200 series
Program hwinfo má údajně volbu --log, která by měla logovat výstup do souboru, ale mě to nějak nefungovalo. Proto používejte raději klasické přesměrování. Program hwinfo má i další volby, které se dočtete v jeho manuálových stránkách man hwinfo. Bohužel se zkompiluje jen na x86 a ppc, proto uživatelé amd64 (a uživatelé ostatních platforem) musí použít binárku.

dmidecode

# dmidecode
# dmidecode 2.6
SMBIOS 2.3 present.
23 structures occupying 842 bytes.
Table at 0x000F0630.
Handle 0x0000
	DMI type 0, 20 bytes.
	BIOS Information
		Vendor: American Megatrends Inc.
		Version: 07.00T
		Release Date: 04/02/01
		Address: 0xF0000
		Runtime Size: 64 kB
		ROM Size: 512 kB
		Characteristics:
			ISA is supported
			PCI is supported
			PNP is supported
			APM is supported
			BIOS is upgradeable
			BIOS shadowing is allowed
			ESCD support is available
			Boot from CD is supported
			Selectable boot is supported
			BIOS ROM is socketed
			EDD is supported
			5.25"/360 KB floppy services are supported (int 13h)
			5.25"/1.2 MB floppy services are supported (int 13h)
			3.5"/720 KB floppy services are supported (int 13h)
			3.5"/2.88 MB floppy services are supported (int 13h)
			Print screen service is supported (int 5h)
			8042 keyboard services are supported (int 9h)
			Printer services are supported (int 17h)
			CGA/mono video services are supported (int 10h)
			ACPI is supported
			USB legacy is supported
			AGP is supported
			LS-120 boot is supported
			ATAPI Zip drive boot is supported
			BIOS boot specification is supported
Handle 0x0001
	DMI type 1, 25 bytes.
	System Information
		Manufacturer: Micro-Star Inc.
		Product Name: MS-6566E
		Version: 1.0
		Serial Number: 00000000
		UUID: Not Settable
		Wake-up Type: Modem Ring
Handle 0x0002
	DMI type 2, 8 bytes.
	Base Board Information
		Manufacturer: Micro-Star Inc.
		Product Name: MS-6566E
		Version: 1.0
		Serial Number: 00000000
Handle 0x0004
	DMI type 4, 32 bytes.
	Processor Information
		Socket Designation: FC-478
		Type: Central Processor
		Family: Pentium 4
		Manufacturer: Intel                           
		ID: 24 0F 00 20 55 00 00 00
		Signature: Type 0, Family 15, Model 2, Stepping 4
		Flags:
			FPU (Floating-point unit on-chip)
			DE (Debugging extension)
			TSC (Time stamp counter)
			PAE (Physical address extension)
		Version: Intel(R) Pentium(R) 4 Processor 
		Voltage: 3.3 V 2.9 V
		External Clock: 101 MHz
		Max Speed: 3000 MHz
		Current Speed: 1818 MHz
		Status: Populated, Enabled
		Upgrade: Socket 478
		L1 Cache Handle: 0x0005
		L2 Cache Handle: 0x0006
		L3 Cache Handle: Not Provided
Handle 0x0005
	DMI type 7, 19 bytes.
	Cache Information
		Socket Designation: Internal Cache
		Configuration: Enabled, Not Socketed, Level 1
		Operational Mode: Write Back
		Location: Internal
		Installed Size: 8 KB
		Maximum Size: 1024 KB
		Supported SRAM Types:
			Synchronous
		Installed SRAM Type: Pipeline Burst Synchronous
		Speed: 40 ns
		Error Correction Type: Single-bit ECC
		System Type: Data
		Associativity: 4-way Set-associative
Handle 0x0006
	DMI type 7, 19 bytes.
	Cache Information
		Socket Designation: Internal Cache
		Configuration: Enabled, Not Socketed, Level 2
		Operational Mode: Write Back
		Location: Internal
		Installed Size: 512 KB
		Maximum Size: 1024 KB
		Supported SRAM Types:
			Synchronous
		Installed SRAM Type: Synchronous
		Speed: 40 ns
		Error Correction Type: Parity
		System Type: Unified
		Associativity: Other
Handle 0x0007
	DMI type 5, 20 bytes.
	Memory Controller Information
		Error Detecting Method: None
		Error Correcting Capabilities: None
		Supported Interleave: One-way Interleave
		Current Interleave: One-way Interleave
		Maximum Memory Module Size: 1024 MB
		Maximum Total Memory Size: 2048 MB
		Supported Speeds:
			Other
		Supported Memory Types:
			DIMM
			SDRAM
		Memory Module Voltage: 3.3 V
		Associated Memory Slots: 2
			0x0008
			0x0009
		Enabled Error Correcting Capabilities: None
Handle 0x0008
	DMI type 6, 12 bytes.
	Memory Module Information
		Socket Designation: DIMM1
		Bank Connections: 1 0
		Current Speed: Unknown
		Type: DIMM SDRAM
		Installed Size: 256 MB (Double-bank Connection)
		Enabled Size: 256 MB (Double-bank Connection)
		Error Status: OK
Handle 0x0009
	DMI type 6, 12 bytes.
	Memory Module Information
		Socket Designation: DIMM2
		Bank Connections: 3 2
		Current Speed: Unknown
		Type: DIMM SDRAM
		Installed Size: 256 MB (Double-bank Connection)
		Enabled Size: 256 MB (Double-bank Connection)
		Error Status: OK
Handle 0x000A
	DMI type 9, 13 bytes.
	System Slot Information
		Designation: PCI1
		Type: 32-bit PCI
		Current Usage: In Use
		Length: Long
		ID: 1
		Characteristics:
			3.3 V is provided
			Opening is shared
			PME signal is supported

Handle 0x0010
	DMI type 9, 13 bytes.
	System Slot Information
		Designation: AGP
		Type: 32-bit PCI
		Current Usage: In Use
		Length: Long
		ID: 4
		Characteristics:
			3.3 V is provided
			Opening is shared
			PME signal is supported
Handle 0x0011
	DMI type 9, 13 bytes.
	System Slot Information
		Designation: CNR
		Type: 32-bit PCI
		Current Usage: Available
		Length: Long
		ID: 5
		Characteristics:
			3.3 V is provided
			Opening is shared
			PME signal is supported
Handle 0x0013
	DMI type 8, 9 bytes.
	Port Connector Information
		Internal Reference Designator: USB
		Internal Connector Type: Mini Centronics
		External Reference Designator: Def
		External Connector Type: DB-25 male
		Port Type: SSA SCSI
Handle 0x0016
	DMI type 127, 4 bytes.
	End Of Table
Pokud nás zajímá například pouze výpis slotů (volných i plných) pro paměťové moduly, hodí se přepínač --type 6.

lshw

Ke zjištění HW lze použít i program lshw, popř. jeho grafickou variantu lshw-gtk:

# lshw -short
H/W path                  Device    Class       Description
===========================================================
                                    system      MS-6566E
/0                                  bus         MS-6566E
/0/0                                memory      BIOS
/0/4                                processor   Intel(R) Pentium(R) 4 CPU 1.80GHz
/0/4/5                              memory      L1 cache
/0/4/6                              memory      L2 cache
/0/1                                memory      System memory
/0/e0000000                         bridge      82845 845 (Brookdale) Chipset Host Bridge
/0/e0000000/1                       bridge      82845 845 (Brookdale) Chipset AGP Bridge
/0/e0000000/1/0           /dev/fb0  display     NV18 [GeForce4 MX 440SE AGP 8x]
/0/e0000000/1d                      bus         82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1
/0/e0000000/1d/1          usb2      bus         Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1
/0/e0000000/1d/1/1                  input       Type 6 Keyboard
/0/e0000000/1d/1/2        scsi2     printer     photosmart 7200 series
/0/e0000000/1d/1/2/0.0.0  /dev/sda  disk        photosmart 7200
/0/e0000000/1d.1                    bus         82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2
/0/e0000000/1d.1/1        usb3      bus         Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2
/0/e0000000/1d.7                    bus         82801DB/DBM (ICH4/ICH4-M) USB 2.0 EHCI Controller
/0/e0000000/1d.7/1        usb1      bus         Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller
/0/e0000000/1e                      bridge      82801 PCI Bridge
/0/e0000000/1e/0                    multimedia  ES1370 [AudioPCI]
/0/e0000000/1e/1          eth0      network     RTL-8139/8139C/8139C+
/0/e0000000/1e/2          eth1      network     RTL-8139/8139C/8139C+
/0/e0000000/1e/3          eth2      network     RTL-8139/8139C/8139C+
/0/e0000000/1e/4                    multimedia  Bt878 Video Capture
/0/e0000000/1e/4.1                  multimedia  Bt878 Audio Capture
/0/e0000000/1f                      bridge      82801DB/DBL (ICH4/ICH4-L) LPC Bridge
/0/e0000000/1f.1                    storage     82801DB/DBL (ICH4/ICH4-L) UltraATA-100 IDE Controller
/0/e0000000/1f.1/0        ide0      bus         IDE Channel 0
/0/e0000000/1f.1/0/0      /dev/hda  disk        ST3120026A
/0/e0000000/1f.1/0/1      /dev/hdb  disk        ST360021A
/0/e0000000/1f.1/1        ide1      bus         IDE Channel 1
/0/e0000000/1f.1/1/0      /dev/hdc  disk        CD-W540E
/0/e0000000/1f.1/1/1      /dev/hdd  disk        HL-DT-ST DVDRAM GSA-4160B
/0/e0000000/1f.3                    bus         82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller
/1                        bond0     network     Ethernet interface
/2                        dummy0    network     Ethernet interface

Bez přepínače -short získáme mnohem více informací.

kudzu

# kudzu -p
-

class: OTHER
bus: USB
detached: 0
driver: unknown
desc: "Linux 2.6.12.2 ehci_hcd Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller"
usbclass: 9
usbsubclass: 0
usbprotocol: 0
usbbus: 1
usblevel: 0
usbport: 0
usbdev: 1
vendorId: 0000
deviceId: 0000
usbmfr: Linux 2.6.12.2 ehci_hcd
usbprod: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller
-
class: OTHER
bus: USB
detached: 0
driver: unknown
desc: "Linux 2.6.12.2 uhci_hcd Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1"
usbclass: 9
usbsubclass: 0
usbprotocol: 0
usbbus: 2
usblevel: 0
usbport: 0
usbdev: 1
vendorId: 0000
deviceId: 0000
usbmfr: Linux 2.6.12.2 uhci_hcd
usbprod: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1
-
class: OTHER
bus: USB
detached: 0
driver: unknown
desc: "hp photosmart 7200 series"
usbclass: 0
usbsubclass: 0
usbprotocol: 0
usbbus: 2
usblevel: 1
usbport: 1
usbdev: 5
vendorId: 03f0
deviceId: b002
usbmfr: hp
usbprod: photosmart 7200 series
-
class: NETWORK
bus: PCI
detached: 0
device: eth0
driver: unknown
desc: "Unknown vendor|unknown device 10ec:8139"
network.hwaddr: XX:XX:XX:XX:XX:XX
vendorId: 10ec
deviceId: 8139
subVendorId: 10ec
subDeviceId: 8139
pciType: 1
pcidom:    0
pcibus:  3
pcidev:  1
pcifn:  0
-
class: MOUSE
bus: PSAUX
detached: 0
device: input/mice
driver: generic3ps/2
desc: "GenPS/2 Genius Wheel Mouse"
-
class: CDROM
bus: IDE
detached: 0
device: hdc
driver: ignore
desc: "CD-W540E"
-
class: CDROM
bus: IDE
detached: 0
device: hdd
driver: ignore
desc: "HL-DT-ST DVDRAM GSA-4160B"
-
class: VIDEO
bus: PCI
detached: 0
device: fb0
driver: unknown
desc: "Unknown vendor|unknown device 10de:0182"
vendorId: 10de
deviceId: 0182
subVendorId: 1462
subDeviceId: 8900
pciType: 1
pcidom:    0
pcibus:  1
pcidev:  0
pcifn:  0
-
class: HD
bus: IDE
detached: 0
device: hda
driver: ignore
desc: "ST3120026A"
physical: 4047/16/255
logical: 16383/255/63
-
class: KEYBOARD
bus: PSAUX
detached: 0
driver: ignore
desc: "AT Translated Set 2 keyboard"
-
class: KEYBOARD
bus: USB
detached: 0
driver: keybdev
desc: "Sun Microsystems, Inc. Type 6 Keyboard"
usbclass: 3
usbsubclass: 1
usbprotocol: 1
usbbus: 2
usblevel: 1
usbport: 0
usbdev: 4
vendorId: 0430
deviceId: 0005

Související dokumenty

prikaz LSPCI (Diskuse) (diskuse)
jak zjistit, co je na USB (Diskuse) (diskuse)
zjisteni souhrnych informaci o hardware (Diskuse) (diskuse)
Detekce a instalace karty VESA (diskuse)
intergraph ovladace (diskuse)
Cesta do hlubin kompilace jádra - hardware (článek)
Domácí stránky projektu DMIdecode (externí dokument)

Dokument vytvořil: Leoš Literák, 7.8.2005 13:28 | Poslední úprava: Jan Zahornadsky, 23.1.2010 16:46 | Další přispěvatelé: David Watzke, Leoš Literák | Historie změn | Zobrazeno: 32464×

Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.