Check Memory Slots Linux

- The number of memory devices in the results of sudo dmidecode -type 17 is equal to the number of memory slots, so the command to print the number of RAM slots is: sudo dmidecode -type 17 grep 'Memory Device' -count The results of this command will be one integer number equal to the number of RAM slots.
 - Millions of customers have trusted the Crucial System Scanner to find memory and storage upgrades. In minutes, learn how much memory and storage your PC or Mac can support, then buy 100% guaranteed compatible upgrades with confidence.
 - I googled a lot but I can only find Windows tools, nothing for Linux. I need: - total number of memory slots on the mainboard - for each used slot: current module type, memory type, size and speed so I can make a shopping list for all the different needed memory modules. Example from AIDA32 (Windows tool).
 - Finding RAM size details in Linux for a System admin is very easy task. We can use free command to check how much RAM is present in our system. But when you want to find how many RAM/Memory sa lots are present in your system is bit tricky one. One way to do open your system and check what sa lots are there and how much RAM.
 
Red Hat Enterprise Linux ships a memory test tool called memtest86+. It is a bootable utility that tests physical memory by writing various patterns to it and reading them back. Since memtest86+ runs directly off the hardware it does not require any operating system support for execution.
Finding RAM size details in Linux for a System admin is very easy task. We can use free command to check how much RAM is present in our system. But when you want to find how many RAM/Memory sa lots are present in your system is bit tricky one. One way to do open your system and check what sa lots are there and how much RAM. Instead of doing this as a Hardware engineer we can use a command to check which sa lot is having below details.
- How much RAM
 - Speed of the RAM
 - Maximum RAM supported by that machine
 - RAM location etc.
 
As you are already aware of dmidecode command to get all the system hardware info. We will use the same command for getting our RAM details.
To Find RAM details like maximum RAM, location of RAM etc we can use -t option with dmidecode as shown below
dmidecode -t 16
Output:
# dmidecode 2.11
SMBIOS 2.7 present.

Handle 0x000F, 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: No Error
 Number Of Devices: 2
If you see the above output we can figure it out how much maximum RAM this machine support, number of RAM devices and location etc.
To get actual RAM details such as how many sa lots, actual RAM present etc, use -t 17 option in dmidecode command
dmidecode -t 17

Output:
# dmidecode 2.11
SMBIOS 2.7 present.
Handle 0x0010, DMI type 17, 34 bytes
Memory Device
 Array Handle: 0x000F
 Error Information Handle: 0x0011
Total Width: 64 bit’s
 Data Width: 64 bit’s
 Size: 4096 MB
 Form Factor: SODIMM
 Set: None
 Locator: DIMM0
 Bank Locator: BANK 0
 Type: DDR3
 Type Detail: Synchronous
 Speed: 1333 MHz
 Manufacturer: Kingston
 Serial Number: 4B29A74B
 Asset Tag: 0123456789
 Part Number: 99U5428-046.A00LF 
 Rank: Unknown
 Configured Clock Speed: 1333 MHz
Handle 0x0013, DMI type 17, 34 bytes
Memory Device
 Array Handle: 0x000F
 Error Information Handle: 0x0014
 Total Width: 64 bit’s
 Data Width: 64 bit’s
 Size: 4096 MB
 Form Factor: SODIMM
 Set: None
 Locator: DIMM1
 Bank Locator: BANK 2
 Type: DDR3
 Type Detail: Synchronous
 Speed: 1333 MHz
 Manufacturer: Kingston
 Serial Number: 4729BF4B
 Asset Tag: 0123456789
 Part Number: 99U5428-046.A00LF 
 Rank: Unknown
 Configured Clock Speed: 1333 MHz
If we want to see complete RAM details we can use -t memory option to get the details. Note this is a combination of 16 and 17 options
dmidecode -t memory
Output:
# dmidecode 2.11
SMBIOS 2.7 present.
Handle 0x000F, 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: No Error
 Number Of Devices: 2
Handle 0x0010, DMI type 17, 34 bytes
Memory Device
 Array Handle: 0x000F
 Error Information Handle: 0x0011
 Total Width: 64 bit’s
 Data Width: 64 bit’s
 Size: 4096 MB
 Form Factor: SODIMM
 Set: None
 Locator: DIMM0
 Bank Locator: BANK 0
 Type: DDR3
 Type Detail: Synchronous
 Speed: 1333 MHz
 Manufacturer: Kingston
 Serial Number: 4B29A74B
 Asset Tag: 0123456789
 Part Number: 99U5428-046.A00LF 
 Rank: Unknown
 Configured Clock Speed: 1333 MHz
Handle 0x0013, DMI type 17, 34 bytes
Memory Device
 Array Handle: 0x000F
 Error Information Handle: 0x0014
 Total Width: 64 bit’s
 Data Width: 64 bit’s
 Size: 4096 MB
 Form Factor: SODIMM
 Set: None
 Locator: DIMM1
 Bank Locator: BANK 2
 Type: DDR3
 Type Detail: Synchronous
 Speed: 1333 MHz
 Manufacturer: Kingston
 Serial Number: 4729BF4B
 Asset Tag: 0123456789
 Part Number: 99U5428-046.A00LF 
 Rank: Unknown
 Configured Clock Speed: 1333 MHz
Some of the valid keywords/types you can use and find different details are as follows.
bios
system
 baseboard
 chassis
 processor
 memory
 cache
 connector
 sa lot
We can even use lshw command to get RAM/Memory details as well Cache details such as L1, L2 and L3 levels.
lshw -class memory
*-firmware 
 description: BIOS
 vendor: Hewlett-Packard
 physical id: 0
 version: F.22
 date: 07/27/2011
 size: 1MiB
 capacity: 2496KiB
 capabilities: pci upgrade shadowing cdboot bootselect edd int13floppynec int13floppytoshiba int13floppy360 int13floppy1200 int13floppy720 int13floppy2880 int9keyboard int10video acpi usb biosbootspecification uefi
 *-memory
 description: System Memory
 physical id: f
 sa lot: System board or motherboard
 size: 8GiB
 *-bank:0
 description: SODIMM DDR3 Synchronous 1333 MHz (0.8 ns)
 product: 99U5428-046.A00LF
 vendor: Kingston
 physical id: 0
 serial: 4B29A74B
 sa lot: DIMM0
 size: 4GiB
 width: 64 bit’s
 clock: 1333MHz (0.8ns)
 *-bank:1
 description: SODIMM DDR3 Synchronous 1333 MHz (0.8 ns)
 product: 99U5428-046.A00LF
 vendor: Kingston
 physical id: 1
 serial: 4729BF4B
 sa lot: DIMM1
 size: 4GiB
 width: 64 bit’s
 clock: 1333MHz (0.8ns)
 *-cache:0
 description: L1 cache
 physical id: 1c
 sa lot: L1 Cache
 size: 32KiB
 capacity: 32KiB
 capabilities: synchronous internal write-through instruction
 *-cache:1
 description: L2 cache
 physical id: 1d
 sa lot: L2 Cache
 size: 256KiB
 capacity: 256KiB
 capabilities: synchronous internal write-through unified
 *-cache:2
 description: L3 cache
 physical id: 1e
 sa lot: L3 Cache
 size: 3MiB
 capacity: 3MiB
 capabilities: synchronous internal write-through unified
 *-cache
 description: L1 cache
 physical id: 1b
 sa lot: L1 Cache
 size: 32KiB
 capacity: 32KiB
 capabilities: synchronous internal write-through data
Do let us know if there is any way to find RAM sa lot details.
The following two tabs change content below.- Docker: How to copy files to/from docker container - June 30, 2020
 - Anisble: ERROR! unexpected parameter type in action: 
Fix - June 29, 2020 - FREE: JOIN OUR DEVOPS TELEGRAM GROUPS - August 2, 2019
 - Review: Whizlabs Practice Tests for AWS Certified Solutions Architect Professional (CSAP) - August 27, 2018
 - How to use ohai/chef-shell to get node attributes - July 19, 2018
 
Here’s a useful way of finding out how many memory slots are occupied on the motherboard of a machine without removing the cover, as well as how much installed physical memory is supported.
We can use the dmidecode command to reveal your systems DMI table, which contains details of the systems hardware.
There are a whole load of DMI types we can look at – a full table of those at the end of this article.
In this particular case, we are interested in memory – type 16 ‘Physical Memory Array’ will show us how much memory is supported and DMI type 17 will reveal details of currently installed memory.
So, first off:-
dmidecode -t 16
Maximum Capacity shows us the maximum amount of memory can be installed in the machine. Number of devices tells us how many slots there are on the motherboard – in this case, 8.
Now we can interrogotate DMI type 17 – ‘Memory Device’ to show us details of installed memory
dmidecode -t 17
Each module installed will be listed with the the information given above. If we just want to know how many modules are installed and what size they are, we only really need the Size: – so we use grep
Check Memory Slots Linux Upgrade
dmidecode -t 17 grep Size
From this we can see that 8x 2048MB modules are installed – so all the slots on the motherboard are populated.
There is plenty of other useful information that can be retrieved using dmidecode, including
-t1 System
-t2 Base Board
-t3 Chassis
-t4 CPU
Check Memory Slots Linux Usb
-t9 PCI slots
Full SMIBIOS Specification
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
40 Additional Information
41 Onboard Device