Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

In my machine, I have installed 2 operating systems.

  • Windows 7
  • RHEL 5.6.

When I boot the machine, the grub presents me the screen with the list of operating systems available as,

  • Red Hat Enterprise Linux Server (2.6.18-348.12.1.el5PAE)
  • Red Hat Enterprise Linux Server (2.6.18-348.12.1.el5PAE)
  • Red Hat Enterprise Linux Server (2.6.18-308.16.1.el5PAE)
  • Windows 7

I get the same window/desktop when I boot using any of the three listed RHEL versions. I checked the /etc/grub.conf file and there I could see three listing of RHEL. The contents of that file are as below.

default=0
timeout=5
splashimage=(hd0,2)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-348.12.1.el5PAE)
        root (hd0,2)
        kernel /vmlinuz-2.6.18-348.12.1.el5PAE ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.18-348.12.1.el5PAE.img
title Red Hat Enterprise Linux Server (2.6.18-308.20.1.el5PAE)
        root (hd0,2)
        kernel /vmlinuz-2.6.18-308.20.1.el5PAE ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.18-308.20.1.el5PAE.img
title Red Hat Enterprise Linux Server (2.6.18-308.16.1.el5PAE)
        root (hd0,2)
        kernel /vmlinuz-2.6.18-308.16.1.el5PAE ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.18-308.16.1.el5PAE.img
title Windows 7
        rootnoverify (hd0,0)
        chainloader +1

My question is, why do we have 3 RHEL listed in the menu while I installed RHEL only once?

share|improve this question

2 Answers 2

up vote 7 down vote accepted

When you install a new kernel you will automatically get a new option added to GRUB. This is a mechanism to allow you to boot an alternate kernel in the event something breaks after an upgrade.

If everything is fine with your system you can safely remove the extra entries.

Quick edit: To be clear, these are not additional installations - only additional entries in the GRUB menu for different kernels. Look at the entries and notice the different versions listed after vmlinuz and initrd.

share|improve this answer
    
Thanks for clarifying the doubt. But what are the initrd and kernel entries? The boot will happen from the same place always right? So, how can the different versions of initd or kernel make sure that the system can boot properly in case of any failure? –  Ramesh Oct 16 '13 at 16:05
1  
+1 IMO it's a good idea to just leave the old entries; less hassle, greater saftey, and the updater will remove them after a while (I think on fedora it keeps the last three). They're harmless and they may be useful, e.g., in determining if a problem is caused by a kernel update. Stuff like that may not be noticeable right away, so it is hard to say definitively, "everything with the system is fine...". –  goldilocks Oct 16 '13 at 16:32
3  
@Ramesh: There are several reasons you might boot an alternate kernel: 1. The kernel file you normally boot got corrupted. 2. You have some multi-CPU problem, so you boot the uniprocessor (UP) kernel. 3. A new kernel you got via yum update contains a new bug, so you have to roll back to the old kernel. –  Warren Young Oct 16 '13 at 16:37
    
It's hard to explain briefly. You may want to check out the Wikipedia entry for GRUB to understand what exactly is happening. In a nutshell, "the boot" is happening in "different places" with those different places being the different vmlinuz, initrd, etc. GRUB locates these files and loads them accordingly. Windows has a similar process. –  esnyder Oct 16 '13 at 21:08

This is just backup entries of old kernels in case somehow the new kernel caused your system not to work properly. It allows you to revert and use an old kernel.

Right now you have three kernels. The kernels 2.6.18-308.16.1 and 2.6.18-308.20.1 are older than 2.6.18-348.12.1 and would only be needed if the most recent kernel caused problems.

Remove the old entries if everything is working correctly like below:

default=0
timeout=5
splashimage=(hd0,2)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-348.12.1.el5PAE)
        root (hd0,2)
        kernel /vmlinuz-2.6.18-348.12.1.el5PAE ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.18-348.12.1.el5PAE.img
title Windows 7
        rootnoverify (hd0,0)
        chainloader +1

If you want to you can also use yum to remove the old kernels as well but grub will still need to be modified manually as shown above.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.