歡迎您光臨本站 註冊首頁

linux下查看硬體的信息(BIOSCPUMEM主板)

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0

今天我們領導叫我看下伺服器的cpu型號,和主板型號,我當時就納悶了,cpu型號可以看,主板怎麼看呀!只好google了,發現一很給力的命令dmidecode

我大致看了一下man手冊,我把我用到的部分貼出來 -t, --type TYPE Only display the entries of type TYPE. TYPE can be either a DMI type number, or a comma-separated list of type numbers, or a keyword from the fol- lowing list: bios, system, baseboard, chassis, processor, memory, cache, connector, slot. Refer to the DMI TYPES section below for details. If this option is used more than once, the set of displayed entries will be the union of all the given types. If TYPE is not provided or not valid, a list of all valid keywords is printed and dmidecode exits with an error. Additionally, type 126 is used for disabled entries and type 127 is an end-of-table marker. Types 128 to 255 are for OEM-specific data. dmidecode will display these entries by default, but it can only decode them when the vendors have contributed documentation or code for them. Keywords can be used instead of type numbers with --type. Each keyword is equivalent to a list of type numbers: Keyword Types ------------------------------ bios 0, 13 system 1, 12, 15, 23, 32 baseboard 2, 10, 41 chassis 3 processor 4 memory 5, 6, 16, 17 cache 7 connector 8 slot 9 Keywords are matched case-insensitively. The following command lines are equivalent: · dmidecode --type 0 --type 13 · dmidecode --type 0,13 · dmidecode --type bios · dmidecode --type BIOS 其他更詳細的信息自己去man吧,下面舉例 查看cpu信息 [root@localhost ~]# dmidecode -t 4 # dmidecode 2.10 SMBIOS 2.4 present. Handle 0x0400, DMI type 4, 40 bytes Processor Information Socket Designation: CPU1 Type: Central Processor Family: Xeon Manufacturer: 英特爾 ID: F7 06 00 00 FF FB EB BF Signature: Type 0, Family 6, Model 15, Stepping 7 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Hyper-threading technology) TM (Thermal monitor supported) PBE (Pending break enabled) Version: 英特爾(R) Xeon(R) CPU E5345 @ 2.33GHz Voltage: 1.4 V External Clock: 1333 MHz Max Speed: 3600 MHz Current Speed: 2333 MHz Status: Populated, Enabled Upgrade: Socket LGA771 L1 Cache Handle: 0x0700 L2 Cache Handle: 0x0701 L3 Cache Handle: 0x0702 Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Core Count: 4 Core Enabled: 4 Thread Count: 4 Characteristics: 64-bit capable Handle 0x0401, DMI type 4, 40 bytes Processor Information Socket Designation: CPU2 Type: Central Processor Family: Xeon Manufacturer: 英特爾 ID: F7 06 00 00 FF FB EB BF Signature: Type 0, Family 6, Model 15, Stepping 7 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (Fast floating-point save and restore) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Hyper-threading technology) TM (Thermal monitor supported) PBE (Pending break enabled) Version: 英特爾(R) Xeon(R) CPU E5345 @ 2.33GHz Voltage: 1.4 V External Clock: 1333 MHz Max Speed: 3600 MHz Current Speed: 2333 MHz Status: Populated, Idle Upgrade: Socket LGA771 L1 Cache Handle: 0x0703 L2 Cache Handle: 0x0704 L3 Cache Handle: 0x0705 Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified Core Count: 4 Core Enabled: 4 Thread Count: 4 Characteristics: 64-bit capable [root@localhost ~]# 可以看出我這上面有2個英特爾(R) Xeon(R) CPU E5345 @ 2.33GHz cpu,是4核4線程,還支持64位等等的信息. 查看當前cpu工作在什麼模式之下 [root@localhost ~]# uname -a Linux localhost 2.6.18-194.32.1.el5PAE #1 SMP Wed Jan 5 18:43:13 EST 2011 i686 i686 i386 GNU/Linux [root@localhost ~]# getconf LONG_BIT 32 [root@localhost ~]# 我更喜歡用的方法 [root@localhost ~]# cat /proc/cpuinfo processor : 0 vendor_id : Genuine英特爾 cpu family : 6 model : 15 model name : 英特爾(R) Xeon(R) CPU E5345 @ 2.33GHz stepping : 7 cpu MHz : 2327.562 cache size : 4096 KB physical id : 0 siblings : 4 core id : 0 cpu cores : 4 apicid : 0 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 sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm bogomips : 4655.12 processor : 1 vendor_id : Genuine英特爾 cpu family : 6 model : 15 model name : 英特爾(R) Xeon(R) CPU E5345 @ 2.33GHz stepping : 7 cpu MHz : 2327.562 cache size : 4096 KB physical id : 0 siblings : 4 core id : 1 cpu cores : 4 apicid : 1 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 sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm bogomips : 4655.04 processor : 2 vendor_id : Genuine英特爾 cpu family : 6 model : 15 model name : 英特爾(R) Xeon(R) CPU E5345 @ 2.33GHz stepping : 7 cpu MHz : 2327.562 cache size : 4096 KB physical id : 0 siblings : 4 core id : 2 cpu cores : 4 apicid : 2 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 sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm bogomips : 4655.07 processor : 3 vendor_id : Genuine英特爾 cpu family : 6 model : 15 model name : 英特爾(R) Xeon(R) CPU E5345 @ 2.33GHz stepping : 7 cpu MHz : 2327.562 cache size : 4096 KB physical id : 0 siblings : 4 core id : 3 cpu cores : 4 apicid : 3 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 sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm bogomips : 4655.08 processor : 4 vendor_id : Genuine英特爾 cpu family : 6 model : 15 model name : 英特爾(R) Xeon(R) CPU E5345 @ 2.33GHz stepping : 7 cpu MHz : 2327.562 cache size : 4096 KB physical id : 1 siblings : 4 core id : 0 cpu cores : 4 apicid : 4 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 sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm bogomips : 4655.08 processor : 5 vendor_id : Genuine英特爾 cpu family : 6 model : 15 model name : 英特爾(R) Xeon(R) CPU E5345 @ 2.33GHz stepping : 7 cpu MHz : 2327.562 cache size : 4096 KB physical id : 1 siblings : 4 core id : 1 cpu cores : 4 apicid : 5 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 sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm bogomips : 4655.09 processor : 6 vendor_id : Genuine英特爾 cpu family : 6 model : 15 model name : 英特爾(R) Xeon(R) CPU E5345 @ 2.33GHz stepping : 7 cpu MHz : 2327.562 cache size : 4096 KB physical id : 1 siblings : 4 core id : 2 cpu cores : 4 apicid : 6 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 sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm bogomips : 4655.07 processor : 7 vendor_id : Genuine英特爾 cpu family : 6 model : 15 model name : 英特爾(R) Xeon(R) CPU E5345 @ 2.33GHz stepping : 7 cpu MHz : 2327.562 cache size : 4096 KB physical id : 1 siblings : 4 core id : 3 cpu cores : 4 apicid : 7 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 sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm bogomips : 4655.09 [root@localhost ~]# 下面根據輸出的信息 我們來進行篩選有用的信息, 首先看cpu的型號 [root@localhost ~]# cat /proc/cpuinfo | grep name | awk -F : '{print $2}' | uniq -c 8 英特爾(R) Xeon(R) CPU E5345 @ 2.33GHz [root@localhost ~]# 這裡我統計了一下次數,說明是8個邏輯上的cpu,我們來進一步的篩選 [root@localhost ~]# cat /proc/cpuinfo | grep "physical id" | uniq -c 4 physical id : 0 4 physical id : 1 [root@localhost ~]# 通過這個篩選我們就知道是有2個物理cpu,我們再來篩選一下其他欄位, [root@localhost ~]# cat /proc/cpuinfo | grep "core" core id : 0 cpu cores : 4 core id : 1 cpu cores : 4 core id : 2 cpu cores : 4 core id : 3 cpu cores : 4 core id : 0 cpu cores : 4 core id : 1 cpu cores : 4 core id : 2 cpu cores : 4 core id : 3 cpu cores : 4 [root@localhost ~]# 在這個文件我們還能查看主頻 [root@localhost ~]# cat /proc/cpuinfo | grep "MH" | uniq -c 8 cpu MHz : 2327.562 [root@localhost ~]# 查看是否支持64位 [root@localhost ~]# cat /proc/cpuinfo | grep "flags" | uniq -c 8 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 nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm 發現其中有lm,lm的意思是long mode 說明支持64位 還有一個命令也能把硬體信息給詳細的列出來,比如我列出cpu的個數 [root@localhost ~]# dmesg | grep "CPU: Physical Processor ID:" | uniq -c 4 CPU: Physical Processor ID: 0 4 CPU: Physical Processor ID: 1 [root@localhost ~]# 具體怎麼篩選,就需要好好閱讀dmesg的輸出信息了 查看內存使用情況的名就很多了有free,top,htop;還能查看/proc/meminfo 這裡我主要說下內存的信息 [root@localhost ~]# dmidecode -t 16 # dmidecode 2.10 SMBIOS 2.4 present. Handle 0x1000, DMI type 16, 15 bytes Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: Multi-bit ECC Maximum Capacity: 32 GB Error Information Handle: Not Provided Number Of Devices: 8 [root@localhost ~]# 可以看出最大支持32G的內存,有8個內存插槽 [root@localhost ~]# dmidecode -t 17 # dmidecode 2.10 SMBIOS 2.4 present. Handle 0x1100, DMI type 17, 28 bytes Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 2048 MB Form Factor: FB-DIMM Set: 1 Locator: DIMM1 Bank Locator: Not Specified Type: DDR2 FB-DIMM Type Detail: Synchronous Speed: 667 MHz Manufacturer: 01917FB30000 Serial Number: 38540000 Asset Tag: 010000 Part Number: DATARAM 65508 Rank: 2 Handle 0x1101, DMI type 17, 28 bytes Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 2048 MB Form Factor: FB-DIMM Set: 1 Locator: DIMM2 Bank Locator: Not Specified Type: DDR2 FB-DIMM Type Detail: Synchronous Speed: 667 MHz Manufacturer: 01917FB30000 Serial Number: 71670000 Asset Tag: 010000 Part Number: DATARAM 65508 Rank: 2 Handle 0x1102, DMI type 17, 28 bytes Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: FB-DIMM Set: 2 Locator: DIMM3 Bank Locator: Not Specified Type: DDR2 FB-DIMM Type Detail: Synchronous Speed: Unknown Manufacturer: Serial Number: Asset Tag: Part Number: Rank: Unknown Handle 0x1103, DMI type 17, 28 bytes Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: FB-DIMM Set: 2 Locator: DIMM4 Bank Locator: Not Specified Type: DDR2 FB-DIMM Type Detail: Synchronous Speed: Unknown Manufacturer: Serial Number: Asset Tag: Part Number: Rank: Unknown Handle 0x1104, DMI type 17, 28 bytes Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: FB-DIMM Set: 3 Locator: DIMM5 Bank Locator: Not Specified Type: DDR2 FB-DIMM Type Detail: Synchronous Speed: Unknown Manufacturer: Serial Number: Asset Tag: Part Number: Rank: Unknown Handle 0x1105, DMI type 17, 28 bytes Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: FB-DIMM Set: 3 Locator: DIMM6 Bank Locator: Not Specified Type: DDR2 FB-DIMM Type Detail: Synchronous Speed: Unknown Manufacturer: Serial Number: Asset Tag: Part Number: Rank: Unknown Handle 0x1106, DMI type 17, 28 bytes Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: FB-DIMM Set: 4 Locator: DIMM7 Bank Locator: Not Specified Type: DDR2 FB-DIMM Type Detail: Synchronous Speed: Unknown Manufacturer: Serial Number: Asset Tag: Part Number: Rank: Unknown Handle 0x1107, DMI type 17, 28 bytes Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: No Module Installed Form Factor: FB-DIMM Set: 4 Locator: DIMM8 Bank Locator: Not Specified Type: DDR2 FB-DIMM Type Detail: Synchronous Speed: Unknown Manufacturer: Serial Number: Asset Tag: Part Number: Rank: Unknown [root@localhost ~]# 可以看出來是DDR2 FB-DIMM的內存 查看主板信息 [root@localhost ~]# dmidecode -t 1 # dmidecode 2.10 SMBIOS 2.4 present. Handle 0x0100, DMI type 1, 27 bytes System Information Manufacturer: Dell Inc. Product Name: PowerEdge 2950 Version: Not Specified Serial Number: CS2452X UUID: 44454C4C-5300-1032-8034-C3C04F353258 Wake-up Type: Power Switch SKU Number: Not Specified Family: Not Specified [root@localhost ~]# dmesg | grep Mem Memory for crash kernel (0x0 to 0x0) notwithin permissible range HighMem zone: 1015808 pages, LIFO batch:31 Memory: 4145156k/4980736k available (2177k kernel code, 47444k reserved, 900k data, 228k init, 3276448k highmem) [root@localhost ~]# 以後發現了 再加上去

本文出自 「開源支持者」 博客,謝絕轉載!


[火星人 ] linux下查看硬體的信息(BIOSCPUMEM主板)已經有857次圍觀

http://coctec.com/docs/linux/show-post-48420.html