How to enable Hot-add Memory in Linux RHEL 5 ? What if you have Hot-added memory in your RHEL 5 server but it's still displaying Last memory configuration ?

Step :

Check if the acpi modules are loaded
lsmod | grep acpi

You should see both ...

acpiphp                43673  0
acpi_memhotplug        42199  0

If not loaded,

 modprobe acpiphp
 modprobe acpi_memhotplug
  1. Now increase your server memory with Hot-add memory module. This will be done by Hardware engineer directly on the server, i am not talking about on OS level.

to determine which modules are offline

 grep offline /sys/devices/system/memory/memory*/state

execute either of the following to set the modules to be online

 for offline_module in `grep offline /sys/devices/system/memory/memory*/state | sed s/\:offline//g`
 do echo  "online" > $offline_module
 done
cat /sys/devices/system/memory/memory*/state

Save it & exit

For Ubuntu you have to try with another script as below,

#!/bin/sh
i=0
while [ $i -lt 4500 ]
do
   if [ -f /sys/devices/system/memory/memory$i/state ]
   then
      if grep "offline" /sys/devices/system/memory/memory$i/state
      then
         echo 'online' > /sys/devices/system/memory/memory$i/state
      fi
   fi
   i=`expr $i + 1`
done
  1. Give this script execution permission by,

    chmod 777 memory_online.sh

  2. Next execute it & check memory in either "/proc/meminfo" file or by below command

#free

Done.