Linux查看硬件信息命令

一、查看服务器硬件信息

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

[root@Master ~]# dmidecode|grep "System Information" -A9|egrep  "Manufacturer|Product|Serial"

序列号    dmidecode -s system-serial-number

 (2)查看主板型号
[root@Master ~]# dmidecode |grep -A16 "System Information$"

 (3)查看BIOS信息

复制代码
[root@Master ~]# dmidecode -t bios
# dmidecode 2.12
SMBIOS 2.8 present.

Handle 0x0008, DMI type 0, 24 bytes
BIOS Information
        Vendor: HP
        Version: U19
        Release Date: 12/27/2015
        Address: 0xF0000
        Runtime Size: 64 kB
        ROM Size: 16384 kB
        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 supported
                5.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 (int 5h)
                8042 keyboard services are supported (int 9h)
                Serial services are supported (int 14h)
                Printer services are supported (int 17h)
                CGA/mono video services are supported (int 10h)
                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.0
        Firmware Revision: 2.40
复制代码

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

复制代码
[root@Master ~]# dmidecode -t memory | head -45 | tail -23
Memory Device
        Array Handle: 0x000A
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 16384 MB
        Form Factor: DIMM
        Set: None
        Locator: PROC 1 DIMM 1
        Bank Locator: Not Specified
        Type: DDR4
        Type Detail: Synchronous Registered (Buffered)
        Speed: 2133 MHz
        Manufacturer: HP     
        Serial Number: Not Specified
        Asset Tag: Not Specified
        Part Number: 752369-081
        Rank: 2
        Configured Clock Speed: 2133 MHz
        Minimum Voltage:  1.2 V
        Maximum Voltage:  1.2 V
        Configured Voltage:  1.2 V

[root@Master ~]#
复制代码

  (4)查看网卡信息

复制代码
[root@Master ~]# dmesg | grep -i Ethernet
igb: Intel(R) Gigabit Ethernet Network Driver - version 5.3.0-k
igb 0000:04:00.0: Intel(R) Gigabit Ethernet Network Connection
igb 0000:04:00.1: Intel(R) Gigabit Ethernet Network Connection
igb 0000:04:00.2: Intel(R) Gigabit Ethernet Network Connection
igb 0000:04:00.3: Intel(R) Gigabit Ethernet Network Connection
igb 0000:02:00.0: Intel(R) Gigabit Ethernet Network Connection
igb 0000:02:00.1: Intel(R) Gigabit Ethernet Network Connection 
复制代码

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

复制代码
[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)
复制代码

 

、查看CPU信息

(1)查看cpu型号

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

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

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

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

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

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

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

(5)查看CPU的主频

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

(6)查看CPU的详细信息

复制代码
[root@Master ~]# cat /proc/cpuinfo | head -20
processor       : 0                           //逻辑处理器的ID
vendor_id       : GenuineIntel
cpu family      : 6
model           : 63
model name      : Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz   //CPU型号
stepping        : 2
microcode       : 54
cpu MHz         : 1200.000
cache size      : 25600 KB
physical id     : 0
siblings        : 20                //相同物理封装处理器中逻辑处理器数
core id         : 0
cpu cores       : 10               //相同物理封装处理器中的内核数
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 15
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 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
复制代码

 (7)查看CPU的相关信息

复制代码
[root@Master ~]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                40
On-line CPU(s) list:   0-39
Thread(s) per core:    2
Core(s) per socket:    10
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 63
Model name:            Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz
Stepping:              2
CPU MHz:               1200.000
BogoMIPS:              4594.43
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              25600K
NUMA node0 CPU(s):     0-9,20-29
NUMA node1 CPU(s):     10-19,30-39
[root@Master ~]# 
复制代码

 (8)查看cpu运行模式

[root@Master ~]# getconf LONG_BIT
64

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

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

 

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

复制代码
root@Master ~]# dmidecode -t memory | head -45 | tail -24
Handle 0x000C, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x000A
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 16384 MB
        Form Factor: DIMM
        Set: None
        Locator: PROC 1 DIMM 1
        Bank Locator: Not Specified
        Type: DDR4
        Type Detail: Synchronous Registered (Buffered)
        Speed: 2133 MHz
        Manufacturer: HP     
        Serial Number: Not Specified
        Asset Tag: Not Specified
        Part Number: 752369-081
        Rank: 2
        Configured Clock Speed: 2133 MHz
        Minimum Voltage:  1.2 V
        Maximum Voltage:  1.2 V
        Configured Voltage:  1.2 V
复制代码

 (2)最大支持多少内存
[root@Master ~]# dmidecode|grep -P 'Maximum\s+Capacity'

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

 (4)Linux 查看内存的频率:
[root@Master ~]# dmidecode|grep -A16 "Memory Device"|grep 'Speed'

没插内存就是unknown

 (5)Linux 查看内存的详细信息:

复制代码
[root@Master ~]# cat /proc/meminfo |head -20
MemTotal:       131897620 kB
MemFree:          414124 kB
Buffers:         1040560 kB
Cached:         111083180 kB
SwapCached:         1320 kB
Active:          7637912 kB
Inactive:       110607108 kB
Active(anon):    4406900 kB
Inactive(anon):  1714900 kB
Active(file):    3231012 kB
Inactive(file): 108892208 kB
Unevictable:    10878976 kB
Mlocked:         5521652 kB
SwapTotal:      16777212 kB
SwapFree:       16737536 kB
Dirty:               180 kB
Writeback:             0 kB
AnonPages:      16999324 kB
Mapped:           149020 kB
Shmem:               172 kB
复制代码

(6)Linux 查看内存的使用情况

[root@Master ~]# free -m    // -b,-k,-m,-g show output in bytes, KB, MB, or GB
             total       used       free     shared    buffers     cached
Mem:        128806     123407       5398          0       1015     103474
-/+ buffers/cache:      18918     109888
Swap:        16383         38      16345

 

 、查看硬盘信息
(1)查看挂接的分区状态
[root@Master ~]# fdisk -l |grep Disk

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

复制代码
[root@Master ~]# lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 279.4G  0 disk 
├─sda1   8:1    0    50M  0 part /boot
├─sda2   8:2    0   100G  0 part /
├─sda3   8:3    0    50G  0 part /home
├─sda4   8:4    0     1K  0 part 
├─sda5   8:5    0    16G  0 part [SWAP]
├─sda6   8:6    0  13.3G  0 part /tmp
└─sda7   8:7    0   100G  0 part /usr
sdb      8:16   0  83.7T  0 disk 
└─sdb1   8:17   0  83.7T  0 part /PureDisk
复制代码

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

复制代码
[root@Master ~]# fdisk -l           

Disk /dev/sda: 300.0 GB, 299966445568 bytes
255 heads, 63 sectors/track, 36468 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes
Disk identifier: 0x000384d9

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1           7       51200   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2               7       13061   104857600   83  Linux
/dev/sda3           13061       19588    52428800   83  Linux
/dev/sda4           19588       36469   135597056    5  Extended
/dev/sda5           19588       21677    16777216   82  Linux swap / Solaris
/dev/sda6           21677       23415    13962240   83  Linux
/dev/sda7           23416       36469   104854528   83  Linux

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, 92017310654464 bytes
255 heads, 63 sectors/track, 11187134 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 6029312 bytes
Disk identifier: 0x00000000

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

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

复制代码
[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
复制代码

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

[root@Master ~]# swapon -s   
Filename                                Type            Size    Used    Priority
/dev/sda5                               partition       16777212        39676   -1

 (6)查看硬盘使用情况

复制代码
[root@Master ~]# df -hT
Filesystem     Type   Size  Used Avail Use% Mounted on
/dev/sda2      ext4    99G  561M   93G   1% /
tmpfs          tmpfs   63G   76K   63G   1% /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
复制代码

 (7) 硬盘检测命令smartctl

复制代码
[root@Master ~]# smartctl -a /dev/sda
smartctl 5.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.56
User Capacity:        299,966,445,568 bytes [299 GB]
Logical block size:   512 bytes
Logical Unit id:      0x600508b1001cc8a1b9ec4dacc5ab35dc
Serial number:        PDNNK0BRH9U0AG  
Device type:          disk
Local Time is:        Mon Feb  5 13:13:33 2018 CST
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
复制代码

 

、查看网卡信息

(1)查看网卡硬件信息
[root@Master ~]#  lspci | grep -i 'eth'

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

[root@Master ~]# ifconfig -a
[root@Master ~]# ip link show

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

复制代码
[root@Master ~]# ethtool eth0
Settings for eth0:
        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: 0
        Transceiver: external
        Auto-negotiation: off
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes
复制代码

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

复制代码
[root@Master ~]# for i in `seq 0 9`;do ethtool eth${i} | egrep 'eth|Link';done
Settings for eth0:
        Link detected: yes   
Settings for eth1:
        Link detected: yes
Settings for eth2:
        Link detected: no
Settings for eth3:
        Link detected: no
Settings for eth4:
        Link detected: no
Settings for eth5:
        Link detected: no
Settings for eth6:
        Link detected: no
Settings for eth7:
        Link detected: no
Settings for eth8:
        Link detected: no
Settings for eth9:
        Link detected: no
复制代码

 

 六、列出所有PCI设备信息

复制代码
[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 & 1 Monitoring
 |           +-0b.1  Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 R3 QPI Link 0 & 1 Monitoring
 |           +-0b.2  Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 R3 QPI Link 0 & 1 Monitoring
 |           +-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
复制代码

 

 

 dmidecode

使用该命令可以查询BIOS、系统、主板、处理器、内存、缓存等非常重要信息。下面是其常用的几个命令:

# dmidecode | grep 'Product Name'                           // 查看服务器型号
# dmidecode | grep 'Serial Number'                         // 查看主板的序列号
# dmidecode -s system-serial-number                        // 查看系统序列号
# dmidecode -t memory                                          // 查看内存信息
# dmidecode -t 11                                               // 查看OEM信息
# dmidecode | grep -A16 "Memory Device" | grep "Size" |sed 's/^[ \t]*//'  // 现有内存数量和内存大小
# dmidecode | grep "Maximum Capacity" |sed  "s/^[ \t]*//"                     // 最大支持内存容量:


Usage: dmidecode [OPTIONS]

Options are:

-d:(default:/dev/mem)从设备文件读取信息,输出内容与不加参数标准输出相同。

-h:显示帮助信息。

-s:只显示指定DMI字符串的信息。(string)

-t:只显示指定条目的信息。(type)

-u:显示未解码的原始条目内容。

-- dump-bin FILE: Dump the DMI data to a binary file.

-- from-dump FILE: Read the DMI data from a binary file.

-V:显示版本信息

 

DMI (Desktop Management Interface)

dmidecode在 Linux 系统下获取有关硬件方面的信息。dmidecode 遵循 SMBIOS/DMI 标准,以一种可读的方式dump出机器的DMI(Desktop Management Interface)信息, 其输出的信息包括 BIOS、系统、主板、处理器、内存、缓存等等, 既可以得到当前的配置,也可以得到系统支持的最大配置,比如说支持的最大内存数等。

aptitude install dmidecode # Debian/Ubuntu
yum install dmidecode # Fedora
pacman -S dmidecode # Arch Linux
emerge -av dmidecode # Gentoo

 查看内存槽数、那个槽位插了内存,大小是多少

dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range

 查看最大支持内存数

dmidecode|grep -P 'Maximum\s+Capacity'

 查看槽位上内存的速率,没插就是unknown。

dmidecode|grep -A16 "Memory Device"|grep 'Speed'

dmidecode的输出格式一般如下:

Handle 0×0002
DMI type 2, 8 bytes
Base Board Information
Manufacturer:Intel
Product Name: C440GX+
Version: 727281-0001
Serial Number: INCY92700942

 其中的前三行都称为记录头(recoce Header), 其中包括了:
1、recode id(handle): DMI表中的记录标识符,这是唯一的,比如上例中的Handle 0×0002。
2、dmi type id: 记录的类型,譬如说:BIOS,Memory,上例是type 2,即”Base Board Information”
3、recode size: DMI表中对应记录的大小,上例为8 bytes.(不包括文本信息,所有实际输出的内容比这个size要更大。)
记录头之后就是记录的值:
4、decoded values: 记录值可以是多行的,比如上例显示了主板的制造商(manufacturer)、model、version以及serial Number。

dmidecode的使用方法

# dmidecode    #这样将输出所有的dmi信息,你可能会被一大堆的信息吓坏,通常可以使用下面的方法。
# dmidecode -q
    -q(–quite) 只显示必要的信息,这个很管用哦。

# dmidecode -t bios
# dmidecode -t bios, processor (这种方式好像不可以用,必须用下面的数字的方式)
# dmidecode -t 0,4 (显示bios和processor)

 dmidecode到底支持哪些type?
这些可以在man dmidecode里面看到:
文本参数支持:
bios, system, baseboard, chassis, processor, memory, cache, connector, slot
数字参数支持很多:(见附录)

通过关键字查看信息:
比如只想查看序列号,可以使用:

# dmidecode -s system-serial-number
  -s (–string keyword)支持的keyword包括:
bios-vendor
bios-version,
bios-release-date
system-manufacturer
system-product-name
system-version
system-serial-number
baseboard-manu-facturer
baseboard-product-name
baseboard-version
baseboard-serial-number
baseboard-asset-tag
chassis-manufacturer
chas-sis-version
chassis-serial-number
chassis-asset-tag,
processor-manufacturer
processor-version

 5.示例
5.1 查看当前内存和支持的最大内存
Linux下,可以使用free或者查看meminfo来获得当前的物理内存:

# free
total used free shared buffers cached
Mem: 8182532 8010792 171740 0 148472 4737896
-/+ buffers/cache: 3124424 5058108
Swap: 4192956 3304 4189652
# grep MemTotal /proc/meminfo
MemTotal: 8182532 kB

 这里显示了当前服务器的物理内存是8GB。
服务器到底能扩展到多大的内存?

#dmidecode -t 16
# dmidecode 2.7
SMBIOS 2.4 present.
 
Handle 0×0013, DMI type 16, 15 bytes.
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: Multi-bit ECC
Maximum Capacity: 64 GB (可扩展到64GB)
Error Information Handle: Not Provided
Number Of Devices: 4

 但是,事实不一定如此,因此插槽可能已经插满了。也就是我们还必须查清这里的8G到底是4*2GB, 2*4GB还是其他?
如果是4*2GB,那么尽管可以扩展到64GB,但是插槽已经插满,无法扩展了:

#dmidecode -t 17
# dmidecode 2.7
SMBIOS 2.4 present.
 
Handle 0×0015, DMI type 17, 27 bytes.
Memory Device
Array Handle: 0×0013
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB 【插槽1有1条2GB内存】
Form Factor: DIMM
Set: None
Locator: DIMM00
Bank Locator: BANK
Type: Other
Type Detail: Other
Speed: 667 MHz (1.5 ns)
Manufacturer:
Serial Number: BZACSKZ001
Asset Tag: RAM82
Part Number: MT9HTF6472FY-53EA2
 
Handle 0×0017, DMI type 17, 27 bytes.
Memory Device
Array Handle: 0×0013
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB 【插槽2有1条2GB内存】
Form Factor: DIMM
Set: None
Locator: DIMM10
Bank Locator: BANK
Type: Other
Type Detail: Other
Speed: 667 MHz (1.5 ns)
Manufacturer:
Serial Number: BZACSKZ001
Asset Tag: RAM83
Part Number: MT9HTF6472FY-53EA2
 
Handle 0×0019, DMI type 17, 27 bytes.
Memory Device
Array Handle: 0×0013
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB 【插槽3有1条2GB内存】
Form Factor: DIMM
Set: None
Locator: DIMM20
Bank Locator: BANK
Type: Other
Type Detail: Other
Speed: 667 MHz (1.5 ns)
Manufacturer:
Serial Number: BZACSKZ001
Asset Tag: RAM84
Part Number: MT9HTF6472FY-53EA2
 
Handle 0x001B, DMI type 17, 27 bytes.
Memory Device
Array Handle: 0×0013
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 2048 MB 【插槽4有1条2GB内存】
Form Factor: DIMM
Set: None
Locator: DIMM30
Bank Locator: BANK
Type: Other
Type Detail: Other
Speed: 667 MHz (1.5 ns)
Manufacturer:
Serial Number: BZACSKZ001
Asset Tag: RAM85
Part Number: MT9HTF6472FY-53EA2

 根据上面输出可以发现,如果要扩展,只有将上面的内存条换成16GB的,才能达到4*16GB=64GB的最大支持内存。
附录:
dmidecode支持的数字参数:
Type Information

0 BIOS
1 System
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply

 一个查看硬件基本信息的脚本

[root@SC4306 test]# cat test.sh
#!/bin/bash 
echo "IP:" 
ifconfig |grep "inet addr"|grep -v 127.0.0.1|awk '{print $2}'|awk -F ':' '{print $2}' 
echo "Product Name:" 
dmidecode |grep Name 
echo "CPU Info:" 
dmidecode |grep -i cpu|grep -i version|awk -F ':' '{print $2}' 
echo "Disk Info:" 
parted -l|grep 'Disk /dev/sd'|awk -F ',' '{print "  ",$1}' 
echo "Network Info:" 
lspci |grep Ethernet 
echo "Memory Info:" 
dmidecode|grep -A5 "Memory Device"|grep Size|grep -v No 
echo "Memory number:"`dmidecode|grep -A5 "Memory Device"|grep Size|grep -v No|wc -l`

输出结果:

[root@SC4306 test]# bash test.sh
IP:
10.0.17.6
10.0.250.6
Product Name:
    Product Name: PowerEdge R720
    SKU Number: SKU=NotProvided;ModelName=PowerEdge R720
    Product Name: 0DCWD1
CPU Info:
      Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz
      Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz
Disk Info:
    Disk /dev/sda: 1074GB
    Disk /dev/sdb: 18.9TB
Network Info:
01:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5720 Gigabit Ethernet PCIe
01:00.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5720 Gigabit Ethernet PCIe
02:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5720 Gigabit Ethernet PCIe
02:00.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5720 Gigabit Ethernet PCIe
Memory Info:
    Size: 16384 MB
    Size: 16384 MB
    Size: 16384 MB
    Size: 16384 MB
    Size: 16384 MB
    Size: 16384 MB
    Size: 16384 MB
    Size: 16384 MB
Memory number:8

 

 

转载自:

http://www.linuxidc.com/Linux/2015-12/126814.htm

posted @ 2019-05-31 15:48  augusite  阅读(3820)  评论(0编辑  收藏  举报