You are not logged in.

#1 2009-01-13 15:18:41

Stunix
Arch Linux f@h Team Member
From: Reading, UK
Registered: 2008-09-12
Posts: 17

Free RAM Slots? (Dmidecode lies!)

Hello All,

I am currently trying to script a distribution independent way of determining the number of used and free RAM slots in server/desktop systems. I have been using dmidecode as this appears to be in most distributions that I have come across, however I noticed a problem recently. When I swapped out two 2GB modules of RAM for four x 1GB RAM modules I tested that all modules were being recognised using dmidecode. The problem is that dmidecode still showed 4 x 2GB of ram instead of 2 x 2GB and 4 x 1GB. This of course means I need to find an alternative way of getting the RAM slot usage from linux machines - that doesn't suffer from this problem.

I'm hoping there is something I have missed about dmidecode or that there is a better option such as probing /proc or /sys but any suggestions are welcome. Please note that I would ideally like this to be distribution independent so things such as hwinfo (from SuSE) are not as desirable.

Cheers,

Offline

#2 2009-01-14 03:45:42

lonecat
Member
Registered: 2008-06-18
Posts: 32

Re: Free RAM Slots? (Dmidecode lies!)

try lshw (http://aur.archlinux.org/packages.php?ID=2082), install and run:

#lshw -C memory

and it should print something like this:

~$ sudo lshw -C memory
Contraseña:
  *-firmware              
       description: BIOS
       vendor: Phoenix Technologies LTD
       physical id: 0
       version: R2060J9 (02/28/2008)
       size: 101KiB
       capacity: 960KiB
       capabilities: pci pnp upgrade shadowing escd cdboot bootselect edd int9keyboard int10video acpi usb agp smartbattery biosbootspecification netboot
  *-cache:0
       description: L1 cache
       physical id: 5
       slot: L1 Cache
       size: 64KiB
       capacity: 64KiB
       capabilities: internal write-back data
  *-cache:1
       description: L2 cache
       physical id: 6
       slot: L2 Cache
       size: 1MiB
       capacity: 1MiB
       capabilities: burst internal write-back unified
  *-cache:2 DISABLED
       description: L3 cache
       physical id: 7
       slot: L3 Cache
  *-memory
       description: System Memory
       physical id: 9
       slot: System board or motherboard
       size: 1GiB
     *-bank:0
          description: SODIMM
          physical id: 0
          slot: SODIMM1
          size: 512MiB
          width: 64 bits
     *-bank:1
          description: SODIMM
          physical id: 1
          slot: SODIMM2
          size: 512MiB
          width: 64 bits
~$

Hope that helps

Offline

Board footer

Powered by FluxBB