Saturday, December 19, 2009

Install PAE Kernel and Update Grub CentOS 5.x

On my new 32-bit CentOS 5.3 server with 4GIG of RAM only 3+ GIG are visible:

[root@server1 ~]# free -m
total used free shared buffers cached
Mem: 3280 275 3005 0 15 106
-/+ buffers/cache: 154 3126
Swap: 1788 0 1788
[root@server1 ~]# top
top - 19:19:01 up 4 min, 1 user, load average: 0.07, 0.27, 0.14
Tasks: 117 total, 2 running, 115 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni, 99.8%id, 0.2%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 3359720k total, 282788k used, 3076932k free, 15580k buffers
Swap: 1831400k total, 0k used, 1831400k free, 108888k cached

For x86 systems that support PAE, you will need to install the kernel-PAE package to see your RAM.

From CentOS 5 FAQ:

kernel-PAE (x86-only): Contains a kernel with support for 64GB of memory on x86 systems through Physical Address Extensions (PAE). Only x86 CPUs that support PAE can run this kernel. This kernel is provided because x86 systems can't address more than 4GB of memory without PAE extensions.

1. Install kernel-PAE:

[root@server1 ~]# yum install kernel-PAE

2. Update grub.conf to boot from PAE kernel. After installing, vi /boot/grub/grub.conf and look for the line "default=..".

The value determines the default boot kernel and the sequence begins with 0. Review the kernel titles and update the default to the PAE kernel you installed (0 in my case below) and :wq

[root@server1 ~]# vi /boot/grub/grub.conf

grub.conf generated by anaconda
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,0)
#          kernel /boot/vmlinuz-version ro root=/dev/md0
#          initrd /boot/initrd-version.img
title CentOS (2.6.18-164.9.1.el5PAE)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.18-164.9.1.el5PAE ro root=/dev/md0
        initrd /boot/initrd-2.6.18-164.9.1.el5PAE.img
title CentOS (2.6.18-8.el5)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.18-8.el5 ro root=/dev/md0
        initrd /boot/initrd-2.6.18-8.el5.img
"/boot/grub/grub.conf" 21L, 742C

3. Reboot and check:

[root@server1 ~]# free -m
total used free shared buffers cached
Mem: 4042 955 3087 0 175 583
-/+ buffers/cache: 196 3846
Swap: 4000 0 4000
[root@server1 ~]# top
top - 01:04:22 up 2 days, 2:34, 1 user, load average: 0.05, 0.16, 0.15
Tasks: 121 total, 1 running, 120 sleeping, 0 stopped, 0 zombie
Cpu(s): 6.1%us, 9.2%sy, 0.0%ni, 68.1%id, 0.8%wa, 0.4%hi, 15.3%si, 0.0%st
Mem: 4139764k total, 978236k used, 3161528k free, 179280k buffers
Swap: 4096440k total, 0k used, 4096440k free, 597708k cached

1 comment:

Anonymous said...

sweet thanks