Linux基本

デバイス情報の参照方法をまとめる.

モジュール関連

[lsmod] カーネル・モジュール(デバイスドライバ)の表示

$ sudo lsmod
Module                  Size  Used by
nfsd                  204209  17 
exportfs                9665  1 nfsd
lockd                  63081  2 nfsd
nfs_acl                 7617  1 nfsd
auth_rpcgss            43105  1 nfsd
sunrpc                145405  14 nfsd,lockd,nfs_acl,auth_rpcgss
coretemp               12288  0 
dm_multipath           24909  0 
scsi_dh                11713  1 dm_multipath
video                  21193  0 


[/etc/modprobe.conf] モジュールロード時の追加情報

$ cat /etc/modprobe.conf
alias eth0 tg3
alias scsi_hostadapter ahci
alias snd-card-0 snd-hda-intel
options snd-card-0 index=0
options snd-hda-intel index=0
remove snd-hda-intel { /usr/sbin/alsactl store 0 >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-hda-intel
alias net-pf-10 off
alias ipv6 off



デバイス関連

[/proc/scsi/scsi] SCSIデバイスの状態表示

# cat /proc/scsi/scsi 
Attached devices:
Host: scsi4 Channel: 00 Id: 00 Lun: 00
  Vendor: HL-DT-ST Model: DVD-ROM GDRH20N  Rev: 0P04
  Type:   CD-ROM                           ANSI SCSI revision: 05
Host: scsi5 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: Hitachi HDP72505 Rev: GM4O
  Type:   Direct-Access                    ANSI SCSI revision: 05


[lspci] PCIデバイスの状態表示

$ sudo lspci
00:00.0 Host bridge: Intel Corporation 4 Series Chipset DRAM Controller (rev 03)
00:02.0 VGA compatible controller: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03)
00:1a.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #4
00:1a.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #2
00:1b.0 Audio device: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller
00:1c.0 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 1
00:1c.1 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 2
00:1d.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1
00:1d.1 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2
00:1d.2 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #3
00:1d.3 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #6
00:1d.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #1
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 90)
00:1f.0 ISA bridge: Intel Corporation 82801JIR (ICH10R) LPC Interface Controller
00:1f.2 RAID bus controller: Intel Corporation 82801 SATA RAID Controller
00:1f.3 SMBus: Intel Corporation 82801JI (ICH10 Family) SMBus Controller
02:00.0 Ethernet controller: Broadcom Corporation NetLink BCM5784M Gigabit Ethernet


[/proc/ioports] ネットワークドライバの状態

$ cat /proc/ioports | grep -E 'e1000|r816'
  c040-c07f : e1000

※dmesgから見る

$ dmesg  | grep -E 'eth|bond'


[lsusb] USBデバイスの状態

$ sudo lsusb
Bus 002 Device 001: ID 0000:0000  
Bus 001 Device 001: ID 0000:0000  
Bus 007 Device 001: ID 0000:0000  
Bus 006 Device 001: ID 0000:0000  
Bus 003 Device 001: ID 0000:0000  
Bus 004 Device 001: ID 0000:0000  
Bus 005 Device 001: ID 0000:0000  


[/proc/interrupts] CPU割り込み回数を表示

$ cat /proc/interrupts 
           CPU0       
  0:  705629247    IO-APIC-edge  timer
  1:          2    IO-APIC-edge  i8042
  8:          3    IO-APIC-edge  rtc
  9:          0   IO-APIC-level  acpi
 12:          4    IO-APIC-edge  i8042
 50:        185   IO-APIC-level  HDA Intel
 58:     230164         PCI-MSI  eth0
177:          0   IO-APIC-level  uhci_hcd:usb3, uhci_hcd:usb7
209:          0   IO-APIC-level  ehci_hcd:usb1, uhci_hcd:usb6
217:          0   IO-APIC-level  ehci_hcd:usb2, uhci_hcd:usb4
225:          0   IO-APIC-level  uhci_hcd:usb5
233:    1589268         PCI-MSI  ahci
NMI:          0 
LOC:  691328748 
ERR:          0
MIS:          0


[/proc/cpuinfo] CPU情報

$ cat /proc/cpuinfo 
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 22
model name	: Intel(R) Celeron(R) CPU          440  @ 2.00GHz
stepping	: 1
cpu MHz		: 1995.122
cache size	: 512 KB
fdiv_bug	: no
hlt_bug		: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 10
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss tm pbe nx lm constant_tsc up pni monitor ds_cpl tm2 cx16 xtpr lahf_lm
bogomips	: 3990.24


[/proc/meminfo] メモリ情報

$ cat /proc/meminfo 
MemTotal:      1000152 kB
MemFree:         17524 kB
Buffers:         87464 kB
Cached:         673836 kB
SwapCached:       1840 kB
  〜略〜