Wednesday, 5 December 2012

How to install Linux PAE enabled kernel?



If you are testing 32-bit RHEL5, please make sure that we use PAE kernel instead of the default kernel that is installed.With the default kernel, 32-bit RHEL5 will not recognize more than 4GB of guest memory even though you configure it on the VM..
So please verify the following before you so the testing....

a) Check the kernel that is installed when you install the distribution
(RHEL5 32-bit & 64-bit)


[root@localhost ~]# uname -r
2.6.18-8.el5

The above output indicates that the kernel that is installed is neither PAE / huge mem kernel.


You can find the list of installed kernel using:

# rpm -qa | grep -i kernel

kernel-2.6.18-8.el5
kernel-headers-2.6.18-8.el5
kernel-devel-2.6.18-8.el5

For the guest to use more than 4GB, we need to install the PAE kernel (You will get that from RHEL5 CD1..)

rhel-5-server-i386-disc1.iso


c) Mount the cdrom

mount /dev/cdrom /mnt


d) You will see something similar to this:

# ls /mnt/Server/ | grep -i 2.6.18-8
kernel-2.6.18-8.el5.i686.rpm
kernel-devel-2.6.18-8.el5.i686.rpm
kernel-doc-2.6.18-8.el5.noarch.rpm
kernel-headers-2.6.18-8.el5.i386.rpm
kernel-PAE-2.6.18-8.el5.i686.rpm
kernel-PAE-devel-2.6.18-8.el5.i686.rpm
kernel-xen-2.6.18-8.el5.i686.rpm
kernel-xen-devel-2.6.18-8.el5.i686.rpm



At a shell prompt, change to the directory that contains the kernel RPM packages. Use -i argument with the rpm command to keep the old kernel.

Caution: Do not use the -U option, since it overwrites the currently installed kernel, which creates boot loader problems.

For example:

[root@localhost]# rpm -ivh kernel-PAE-2.6.18-8.el5.i686.rpm

warning: kernel-PAE-2.6.18-8.el5.i686.rpm: Header V3 DSA signature: NOKEY,
key ID 37017186
Preparing... ########################################### [100%]
1:kernel-PAE ########################################### [100%]


Verify the initial RAM disk image.

To verify that an initial RAM disk already exists, use the command ls -l /boot to make sure the initrd-.img file was created (the version should match the version of the kernel just installed).

# ls -l /boot/ | grep img

-rw------- 1 root root 2318314 Jun 2 06:41 initrd-2.6.18-8.el5.img
-rw------- 1 root root 2319154 Jun 4 08:18 initrd-2.6.18-8.el5PAE.img

This shows the new image that is created...

Verifying the boot loader..




[root@localhost]# cat /boot/grub/grub.conf | grep PAE
title Red Hat Enterprise Linux Server (2.6.18-8.el5PAE)
kernel /vmlinuz-2.6.18-8.el5PAE ro root=/dev/VolGroup00/LogVol00 rhgb
quiet
initrd /initrd-2.6.18-8.el5PAE.img


Done. Restart the guest and at the grub menu press the key "e" and select the PAE kernel.




[root@localhost ~]# uname -r
2.6.18-8.el5PAE



[root@localhost ~]# cat /proc/meminfo | grep -i memtotal

MemTotal: 4934652 kB (I set only 5GB and it should go upto 64GB


If you want to always boot with PAE kernel, please do the changes in /etc/grub.conf.

Edit /etc/grub.conf to make default=0 (on my server new kernel is 0th kernel).

This is how it looks like:

default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-8.el5PAE)
root (hd0,0)
kernel /vmlinuz-2.6.18-8.el5PAE ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-8.el5PAE.img

title Red Hat Enterprise Linux Server (2.6.18-8.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-8.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-8.el5.img

1 comment:

t3accademy said...

Thanks a lot for useful post....