Ubuntu – Check the amount of RAM on the server

ramserver

Is there a way to check a server (without opening it up and physically looking) at the amount of ram that is in the box in terms of how many slots are free. Also I need to know how much ram it could possibly take?

I know I can check /proc/meminfo for the RAM but I'm really more concerned with the type of ram how many slots are free/taken. i.e. I need to know how much ram I can add and what type to add to a particular but have no idea how to go about doing so.

Best Answer

One nice tool (in addition to dmidecode) is lshw.

E.g.,

$ sudo lshw -short -C memory
H/W path               Device       Class      Description
==========================================================
/0/0                                memory     64KiB BIOS
/0/400/700                          memory     16KiB L1 cache
/0/400/701                          memory     1MiB L2 cache
/0/1000                             memory     2GiB System Memory
/0/1000/0                           memory     512MiB DIMM SDRAM Synchronous 400 MHz (2.5 
/0/1000/1                           memory     512MiB DIMM SDRAM Synchronous 400 MHz (2.5 
/0/1000/2                           memory     512MiB DIMM SDRAM Synchronous 400 MHz (2.5 
/0/1000/3                           memory     512MiB DIMM SDRAM Synchronous 400 MHz (2.5 

Or

$ sudo lshw -C memory
[...]

      *-cache:0
           description: L1 cache
           physical id: 700
           size: 16KiB
           capacity: 16KiB
           capabilities: internal write-back data
[...]
      *-memory
           description: System Memory
           physical id: 1000
           slot: System board or motherboard
           size: 2GiB
         *-bank:0
              description: DIMM SDRAM Synchronous 400 MHz (2.5 ns)
              physical id: 0
              slot: DIMM_1
              size: 512MiB
              width: 64 bits
              clock: 400MHz (2.5ns)
         *-bank:1
              description: DIMM SDRAM Synchronous 400 MHz (2.5 ns)
              physical id: 1
              slot: DIMM_3
              size: 512MiB
              width: 64 bits
              clock: 400MHz (2.5ns)
         *-bank:2
[...]
Related Question