linux查看硬件运行状态,Linux查看硬件信息命令

一、查看服务器硬件信息

(1)查看服务器型号、序列号

[root@Master ~]# dmidecode|grep "System Information"

-A9|egrep "Manufacturer|Product|Serial"

a4c26d1e5885305701be709a3d33442f.png

(2)查看主板型号

[root@Master ~]# dmidecode |grep -A16 "System

Information$"

a4c26d1e5885305701be709a3d33442f.png

(3)查看BIOS信息

a4c26d1e5885305701be709a3d33442f.png

[root@Master ~]# dmidecode -t bios

# dmidecode2.12SMBIOS2.8present.

Handle0x0008, DMI type 0, 24bytes

BIOS Information

Vendor: HP

Version: U19

Release Date:12/27/2015Address:0xF0000Runtime Size:64kB

ROM Size:16384kB

Characteristics:

PCI is supported

PNP is supported

BIOS is upgradeable

BIOS shadowing is allowed

ESCD support is available

Boot from CD is supported

Selectable boot is supported

EDD is supported5.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)

Print screen service is supported (int5h)8042 keyboard services are supported (int9h)

Serial services are supported (int14h)

Printer services are supported (int17h)

CGA/mono video services are supported (int10h)

ACPI is supported

USB legacy is supported

BIOS boot specification is supported

Function key-initiated network boot is supported

Targeted content distribution is supported

UEFI is supported

BIOS Revision:2.0Firmware Revision:2.40

a4c26d1e5885305701be709a3d33442f.png

(3)查看内存槽及内存条

a4c26d1e5885305701be709a3d33442f.png

[root@Master ~]# dmidecode -t memory | head -45 | tail -23Memory Device

Array Handle:0x000AError Information Handle: Not Provided

Total Width:72bits

Data Width:64bits

Size:16384MB

Form Factor: DIMM

Set: None

Locator: PROC1 DIMM 1Bank Locator: Not Specified

Type: DDR4

Type Detail: Synchronous Registered (Buffered)

Speed:2133MHz

Manufacturer: HP

Serial Number: Not Specified

Asset Tag: Not Specified

Part Number:752369-081Rank:2Configured Clock Speed:2133MHz

Minimum Voltage:1.2V

Maximum Voltage:1.2V

Configured Voltage:1.2V

[root@Master~]#

a4c26d1e5885305701be709a3d33442f.png

(4)查看网卡信息

a4c26d1e5885305701be709a3d33442f.png

[root@Master ~]# dmesg | grep -i Ethernet

igb: Intel(R) Gigabit Ethernet Network Driver- version 5.3.0-k

igb0000:04:00.0: Intel(R) Gigabit Ethernet Network Connection

igb0000:04:00.1: Intel(R) Gigabit Ethernet Network Connection

igb0000:04:00.2: Intel(R) Gigabit Ethernet Network Connection

igb0000:04:00.3: Intel(R) Gigabit Ethernet Network Connection

igb0000:02:00.0: Intel(R) Gigabit Ethernet Network Connection

igb0000:02:00.1: Intel(R) Gigabit Ethernet Network Connection

a4c26d1e5885305701be709a3d33442f.png

(5) 查看pci信息,即主板所有硬件槽信息

a4c26d1e5885305701be709a3d33442f.png

[root@Master ~]# lspci | head -10

00:00.0 Host bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 DMI2 (rev 02)00:01.0 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 1 (rev 02)00:01.1 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 1 (rev 02)00:02.0 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 2 (rev 02)00:02.1 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 2 (rev 02)00:02.2 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 2 (rev 02)00:02.3 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 2 (rev 02)00:03.0 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3 (rev 02)00:03.1 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3 (rev 02)00:03.2 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3 (rev 02)

a4c26d1e5885305701be709a3d33442f.png

二、查看CPU信息

(1)查看cpu型号

[root@Master ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c40 Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz

(2)查看系统中实际物理CPU的数量(物理)

[root@Master ~]# grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l2

(3)系统中实际物理CPU的数量(核数)

[root@Master ~]# cat /proc/cpuinfo |grep 'processor'|wc -l40

(4)查看每个物理CPU中core的个数(即核数)

[root@Master ~]# cat /proc/cpuinfo |grep "cores"|uniqcpu cores :10

(5)查看CPU的主频

[root@Master ~]# cat /proc/cpuinfo |grep MHz|uniqcpu MHz :1200.000cpu MHz :2300.000cpu MHz :1200.000

(6)查看CPU的详细信息

a4c26d1e5885305701be709a3d33442f.png

[root@Master ~]# cat /proc/cpuinfo | head -20processor :0 //逻辑处理器的IDvendor_id : GenuineIntel

cpu family :6model :63model name : Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz //CPU型号

stepping :2microcode :54cpu MHz :1200.000cache size :25600KB

physicalid : 0siblings :20 //相同物理封装处理器中逻辑处理器数coreid : 0cpu cores :10 //相同物理封装处理器中的内核数apicid :0initial apicid :0fpu : yes

fpu_exception : yes

cpuid level :15wp : 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 xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm cqm_llc cqm_occup_llc

a4c26d1e5885305701be709a3d33442f.png

(7)查看CPU的相关信息

a4c26d1e5885305701be709a3d33442f.png

[root@Master ~]# lscpu

Architecture: x86_64

CPU op-mode(s): 32-bit, 64-bit

Byte Order: Little Endian

CPU(s):40On-line CPU(s) list: 0-39Thread(s) per core:2Core(s) per socket:10Socket(s):2NUMA node(s):2Vendor ID: GenuineIntel

CPU family:6Model:63Model name: Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz

Stepping:2CPU MHz:1200.000BogoMIPS:4594.43Virtualization: VT-x

L1d cache: 32K

L1i cache: 32K

L2 cache: 256K

L3 cache: 25600K

NUMA node0 CPU(s):0-9,20-29NUMA node1 CPU(s):10-19,30-39[root@Master~]#

a4c26d1e5885305701be709a3d33442f.png

(8)查看cpu运行模式

[root@Master ~]# getconf LONG_BIT64

(9)查看cpu是否支持64bit

[root@Master ~]# cat /proc/cpuinfo | grep flags | grep 'lm' | wc -l40(结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit)

三、查看内存信息(1)查看内存硬件信息

a4c26d1e5885305701be709a3d33442f.png

root@Master ~]# dmidecode -t memory | head -45 | tail -24Handle0x000C, DMI type 17, 40bytes

Memory Device

Array Handle:0x000AError Information Handle: Not Provided

Total Width:72bits

Data Width:64bits

Size:16384MB

Form Factor: DIMM

Set: None

Locator: PROC1 DIMM 1Bank Locator: Not Specified

Type: DDR4

Type Detail: Synchronous Registered (Buffered)

Speed:2133MHz

Manufacturer: HP

Serial Number: Not Specified

Asset Tag: Not Specified

Part Number:752369-081Rank:2Configured Clock Speed:2133MHz

Minimum Voltage:1.2V

Maximum Voltage:1.2V

Configured Voltage:1.2 V

a4c26d1e5885305701be709a3d33442f.png

(2)最大支持多少内存

[root@Master ~]# dmidecode|grep -P 'Maximum\s+Capacity'

a4c26d1e5885305701be709a3d33442f.png

(3)Linux

查看内存的插槽数,已经使用多少插槽.每条内存多大:

a4c26d1e5885305701be709a3d33442f.png

(4)Linux

查看内存的频率:[root@Master

~]# dmidecode|grep -A16 "Memory Device"|grep 'Speed'

a4c26d1e5885305701be709a3d33442f.png

(5)Linux

查看内存的详细信息:

a4c26d1e5885305701be709a3d33442f.png

[root@Master ~]# cat /proc/meminfo |head -20MemTotal:131897620kB

MemFree:414124kB

Buffers:1040560kB

Cached:111083180kB

SwapCached:1320kB

Active:7637912kB

Inactive:110607108kB

Active(anon):4406900kB

Inactive(anon):1714900kB

Active(file): 3231012kB

Inactive(file): 108892208kB

Unevictable:10878976kB

Mlocked:5521652kB

SwapTotal:16777212kB

SwapFree:16737536kB

Dirty:180kB

Writeback:0kB

AnonPages:16999324kB

Mapped:149020kB

Shmem:172 kB

a4c26d1e5885305701be709a3d33442f.png

(6)Linux

查看内存的使用情况

[root@Master ~]# free -m // -b,-k,-m,-g show output in bytes, KB, MB, or GB

total usedfreeshared buffers cached

Mem:128806 123407 5398 0 1015 103474

-/+ buffers/cache: 18918 109888Swap:16383 38 16345

四、查看硬盘信息(1)查看挂接的分区状态

[root@Master ~]# fdisk -l |grep Disk

a4c26d1e5885305701be709a3d33442f.png

(2)查看硬盘和分区分布

a4c26d1e5885305701be709a3d33442f.png

[root@Master ~]# lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

sda8:0 0 279.4G 0disk

├─sda18:1 0 50M 0 part /boot

├─sda28:2 0 100G 0 part /├─sda38:3 0 50G 0 part /home

├─sda48:4 0 1K 0part

├─sda58:5 0 16G 0part [SWAP]

├─sda68:6 0 13.3G 0 part /tmp

└─sda78:7 0 100G 0 part /usr

sdb8:16 0 83.7T 0disk

└─sdb18:17 0 83.7T 0 part /PureDisk

a4c26d1e5885305701be709a3d33442f.png

(3)查看硬盘和分区的详细信息

a4c26d1e5885305701be709a3d33442f.png

[root@Master ~]# fdisk -l

Disk/dev/sda: 300.0 GB, 299966445568bytes255 heads, 63 sectors/track, 36468cylinders

Units= cylinders of 16065 * 512 = 8225280bytes

Sector size (logical/physical): 512 bytes / 512bytes

I/O size (minimum/optimal): 262144 bytes / 262144bytes

Disk identifier:0x000384d9Device Boot Start End Blocks Id System/dev/sda1 * 1 7 51200 83Linux

Partition1does not end on cylinder boundary./dev/sda2 7 13061 104857600 83Linux/dev/sda3 13061 19588 52428800 83Linux/dev/sda4 19588 36469 135597056 5Extended/dev/sda5 19588 21677 16777216 82 Linux swap /Solaris/dev/sda6 21677 23415 13962240 83Linux/dev/sda7 23416 36469 104854528 83Linux

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

Disk/dev/sdb: 92017.3 GB, 92017310654464bytes255 heads, 63 sectors/track, 11187134cylinders

Units= cylinders of 16065 * 512 = 8225280bytes

Sector size (logical/physical): 512 bytes / 512bytes

I/O size (minimum/optimal): 262144 bytes / 6029312bytes

Disk identifier:0x00000000Device Boot Start End Blocks Id System/dev/sdb1 1 267350 2147483647+ee GPT

Partition1 does not start on physical sector boundary.

a4c26d1e5885305701be709a3d33442f.png

(4)查看挂接的分区状态

a4c26d1e5885305701be709a3d33442f.png

[root@Master ~]# mount | column -t/dev/sda2 on /type ext4 (rw)

proc on/proc type proc (rw)

sysfs on/sys type sysfs (rw)

devpts on/dev/pts type devpts (rw,gid=5,mode=620)

tmpfs on/dev/shm type tmpfs (rw)/dev/sda1 on /boot type ext4 (rw)/dev/sda3 on /home type ext4 (rw)/dev/sda6 on /tmp type ext4 (rw)/dev/sda7 on /usr type ext4 (rw)/dev/sdb1 on /PureDisk type ext4 (rw)

none on/proc/sys/fs/binfmt_misc type binfmt_misc (rw

a4c26d1e5885305701be709a3d33442f.png

(5)查看挂接的分区状态

[root@Master ~]# swapon -s

Filename Type Size Used Priority/dev/sda5 partition 16777212 39676 -1

(6)查看硬盘使用情况

a4c26d1e5885305701be709a3d33442f.png

[root@Master ~]# df -hT

Filesystem Type Size Used Avail Use%Mounted on/dev/sda2 ext4 99G 561M 93G 1% /tmpfs tmpfs 63G 76K 63G1% /dev/shm/dev/sda1 ext4 45M 38M 4.9M 89% /boot/dev/sda3 ext4 50G 52M 47G 1% /home/dev/sda6 ext4 13G 34M 13G 1% /tmp/dev/sda7 ext4 99G 21G 73G 23% /usr/dev/sdb1 ext4 84T 41T 40T 51% /PureDisk

a4c26d1e5885305701be709a3d33442f.png

(7) 硬盘检测命令smartctl

a4c26d1e5885305701be709a3d33442f.png

[root@Master ~]# smartctl -a /dev/sda

smartctl5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-642.el6.x86_64] (local build)

Copyright (C)2002-12 by Bruce Allen, http://smartmontools.sourceforge.net

Vendor: HP

Product: LOGICAL VOLUME

Revision:3.56User Capacity:299,966,445,568 bytes [299GB]

Logical block size:512bytes

Logical Unitid: 0x600508b1001cc8a1b9ec4dacc5ab35dcSerial number: PDNNK0BRH9U0AG

Device type: disk

Local Time is: Mon Feb5 13:13:33 2018CST

Device supports SMART and is Enabled

Temperature Warning Disabled or Not Supported

SMART Health Status: OK

Error Counter logging not supported

Device does not support Self Test logging

a4c26d1e5885305701be709a3d33442f.png

五、查看网卡信息

(1)查看网卡硬件信息

[root@Master ~]# lspci | grep -i 'eth'

a4c26d1e5885305701be709a3d33442f.png

(2)查看系统的所有网络接口

[root@Master ~]# ifconfig -a

[root@Master~]# ip link show

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

a4c26d1e5885305701be709a3d33442f.png

[root@Master ~]# ethtool eth0

Settingsforeth0:

Supported ports: [ FIBRE ]

Supported link modes: 10000baseT/Full

Supported pause frame use: No

Supports auto-negotiation: No

Advertised link modes: 10000baseT/Full

Advertised pause frame use: No

Advertised auto-negotiation: No

Speed: 10000Mb/s

Duplex: Full

Port: FIBRE

PHYAD:0Transceiver: external

Auto-negotiation: off

Supports Wake-on: d

Wake-on: d

Current message level:0x00000007 (7)

drv probe link

Link detected: yes

a4c26d1e5885305701be709a3d33442f.png

(4)查看所有网卡的链路状态

a4c26d1e5885305701be709a3d33442f.png

[root@Master ~]# for i in `seq 0 9`;do ethtool eth${i} | egrep 'eth|Link';doneSettingsforeth0:

Link detected: yes

Settingsforeth1:

Link detected: yes

Settingsforeth2:

Link detected: no

Settingsforeth3:

Link detected: no

Settingsforeth4:

Link detected: no

Settingsforeth5:

Link detected: no

Settingsforeth6:

Link detected: no

Settingsforeth7:

Link detected: no

Settingsforeth8:

Link detected: no

Settingsforeth9:

Link detected: no

a4c26d1e5885305701be709a3d33442f.png

六、列出所有PCI设备信息

a4c26d1e5885305701be709a3d33442f.png

[root@Master ~]# lspci -tv | more

-+-[0000:ff]-+-08.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 QPI Link 0

| +-08.3 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 QPI Link 0

| +-09.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 QPI Link 1

| +-09.3 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 QPI Link 1

| +-0b.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 R3 QPI Link 0 & 1Monitoring| +-0b.1 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 R3 QPI Link 0 & 1Monitoring| +-0b.2 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 R3 QPI Link 0 & 1Monitoring| +-0c.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers| +-0c.1 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers| +-0c.2 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers| +-0c.3 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers| +-0c.4 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers| +-0c.5 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers| +-0c.6 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers| +-0c.7 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers| +-0d.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers| +-0d.1 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers| +-0f.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Buffered Ring Agent| +-0f.1 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Buffered Ring Agent| +-0f.2 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Buffered Ring Agent| +-0f.3 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Buffered Ring Agent

a4c26d1e5885305701be709a3d33442f.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值