如何确定正在使用的RAM插槽数?


127

我忘记了笔记本电脑上安装了多少个RAM模块。我不想拧开它,而是想使用bash在控制台上查找它。我如何收集这些信息?

Answers:


180

既然您没有提到,我假设这是在Linux上。

dmidecode -t memory
dmidecode -t 16
lshw -class memory

6
lshw做到了。
k0pernikus 2012年

5
您仍然需要使用sudo这些命令或以其为root。
HSchmale,

@HSchmale,对,没有sudo,它不会提供非常详细的报告。只是基本的东西。
alfC

30

让不那么精通Shell的用户轻松使用它:

sudo dmidecode -t memory | grep -i size

我的笔记本电脑上的输出为:

Size: 2048 MB
Size: 1024 MB

...表明我已经安装了一个1GB模块和一个2GB模块。


10

就我而言

#dmidecode -t 16

报告此:

Handle 0x000A, DMI type 16, 23 bytes
Physical Memory Array
        Location: System Board Or Motherboard
        Use: System Memory
        Error Correction Type: None
        Maximum Capacity: 16 GB
        Error Information Handle: Not Provided
        Number Of Devices: 2

我想指出的是,一个模块中只有4 GiB的RAM。该信息通过执行以下操作显示:

 # dmidecode -t 17

显示如下:

# dmidecode 2.11
SMBIOS 2.7 present.

Handle 0x000B, DMI type 17, 34 bytes
Memory Device
    Array Handle: 0x000A
    Error Information Handle: Not Provided
    Total Width: Unknown
    Data Width: Unknown
    Size: No Module Installed
    Form Factor: DIMM
    Set: None
    Locator: ChannelA-DIMM0
    Bank Locator: BANK 0
    Type: Unknown
    Type Detail: None
    Speed: Unknown
    Manufacturer: Not Specified
    Serial Number: Not Specified
    Asset Tag: None
    Part Number: Not Specified
    Rank: Unknown
    Configured Clock Speed: Unknown

Handle 0x000C, DMI type 17, 34 bytes
Memory Device
    Array Handle: 0x000A
    Error Information Handle: Not Provided
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 4096 MB
    Form Factor: SODIMM
    Set: None
    Locator: ChannelB-DIMM0
    Bank Locator: BANK 2
    Type: DDR3
    Type Detail: Synchronous
    Speed: 1600 MHz
    Manufacturer: Hynix/Hyundai
    Serial Number: 11111111
    Asset Tag: None
    Part Number: HMT351S6CFR8C-PB  
    Rank: Unknown
    Configured Clock Speed: 1600 MHz

而且,如您所见,Bank 2已满,Bank 0为空。板上只有两个RAM插槽,但它们必须是双通道。


3

尽管OP希望避免松动检查,但我强烈建议每个人都这样做,因为命令行探针返回的答案可能会产生误导。在我的笔记本电脑上,命令行探针说我有4个插槽(已使用2个,其中2个为空),但拧开后实际上有2个插槽(也许在其他位置有2个隐藏的插槽,但看不到底部面板):

sudo dmidecode | grep -A 9 "System Information"
System Information
    Manufacturer: Micro-Star International Co., Ltd.
    Product Name: CX61 0NC/CX61 0ND/CX61 0NF/CX61 0NE
    Version: REV:1.0
    Serial Number: FFFFFFFF
    UUID: 03000200-0400-0500-0006-000700080009
    Wake-up Type: Power Switch
    SKU Number: To be filled by O.E.M.
    Family: To be filled by O.E.M.


# -------

sudo dmidecode -t 16
# dmidecode 2.12
SMBIOS 2.7 present.

Handle 0x0024, DMI type 16, 23 bytes
Physical Memory Array
    Location: System Board Or Motherboard
    Use: System Memory
    Error Correction Type: None
    Maximum Capacity: 32 GB
    Error Information Handle: Not Provided
    Number Of Devices: 4


# -------


sudo dmidecode -t 17
# dmidecode 2.12
SMBIOS 2.7 present.

Handle 0x0025, DMI type 17, 34 bytes
Memory Device
    Array Handle: 0x0024
    Error Information Handle: Not Provided
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 4096 MB
    Form Factor: SODIMM
    Set: None
    Locator: ChannelA-DIMM0
    Bank Locator: BANK 0
    Type: DDR3
    Type Detail: Synchronous
    Speed: 1600 MHz
    Manufacturer: 830B
    Serial Number: 91D82E7B
    Asset Tag: 9876543210
    Part Number: M2S4G64CB8HG4N-DI 
    Rank: 2
    Configured Clock Speed: 1600 MHz

Handle 0x0027, DMI type 17, 34 bytes
Memory Device
    Array Handle: 0x0024
    Error Information Handle: Not Provided
    Total Width: Unknown
    Data Width: Unknown
    Size: No Module Installed
    Form Factor: DIMM
    Set: None
    Locator: ChannelA-DIMM1
    Bank Locator: BANK 1
    Type: Unknown
    Type Detail: None
    Speed: Unknown
    Manufacturer: [Empty]
    Serial Number: [Empty]
    Asset Tag: 9876543210
    Part Number: [Empty]
    Rank: Unknown
    Configured Clock Speed: Unknown

Handle 0x0028, DMI type 17, 34 bytes
Memory Device
    Array Handle: 0x0024
    Error Information Handle: Not Provided
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 4096 MB
    Form Factor: SODIMM
    Set: None
    Locator: ChannelB-DIMM0
    Bank Locator: BANK 2
    Type: DDR3
    Type Detail: Synchronous
    Speed: 1600 MHz
    Manufacturer: 830B
    Serial Number: 20DC2E7C
    Asset Tag: 9876543210
    Part Number: M2S4G64CB8HG4N-DI 
    Rank: 2
    Configured Clock Speed: 1600 MHz

Handle 0x002A, DMI type 17, 34 bytes
Memory Device
    Array Handle: 0x0024
    Error Information Handle: Not Provided
    Total Width: Unknown
    Data Width: Unknown
    Size: No Module Installed
    Form Factor: DIMM
    Set: None
    Locator: ChannelB-DIMM1
    Bank Locator: BANK 3
    Type: Unknown
    Type Detail: None
    Speed: Unknown
    Manufacturer: [Empty]
    Serial Number: [Empty]
    Asset Tag: 9876543210
    Part Number: [Empty]
    Rank: Unknown
    Configured Clock Speed: Unknown

Ubuntu 14.04


您在哪里看到4个已安装的模块?-t 17清楚地显示了2个每个4GB的模块和2个未使用(可能未实现)的插槽。
Dani_l 2015年

@Dani_l,您能详细说明“未安装模块”是什么意思吗?我认为这意味着您有地方可以放空您的ram,但OP似乎不是这样...您能详细说明一下吗?我们仅仅是凡人
就能

4
@azorius (and probably unimplemented)表示bios /芯片组可以处理4个插槽,但是主板制造商决定不将bios可以支持的2个可能的插槽包括在实际的MB中。由于dmidecode与bios对话,而不是与实际的物理螺钉,螺栓和胶水对话,因此它仅知道dmi表中的内容-它可以处理4个插槽,但其中2个没有信息,因此假设是它们只是被卸载,而不是不存在。
Dani_l

3

这样可以更轻松地了解您需要了解的内容(为清楚起见,插入了空行):

$ sudo dmidecode -t memory | grep -iE "Size|Type:|Speed"

Error Correction Type: None

Size: No Module Installed
Type: Unknown
Speed: Unknown
Configured Clock Speed: Unknown

Size: 4096 MB
Type: DDR3
Speed: 1600 MHz
Configured Clock Speed: 1600 MHz

Size: No Module Installed
Type: Unknown
Speed: Unknown
Configured Clock Speed: Unknown

Size: 4096 MB
Type: DDR3
Speed: 1600 MHz
Configured Clock Speed: 1600 MHz

2
这不会为现有答案添加任何内容
Fox

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.