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 : 

1. Check if two modules are loaded properly by,

     #lsmod | grep acpi


                 acpiphp                      43673  0
                 acpi_memhotplug        42199  0

If not loaded, follow below steps;


     #modprobe acpiphp
     #modprobe acpi_memhotplug


2. 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.



3. Make a shell script like "memory_online.sh" with below contents,

"for a in /sys/devices/system/memory/memory*/state; 
 do 
 echo 'online' > "$a" 
 done" and then
 "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

4. Give this script execution permission by,

    #chmod 777 memory_online.sh

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

   #free


Done.

Comments

  1. Hii which hardware supports memory Hot-Add

    ReplyDelete
  2. You can check it on VMware's Hardware Compatibility guide " www.vmware.com/go/hcl ".

    ReplyDelete
  3. Not working for me:
    -bash: echo: write error: Operation not permitted

    ReplyDelete
  4. me to having same error??

    echo: write error: Operation not permitted

    any pointers??

    ReplyDelete
  5. just reload acpi_memhotplug module

    ReplyDelete

Post a Comment

Popular posts from this blog

Recover or restore initramfs file in RHEL or CentOS 7

Space reclamation / UNMAP on RHEL or CentOS 7

How to recover /boot partition on RHEL or CentOS 7?