Linux 查看系统硬件信息

CPU
lscpu,查看的是cpu的统计信息

[root@node9 ~]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                24
On-line CPU(s) list:   0-23
Thread(s) per core:    2
Core(s) per socket:    6
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 62
Stepping:              4
CPU MHz:               1201.101
BogoMIPS:              4205.99
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              15360K
NUMA node0 CPU(s):     0-5,12-17
NUMA node1 CPU(s):     6-11,18-23

查看/proc/cpuinfo,可以知道每个cpu信息,如每个CPU的型号,主频等。截取的是我在实验室里使用的一台存储,有24个CPU,信息较多,只截取了一部分。

[root@node9 ~]# cat /proc/cpuinfo 
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 62
model name  : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz
stepping    : 4
microcode   : 0x416
cpu MHz     : 1250.484
cache size  : 15360 KB
physical id : 0
siblings    : 12
core id     : 0
cpu cores   : 6
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb pln pts dtherm kaiser tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt
bugs        :
bogomips    : 4200.32
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

......

processor   : 23
vendor_id   : GenuineIntel
cpu family  : 6
model       : 62
model name  : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz
stepping    : 4
microcode   : 0x416
cpu MHz     : 1227.433
cache size  : 15360 KB
physical id : 1
siblings    : 12
core id     : 5
cpu cores   : 6
apicid      : 43
initial apicid  : 43
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb pln pts dtherm kaiser tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt
bugs        :
bogomips    : 4205.99
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

内存
概要查看内存情况 free -m,-m表示单位是MB

[root@node9 ~]# free -m
             total       used       free     shared    buffers     cached
Mem:         32204       2446      29758          0        218       1344
-/+ buffers/cache:        882      31321
Swap:        20479          0      20479

查看内存详细使用
cat /proc/meminfo

[root@node9 ~]# cat /proc/meminfo 
MemTotal:       32977764 kB
MemFree:        30450068 kB
MemAvailable:   31949684 kB
Buffers:          224268 kB
Cached:          1398976 kB
SwapCached:            0 kB
Active:           884356 kB
Inactive:         920764 kB
Active(anon):     191680 kB
Inactive(anon):     2752 kB
Active(file):     692676 kB
Inactive(file):   918012 kB
Unevictable:       46100 kB
Mlocked:           46088 kB
SwapTotal:      20971516 kB
SwapFree:       20971516 kB
Dirty:                24 kB
Writeback:             0 kB
AnonPages:        228056 kB
Mapped:           106136 kB
Shmem:              2988 kB
Slab:             288652 kB
SReclaimable:     226776 kB
SUnreclaim:        61876 kB
KernelStack:        9104 kB
PageTables:        28872 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    37460396 kB
Committed_AS:     645384 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
HardwareCorrupted:     0 kB
AnonHugePages:     86016 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       34216 kB
DirectMap2M:     2029568 kB
DirectMap1G:    33554432 kB

查看内存硬件信息
dmidecode -t memory

[root@node9 ~]# dmidecode -t memory
# dmidecode 2.11
SMBIOS 2.7 present.

Handle 0x002D, DMI type 16, 23 bytes
Physical Memory Array
    Location: System Board Or Motherboard
    Use: System Memory
    Error Correction Type: Multi-bit ECC
    Maximum Capacity: 96 GB
    Error Information Handle: Not Provided
    Number Of Devices: 8

Handle 0x002F, DMI type 17, 34 bytes
Memory Device
    Array Handle: 0x002D
    Error Information Handle: Not Provided
    Total Width: 72 bits
    Data Width: 64 bits
    Size: 8192 MB
    Form Factor: DIMM
    Set: None
    Locator: P1_DIMMA1
    Bank Locator: Node0_Bank0
    Type: DDR3
    Type Detail: Registered (Buffered)
    Speed: 1333 MHz
    Manufacturer: Samsung           
    Serial Number: 37AFFC8F    
    Asset Tag: Dimm0_AssetTag
    Part Number: M393B1G70QH0-
    Rank: 1
    Configured Clock Speed: 1333 MHz

......

Handle 0x004F, DMI type 17, 34 bytes
Memory Device
    Array Handle: 0x003F
    Error Information Handle: Not Provided
    Total Width: 72 bits
    Data Width: 64 bits
    Size: No Module Installed
    Form Factor: DIMM
    Set: None
    Locator: P2_DIMMH2
    Bank Locator: Node1_Bank0
    Type: Unknown
    Type Detail: Synchronous
    Speed: Unknown
    Manufacturer: Dimm7_Manufacturer
    Serial Number: Dimm7_SerNum
    Asset Tag: Dimm7_AssetTag
    Part Number: Dimm7_PartNum
    Rank: Unknown
    Configured Clock Speed: Unknown

磁盘
lsblk——查看硬盘和分区分布

[root@node9 ~]# lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 278.5G  0 disk 
├─sda1   8:1    0   200M  0 part /boot
├─sda2   8:2    0    20G  0 part [SWAP]
└─sda3   8:3    0 258.3G  0 part /
sdb      8:16   0   1.9T  0 disk 
sdc      8:32   0   4.1T  0 disk 

fdisk -l 查看硬盘和分区的详细信息

[root@node9 ~]# fdisk -l

Disk /dev/sdb: 2096.1 GB, 2096078258176 bytes
255 heads, 63 sectors/track, 254833 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00064816

   Device Boot      Start         End      Blocks   Id  System

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdc: 4491.6 GB, 4491596267520 bytes
255 heads, 63 sectors/track, 546072 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1      267350  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sda: 299.0 GB, 298999349248 bytes
255 heads, 63 sectors/track, 36351 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00088001

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26        2637    20971520   82  Linux swap / Solaris
/dev/sda3            2637       36352   270814208   83  Linux

网卡
查看配置文件名中包含’eth’的网卡硬件信息
lspci | grep -i ‘eth’

[root@node9 ~]# lspci | grep -i 'eth'
04:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
04:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)

查看系统的所有网络接口 ifconfig -a

[root@node9 ~]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:25:90:EA:13:08  
          inet addr:192.168.12.29  Bcast:192.168.12.255  Mask:255.255.255.0
          inet6 addr: fe80::225:90ff:feea:1308/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8203 errors:0 dropped:0 overruns:0 frame:0
          TX packets:175 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:525386 (513.0 KiB)  TX bytes:21544 (21.0 KiB)
          Memory:dfd20000-dfd3ffff 

eth1      Link encap:Ethernet  HWaddr 00:25:90:EA:13:09  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Memory:dfd00000-dfd1ffff 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:240 (240.0 b)  TX bytes:240 (240.0 b)

查看某个网络接口的详细信息,例如eth0的详细参数和指标
ethtool eth0

[root@node9 ~]# ethtool eth0
Settings for eth0:
    Supported ports: [ TP ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full      #支持千兆半双工,全双工模式
    Supported pause frame use: Symmetric
    Supports auto-negotiation: Yes     #支持自适应模式,一般都支持
    Advertised link modes:  10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full 
    Advertised pause frame use: Symmetric
    Advertised auto-negotiation: Yes       #网卡使用自适应模式
    Speed: 1000Mb/s           #现在网卡的速度是1000Mb
    Duplex: Full            #全双工
    Port: Twisted Pair
    PHYAD: 1
    Transceiver: internal
    Auto-negotiation: on
    MDI-X: on
    Supports Wake-on: pumbg
    Wake-on: g
    Current message level: 0x00000007 (7)
                   drv probe link
    Link detected: yes       #表示有网络连接

其他
lspci,查看pci信息,即主板所有硬件槽信息。

[root@node9 ~]# lspci
00:00.0 Host bridge: Intel Corporation Xeon E5 v2/Core i7 DMI2 (rev 04)
00:01.0 PCI bridge: Intel Corporation Xeon E5 v2/Core i7 PCI Express Root Port 1a (rev 04)
00:01.1 PCI bridge: Intel Corporation Xeon E5 v2/Core i7 PCI Express Root Port 1b (rev 04)
00:02.0 PCI bridge: Intel Corporation Xeon E5 v2/Core i7 PCI Express Root Port 2a (rev 04)
00:03.0 PCI bridge: Intel Corporation Xeon E5 v2/Core i7 PCI Express Root Port 3a (rev 04)
00:03.2 PCI bridge: Intel Corporation Xeon E5 v2/Core i7 PCI Express Root Port 3c (rev 04)
00:04.0 System peripheral: Intel Corporation Xeon E5 v2/Core i7 Crystal Beach DMA Channel 0 (rev 04)
00:04.1 System peripheral: Intel Corporation Xeon E5 v2/Core i7 Crystal Beach DMA Channel 1 (rev 04)
#信息较多,以下省略
......

查看bios信息
dmidecode -t bios

[root@node9 ~]# dmidecode -t bios
# dmidecode 2.11
SMBIOS 2.7 present.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
    Vendor: American Megatrends Inc.
    Version: 3.0a
    Release Date: 10/10/2013
    Address: 0xF0000
    Runtime Size: 64 kB
    ROM Size: 8192 kB
    Characteristics:
        PCI is supported
        BIOS is upgradeable
        BIOS shadowing is allowed
        Boot from CD is supported
        Selectable boot is supported
        BIOS ROM is socketed
        EDD is supported
......

查看所有硬件信息

dmidecode -q

猜你喜欢

转载自blog.csdn.net/u012393192/article/details/79057284