Linux Command Check Memory Slots
4/7/2022by admin
Linux Command Check Memory Slots Rating: 7,9/10 5841 votes
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. By far the easiest way to check the number of RAM slots currently in use in your machine without opening it up is to use the DMI Table Decoder command called dmidecode, which gives you a flat report. At the command prompt, type sudo dmidecode -t 16 and push enter. You’ll probably be asked for your administrator password.
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
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
-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
lspci stands for list pci. Think of this command as “ls” + “pci”.
This will display information about all the PCI bus in your server.
Apart from displaying information about the bus, it will also display information about all the hardware devices that are connected to your PCI and PCIe bus.
For example, it will display information about Ethernet cards, RAID controllers, Video cards, etc.
lspci utility is part of the pciutils package.
If you don’t have pciutilis, install it on your system as shown below.
1. Default Usage
By default it will display all the device information as shown below. The first field is the slot information in this format: [domain:]bus:device.function
In this example, since all the domain are 0, lspci will not display the domain.
Note: In all the examples below, we’ll be showing only partial output by picking couple of devices from the above list.
2. Dump PCI Info in Different Format
If you want to pass the output of the lspci command to a shell script, you may want to use -m option (or -mm option) as shown below.
This option is also helpful when you want to view the subsystem information. For example, for the RAID controller, the default output just says that is is using LSI Logic RAID controller. But, the following output displays the subsystem, which is DELL PERC H700 Integrated RAID controller system.
3. Output in Tree Format
The -t option will display the output in tree format with information about bus, and how devices are connected to those buses as shown below. The output will be only using the numerical ids.
4. Detailed Device Information
If you want to look into details of a particular device, use -v to get more information. This will display information about all the devices. The output of this command will be very long, and you need to scroll down and view the appropriate section.
For additional level for verbosity, you can use -vv or -vvv.
In the following example, I’ve given output of only the RAID controller device.
5. Display Device Codes in the Output
If you want to display the PCI vendor code, and the device code only as the numbers, use -n option. This will not lookup the PCI file to get the corresponding values for the numbers.
Linux Command To Check Memory Slots
If you want to display both the description and the number, use the option -nn as shown below.
6. Lookup a Specific Device
When you know the slot number in the domain:bus:slot.func format, you can query for a particular device as shown below. In the following example, we didn’t specify the domain number, as it is 0, which can be left out.
When you know the device number in the vendor:device format, you can query for a particular device as shown below.
If you know only either the vendor id, or the device id, you can omit the other id. For example, both the following command will return the same output as the above.
7. Display Kernel Drivers
This is very helpful when you like to know the name of the kernel module that will be handling the operations of a particular device. Please note that this option will work only on Kernel 2.6 version and above.
> Add your comment
If you enjoyed this article, you might also like..
Linux Command Check Memory Slots Vegas World
Next post: What is Cloud Computing? Introduction to Cloud Service Models
Linux Command Check Memory Slots Windows 10
Previous post: How to Combine Ping and Traceroute On Linux Using MTR Command Examples
Comments are closed.