Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I forgot how many RAM modules are installed on my laptop. I do not want to unscrew it but want to look it up on the console using bash. How do I gather this information?

share|improve this question
up vote 64 down vote accepted

Since you don't mention, I'm assuming this is on Linux.

dmidecode -t memory
dmidecode -t 16
lshw -class memory
share|improve this answer
2  
+1 for dmidecode which is awesome. I would also add the correct number 16 instead of 6 + sudo. – user13742 Mar 2 '12 at 17:34
1  
lshw did the trick. – k0pernikus Mar 2 '12 at 22:36

Let's make it easy for Ubuntu (and maybe other distros') users:

sudo dmidecode -t memory | grep -i size

The output on my laptop would be:

Size: 2048 MB
Size: 1024 MB

...showing that I have one 1GB module and one 2GB module installed.

share|improve this answer

In my case,

#dmidecode -t 16

reports this:

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

I would like to point out that I have only 4 GiB of RAM in one module. That info is shown by doing:

 # dmidecode -t 17

this is shown:

# 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

And, as you can see, Bank 2 is full and Bank 0 empty. Board has only two slots for RAM, but they have to be double channel.

share|improve this answer

Even though the OP prefers to avoid unscrewing to physically inspect, I strongly suggest everyone do just that since the answer back from command line probes can be misleading. On my laptop, command line probes say I have 4 slots (2 used, 2 empty), yet upon unscrewing I actually have 2 slots (perhaps I have 2 hidden slots elsewhere yet not visible removing bottom panel) :

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

share|improve this answer
    
Where do you see 4 installed modules? -t 17 clearly shows 2 modules of 4GB each, and 2 unused (and probably unimplemented) slots. – Dani_l Oct 3 '15 at 1:12
    
@Dani_l, can you elaborate on what "No Module Installed" mean I would think it means you have a place to stick your ram that seems to be empty, but that seems to not be the case for OP... could you elaborate so us mere mortals understand – azorius Mar 16 at 11:33
    
@azorius (and probably unimplemented) means the bios/chipset can handle 4 slots, but the board manufacturer decided not to include 2 of the possible slots the bios can support in the physical realm that is the actual MB. Since dmidecode talks to the bios, rather than the actual physical screws,bolts and glue, it only knows what's in the dmi table - which is that it can handle 4 slots, but for 2 of them there is no info, so the assumption is that they are merely uninstalled, rather than non-existing. – Dani_l Mar 16 at 15:43
    
@Dani_l, thanks, that makes sense – azorius Mar 16 at 20:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.