查询硬件信息 硬件关系图谱 Windows linux 查看cpu信息 free dmidecode命令(硬件) 所有参数 bios system baseboard(主板) chassis() processor(处理器) 网卡 lspci 硬件关系图谱 Windows 1 、查询磁盘序列号:wmic diskdrive get serialnumber2 、查询BIOS序列号:wmic bios get serialnumber3 、查询网卡信息:wmic nicconfig get macaddress 或者 ipconfig/all 第一个就是4 、查询cpu的ID:wmic cpu get processorid5 、查询主板序列号:wmic baseboard get serialnumber硬件类型 命令 关键信息 示例输出 磁盘序列号 wmic diskdrive get serialnumber物理磁盘唯一标识 S2K7NX0H123456BIOS信息 wmic bios get serialnumberBIOS固件标识 L2HF0860DX6网卡地址 wmic nicconfig get macaddressMAC地址 54:05:db:05:45:adCPU标识 wmic cpu get processoridCPU唯一ID BFEBFBFF000806EC主板序列号 wmic baseboard get serialnumber主板物理标识 L1HF0860DX6
linux 查看cpu信息 1 .查询服务器型号 dmidecode| grep "System Information" -A9| egrep "Manufacturer|Product" 2 .查看操作系统cat /etc/redhat-release3 .查看cpu型号[ root@x86-15 ~] # cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 4 .查看cpu个数cat /proc/cpuinfo| grep "physical id" | sort | uniq | wc -l 5 .查看每个物理CPU中core的个数( 即核数) cat /proc/cpuinfo| grep "cpu cores" | uniq 6 .查看操作系统位数[ root@openstack ~] # getconf LONG_BIT 64 查询内容 命令 关键参数 解释说明 整体信息 lscpuArchitecture, Model name, CPU(s) CPU架构与核心数 型号详情 cat /proc/cpuinfogrep “model name” uniq物理CPU数 cat /proc/cpuinfogrep “physical id” sort核心数 cat /proc/cpuinfogrep “cpu cores” uniq线程数 cat /proc/cpuinfogrep “siblings” uniq
lscpu #也可查看/proc/cpuinfo kylin@kylin:~$ lscpu 架构: x86_64 CPU 运行模式:32 -bit,64 -bit 字节序: Little Endian Address sizes:39 bits physical,48 bits virtual CPU:8 在线 CPU 列表:0 -7 每个核的线程数:2 每个座的核数:4 座:1 NUMA 节点:1 厂商 ID: GenuineIntel CPU 系列:6 型号:142 型号名称: Intel( R) Core( TM) i5-10210U CPU @1 .60GHz 步进:12 CPU MHz:3410.434 CPU 最大 MHz:4200.0000 CPU 最小 MHz:400.0000 BogoMIPS:4199.88 虚拟化: VT-x L1d 缓存:128 KiB L1i 缓存:128 KiB L2 缓存:1 MiB L3 缓存:6 MiB NUMA 节点0 CPU:0 -7 Vulnerability Itlb multihit: KVM: Mitigation: Split huge pagesfree #也可查看/proc/meminfo kylin@kylin:~$free -h 总计 已用 空闲 共享 缓冲/缓存 可用 内存:7 .4Gi2 .0Gi2 .4Gi 382Mi3 .0Gi4 .8Gi 交换:8 .0Gi 0B8 .0Gidmidecode命令(硬件) 所有参数 kylin@kylin:~/桌面$sudo dmidecode-t bios system baseboard#主板 chassis# processor#处理器 memory#内存 cache#缓存 connector#设备的接口 slot#狭槽 #查看所有有用信息 dmidecode-q 硬件类型 命令 关键信息 BIOS sudo dmidecode -t biosVendor, Version, Release Date 系统信息 sudo dmidecode -t systemManufacturer, Product Name, Serial Number 主板 sudo dmidecode -t baseboardManufacturer, Product Name, Serial Number 机箱 sudo dmidecode -t chassisType, Lock, Version 处理器 sudo dmidecode -t processorSocket, Type, Core Count
bios kylin@kylin:~/桌面$sudo dmidecode-t bios BIOS Information#bios信息 Vendor: LENOVO#厂商 Version: N2YET25W( 1.14 ) #版本 Release Date: 09/29/2020#发布日期 Address: 0xE0000#地址 Runtime Size:128 kB#运行大小 ROM Size:32 MB#内存大小 BIOS Revision:1.14 #bios版本 Firmware Revision:1.7 #固件版本 Installable Languages:1 #可安装语言 Currently Installed Language: en-US#当前安装语言 system # dmidecode 3.2 Getting SMBIOS data from sysfs. SMBIOS3.2 .0 present. Handle 0x0014, DMItype 1 ,27 bytes System Information#系统信息 Manufacturer: LENOVO#制造商 Product Name: 20T2A002CD#产品名称 Version: ThinkPad X13 Gen1 #版本 Serial Number: PC1Q0BCE#序列号 UUID: 436dcbcc-315e-11b2-a85c-d82e6b06cf45#用户识别号 Wake-up Type: Power Switch#唤醒类型:电源 SKU Number: LENOVO_MT_20T2_BU_Think_FM_ThinkPad X13 Gen1 #SKU编号 Family: ThinkPad X13 Gen1 #系列 System Event Log#系统事件日志,后面没记 baseboard(主板) Base Board Information#主板信息 Manufacturer: LENOVO#制造商 Product Name: 20T2A002CD#产品名称 Version: SDK0L77769 WIN#版号 Serial Number: L1HF0860DX6#序列号 chassis() Handle 0x0016, DMItype 3 ,22 bytesChassis Information Manufacturer: LENOVO#制造商 Type: Notebook #类型:笔记本 Lock: Not Present #锁:不存在 Version: None #版本:无 Serial Number: PC1Q0BCE #序列号 Asset Tag: No Asset Information #资产标签:无资产信息 SKU Number: Not Specified #SKU编号:未指定 processor(处理器) Processor Information#处理器信息 Socket Designation: U3E1 #插座名称 Type: Central Processor #类型:中央处理器 Family: Core i5 #系列 Manufacturer: Intel(R) Corporation #制造商 ID: EC 06 08 00 FF FB EB BF #编号 Signature: Type 0, Family 6, Model 142, Stepping 12 #签名 Version: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz #版本 Voltage: 0.8 V #电压 External Clock: 100 MHz #外部时钟 Max Speed: 2100 MHz #最大速度 Current Speed: 1600 MHz #当前速度 Status: Populated, Enabled #状态 Core Count: 4 #芯数 Core Enabled: 4 #核心启动 Thread Count: 8 #线程数 网卡 网卡硬件信息 kylin@kylin:~$ lspci| grep -i eth00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection( 10 ) I219-V查看所有网络接口 ifconfig或iplink showkylin@kylin:~$ip link show1: lo:< LOOPBACK,UP,LOWER_UP> mtu65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:002: eth0:< NO-CARRIER,BROADCAST,MULTICAST,UP> mtu1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen1000 link/ether54 :05:db:05:45:ad brd ff:ff:ff:ff:ff:ff3: wlan0:< BROADCAST,MULTICAST,UP,LOWER_UP> mtu1500 qdisc noqueue state UP mode DORMANT group default qlen1000 link/ether dc:1b:a1:a7:d8:2f brd ff:ff:ff:ff:ff:ff查看网口详细信息 kylin@kylin:~$ethtool eth0 Settingsfor eth0: Supported ports:[ TP] #支持的端口:TP Supported link modes: 10baseT/Half 10baseT/Full #链路模式 10baseT/半10baseT/全 100baseT/Half 100baseT/Full #支持千兆半双工,全双工模式 1000baseT/Full Supported pause frame use: No # Supports auto-negotiation: Yes #支持自适应模式,一般都支持 Supported FEC modes: Not reported Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised pause frame use: No Advertised auto-negotiation: Yes #默认使用自适应模式 Advertised FEC modes: Not reported Speed: Unknown! #网卡使用自适应模式,所以推测路由是100Mb,导致网卡从支持千兆,变成要支持百兆 Duplex: Unknown! (255) #全双工 Port: Twisted Pair PHYAD: 2 Transceiver: internal Auto-negotiation: on MDI-X: Unknown (auto)Cannot get wake-on-lan settings: Operation not permitted Current message level: 0x00000007 (7) drv probe link Link detected: no #连网线是yes,本次是无线网 lspci #查看主板所有硬件槽信息 lspci-v 可以更详细一些kylin@kylin:~$ lspci00:00.0 Host bridge: Intel Corporation Device 9b61( rev 0c) #主板00:02.0 VGA compatible controller: Intel Corporation UHD Graphics (rev 02) #显卡00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem (rev 0c)00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th/8th Gen Core Processor Gaussian Mixture Model00:12.0 Signal processing controller: Intel Corporation Comet Lake Thermal Subsytem00:14.0 USB controller: Intel Corporation Device 02ed #usb控制器00:14.2 RAM memory: Intel Corporation Device 02ef #内存00:14.3 Network controller: Intel Corporation Wireless-AC 946200:16.0 Communication controller: Intel Corporation Comet Lake Management Engine Interface00:1c.0 PCI bridge: Intel Corporation Device 02b8 (rev f0) #PCI 插槽00:1c.4 PCI bridge: Intel Corporation Device 02bc (rev f0)00:1d.0 PCI bridge: Intel Corporation Device 02b0 (rev f0)00:1d.4 PCI bridge: Intel Corporation Device 02b4 (rev f0)00:1f.0 ISA bridge: Intel Corporation Device 028400:1f.3 Audio device: Intel Corporation Device 02c8 #声卡00:1f.4 SMBus: Intel Corporation Device 02a300:1f.5 Serial bus controller [0c80]: Intel Corporation Comet Lake SPI (flash) Controller00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (10) I219-V #网卡02:00.0 SD Host controller: Genesys Logic, Inc GL9750 SD Host Controller (rev 01)03:00.0 PCI bridge: Intel Corporation JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] (rev 01)04:00.0 PCI bridge: Intel Corporation JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] (rev 01)04:01.0 PCI bridge: Intel Corporation JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] (rev 01)04:02.0 PCI bridge: Intel Corporation JHL6240 Thunderbolt 3 Bridge (Low Power) [Alpine Ridge LP 2016] (rev 01)05:00.0 System peripheral: Intel Corporation JHL6240 Thunderbolt 3 NHI (Low Power) [Alpine Ridge LP 2016] (rev 01)2b:00.0 USB controller: Intel Corporation JHL6240 Thunderbolt 3 USB 3.1 Controller (Low Power) [Alpine Ridge LP 2016] (rev 01)2e:00.0 Non-Volatile memory controller: Sandisk Corp Device 5006#或者kylin@kylin:~$ lspci -vs 00:02.000:02.0 VGA compatible controller: Intel Corporation UHD Graphics (rev 02) (prog-if 00 [VGA controller]) Subsystem: Lenovo UHD Graphics Flags: bus master, fast devsel, latency 0, IRQ 149 Memory at ed000000 (64-bit, non-prefetchable) [size=16M] Memory at d0000000 (64-bit, prefetchable) [size=256M] I/O ports at 4000 [size=64] Expansion ROM at 000c0000 [virtual] [disabled] [size=128K] Capabilities: <access denied> Kernel driver in use: i915 Kernel modules: i915