Linux : Détecter son hardware en ligne de commande
Linux est un outil génial. Alors quand j’ai dû récupérer sur un PC le matériel, je me suis dit que ce serait intéressant de le récupérer via ligne de commande.
Donc voici les quelques lignes de commande qui m’ont permis de récupérer les informations à propos du matériel.
Les principaux outils utilisés sont :
Carte Mère
# dmidecode --string baseboard-product-name MSI X58 Pro-E (MS-7522)
Processeur
# dmidecode --string processor-manufacturer Intel # dmidecode --string processor-family Core i7 # dmidecode --string processor-frequency 3066 Mhz
Lecteur/Graveur CD/DVD
$ cdrecord -prcap wodim: Operation not permitted. Warning: Cannot raise RLIMIT_MEMLOCK limits. Device was not specified. Trying to find an appropriate drive... Dectect CD-R drive: /dev/sr0 Using /dev/cdrom of unknown capabilities Device type : Removable CD-ROM Version : 5 Response Format: 2 Capabilities : Vendor_info : 'HL-DT-ST' Identification : 'DVDRAM GH22NS50 ' Revision : 'TN03' Device seems to be: Generic mmc2 DVD-R/DVD-RW. Drive capabilities, per MMC-3 page 2A: Does read CD-R media Does write CD-R media Does read CD-RW media Does write CD-RW media Does read DVD-ROM media Does read DVD-R media Does write DVD-R media Does read DVD-RAM media Does write DVD-RAM media Does support test writing Does read Mode 2 Form 1 blocks Does read Mode 2 Form 2 blocks Does read digital audio blocks Does restart non-streamed digital audio reads accurately Does support Buffer-Underrun-Free recording Does read multi-session CDs Does read fixed-packet CD media using Method 2 Does not read CD bar code Does not read R-W subcode information Does read raw P-W subcode data from lead in Does return CD media catalog number Does return CD ISRC information Does support C2 error pointers Does not deliver composite A/V data Does play audio CDs Number of volume control levels: 256 Does support individual volume control setting for each channel Does support independent mute setting for each channel Does not support digital output on port 1 Does not support digital output on port 2 Loading mechanism type: tray Does support ejection of CD via START/STOP command Does not lock media on power up via prevent jumper Does allow media to be locked in the drive via PREVENT/ALLOW command Is not currently in a media-locked state Does not support changing side of disk Does not have load-empty-slot-in-changer feature Does not support Individual Disk Present feature Maximum read speed: 8467 kB/s (CD 48x, DVD 6x) Current read speed: 8467 kB/s (CD 48x, DVD 6x) Maximum write speed: 8468 kB/s (CD 48x, DVD 6x) Current write speed: 8468 kB/s (CD 48x, DVD 6x) Rotational control selected: CLV/PCAV Buffer size in KB: 2048 Copy management revision supported: 1 Number of supported write speeds: 11 Write speed # 0: 8468 kB/s CLV/PCAV (CD 48x, DVD 6x) Write speed # 1: 8467 kB/s CLV/PCAV (CD 48x, DVD 6x) Write speed # 2: 7057 kB/s CLV/PCAV (CD 40x, DVD 5x) Write speed # 3: 7056 kB/s CLV/PCAV (CD 40x, DVD 5x) Write speed # 4: 5646 kB/s CLV/PCAV (CD 32x, DVD 4x) Write speed # 5: 5645 kB/s CLV/PCAV (CD 32x, DVD 4x) Write speed # 6: 4235 kB/s CLV/PCAV (CD 24x, DVD 3x) Write speed # 7: 4234 kB/s CLV/PCAV (CD 24x, DVD 3x) Write speed # 8: 2822 kB/s CLV/PCAV (CD 16x, DVD 2x) Write speed # 9: 1411 kB/s CLV/PCAV (CD 8x, DVD 1x) Write speed # 10: 706 kB/s CLV/PCAV (CD 4x, DVD 0x) Supported CD-RW media types according to MMC-4 feature 0x37: Does write multi speed CD-RW media Does write high speed CD-RW media Does write ultra high speed CD-RW media Does write ultra high speed+ CD-RW media
Mémoire
# dmidecode -t memory # dmidecode 2.12 SMBIOS 2.5 present. Handle 0x0023, DMI type 16, 15 bytes Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: Multi-bit ECC Maximum Capacity: 192 GB Error Information Handle: Not Provided Number Of Devices: 5 Handle 0x0025, DMI type 17, 27 bytes Memory Device Array Handle: 0x0023 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 4096 MB Form Factor: DIMM Set: None Locator: DIMM0 Bank Locator: BANK0 Type: Other Type Detail: Other Speed: 1066 MHz Manufacturer: Manufacturer00 Serial Number: 00000000 Asset Tag: AssetTagNum0 Part Number: F3-10666CL9-4GBRL Handle 0x0027, DMI type 17, 27 bytes Memory Device Array Handle: 0x0023 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: DIMM Set: None Locator: DIMM1 Bank Locator: BANK1 Type: Other Type Detail: Other Speed: 1066 MHz Manufacturer: Manufacturer01 Serial Number: 00000000 Asset Tag: AssetTagNum1 Part Number: Handle 0x0029, DMI type 17, 27 bytes Memory Device Array Handle: 0x0023 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 4096 MB Form Factor: DIMM Set: None Locator: DIMM2 Bank Locator: BANK2 Type: Other Type Detail: Other Speed: 1066 MHz Manufacturer: Manufacturer02 Serial Number: 00000000 Asset Tag: AssetTagNum2 Part Number: F3-10666CL9-4GBRL Handle 0x002B, DMI type 17, 27 bytes Memory Device Array Handle: 0x0023 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: DIMM Set: None Locator: DIMM3 Bank Locator: BANK3 Type: Other Type Detail: Other Speed: 1066 MHz Manufacturer: Manufacturer03 Serial Number: 00000000 Asset Tag: AssetTagNum3 Part Number: Handle 0x002D, DMI type 17, 27 bytes Memory Device Array Handle: 0x0023 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: DIMM Set: None Locator: DIMM4 Bank Locator: BANK4 Type: Other Type Detail: Other Speed: 1066 MHz Manufacturer: Manufacturer04 Serial Number: 00000000 Asset Tag: AssetTagNum4 Part Number: Handle 0x002F, DMI type 16, 15 bytes Physical Memory Array Location: System Board Or Motherboard Use: Flash Memory Error Correction Type: None Maximum Capacity: 4 MB Error Information Handle: Not Provided Number Of Devices: 1 Handle 0x0031, DMI type 17, 27 bytes Memory Device Array Handle: 0x002F Error Information Handle: Not Provided Total Width: 8 bits Data Width: 8 bits Size: 4096 kB Form Factor: Other Set: None Locator: Bank Locator: Type: Flash Type Detail: Non-Volatile Speed: 33 MHz Manufacturer: MXIC Serial Number: Asset Tag: Part Number: 25L3205
Carte Vidéo
# lshw -c display *-display description: VGA compatible controller product: Barts XT [Radeon HD 6870] vendor: Advanced Micro Devices, Inc. [AMD/ATI] physical id: 0 bus info: pci@0000:02:00.0 version: 00 width: 64 bits clock: 33MHz capabilities: pm pciexpress msi vga_controller bus_master cap_list rom configuration: driver=radeon latency=0 resources: irq:29 memory:d0000000-dfffffff memory:fbbe0000-fbbfffff ioport:c000(size=256) memory:fbbc0000-fbbdffff
Carte Réseau
# lshw -c network *-network description: Ethernet interface product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller vendor: Realtek Semiconductor Co., Ltd. physical id: 0 bus info: pci@0000:06:00.0 logical name: p36p1 version: 02 serial: 6c:62:6d:95:80:a6 size: 1Gbit/s capacity: 1Gbit/s width: 64 bits clock: 33MHz capabilities: pm msi pciexpress msix vpd bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full ip=192.168.1.11 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s resources: irq:28 ioport:e800(size=256) memory:fbdff000-fbdfffff memory:faff0000-faffffff memory:fbdc0000-fbddffff *-network DISABLED description: Ethernet interface physical id: 1 logical name: virbr0-nic serial: 52:54:00:01:8b:6d size: 10Mbit/s capabilities: ethernet physical configuration: autonegotiation=off broadcast=yes driver=tun driverversion=1.6 duplex=full link=no multicast=yes port=twisted pair speed=10Mbit/s
Disque dur
# lshw -c disk *-cdrom description: DVD-RAM writer product: DVDRAM GH22NS50 vendor: HL-DT-ST physical id: 0.0.0 bus info: scsi@2:0.0.0 logical name: /dev/cdrom logical name: /dev/sr0 version: TN03 capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram configuration: ansiversion=5 status=nodisc *-disk description: ATA Disk product: ST31000524AS vendor: Seagate physical id: 0.0.0 bus info: scsi@4:0.0.0 logical name: /dev/sda version: JC45 serial: 9VPBSWPG size: 931GiB (1TB) capabilities: partitioned partitioned:dos configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 signature=000a7935
Commentaires
juste une petite erreur
dernière commande identique à la précédente
peut-être plutot : lshw -c disk (ou un truc dans le genre)
Disque dur
# lshw -c network
???
Une commande bien pratique aussipour avoir des infos utiles et présentées de façon assez lisible: inxi
Pour avoir « tout »: inxi -F
Voir ses nombreuses options.
Très intéressant. Par contre, n’y aurait-il pas une erreur au niveau des disques avec lshw -c disk (disk au lieu de network) ?
Sinon, bizarrement, la commande dmidecode –string processor-family me renvoie Core 2 Duo alors que j’ai Intel i7 2700k. Je m’attendais à lire Core i7. Bizarre, bizarre ?!?
Je pense qu’il y a une petite erreur dans la ligne de commande pour les disques durs.
Merci pour l’article.
Je pense qu’il y a une erreur pour la dernière partie : Disque dur.
Ce n’est pas lshw -c network mais lshw -c disk
Pour le disque dur il y a une coquile, ce n’est pas ls -c network mais ls -c storage (ou ls -c disk) d’après le man.
Pour le Disque dur c’est « lshw -c disk » au lieu de « lshw -c network ».
Merci pour l’article.
Salut,
une petite coquille s’est glissée : pour le disque dur c’est « lshw -c disk » 🙂
@SpF : Corrigé
@JL : Corrigé
@Marco : Corrigé
@jdrien : Corrigé
@yabb85 : Corrigé
@Teutates : Corrigé pour le disque dur
@Joël : Corrigé
@Jean-Yves : Corrigé
apt-get install inxi
Ajouter un commentaire