Jump to content


Photo

Removing an OS from the GRUB boot loader.


  • Please log in to reply
4 replies to this topic

#1 Cardinal

Cardinal

    member

  • Members
  • 193 posts

Posted 21 November 2004 - 03:44 PM

Hello everyone.

I'm using Fedora Core 2 and updated the kernel with yum. When I reboot I notice an older version of the kernel is still showing in the boot screen.

I would like to edit the boot options so only the updated build of Fedora is shown and also XP, that is set up to dual boot. At the moment, I have three options to boot, I would like to change that to only show two. smile

Thanks in advance guys.

- Cardinal

#2 danleff

danleff

    Carpal Tunnel

  • Moderators
  • 2903 posts

Posted 22 November 2004 - 03:29 AM

It's actually good that the old kernel still shows. If something went wrong with the new kernel install, you have a fallback.

You can remove the lines for the old kernel from Grub, by editing the /boot/grub/menu.lst file. You can do this as root user either by using vim or konqueror as superuser.

What I do is get to a terminal, as root user and invoke konqueror (if you are using KDE). Keep hitting the back button, until you get to the main directory window. You will see the boot directory. Get in there, then grub. you will see the menu.lst file...double click on this and you can see the menu.

Be careful not to delete any of the information related to the new kernel, only the old kernel information. If you post the contents of this file (cut and paste to the forum), we can tell you what to delete. Save the file and your done!

You can also do this from the gui, in the control panel, which may be safer to do. I'll have to look this up, as I am rusty on this right now.

Before you do this, it is wise to make a boot floppy, just in case.

#3 Cardinal

Cardinal

    member

  • Members
  • 193 posts

Posted 22 November 2004 - 06:33 AM

Thanks for the reply Dan smile

Here is my menu.lst entries.

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd1,0)
# kernel /vmlinuz-version ro root=/dev/hdb2
# initrd /initrd-version.img
#boot=/dev/hda
default=3
timeout=10
splashimage=(hd1,0)/grub/splash.xpm.gz
title Fedora Core (2.6.9-1.3_FC2)
root (hd1,0)
kernel /vmlinuz-2.6.9-1.3_FC2 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.9-1.3_FC2.img
title Fedora Core (2.6.8-1.521)
root (hd1,0)
kernel /vmlinuz-2.6.8-1.521 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.8-1.521.img
title Fedora Core (2.6.5-1.358)
root (hd1,0)
kernel /vmlinuz-2.6.5-1.358 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.5-1.358.img
title Windows
rootnoverify (hd0,0)
chainloader +1


I'm pretty sure I know which entries to remove, do you think it's worth it? Your suggestion about leaving an entry as a 'fallback' seemed like a good idea. I'm really only doing it improve the appearance of the boot menu. I've been booting with the new kernel for a while now and it seems fine.

Anyway, thanks again.

#4 danleff

danleff

    Carpal Tunnel

  • Moderators
  • 2903 posts

Posted 22 November 2004 - 12:04 PM

What I did not mention, is hashing outthe entries as another option. This way, they are intact in the menu.lst, in case you need them later. Say, you find out that the new kernel has resulted in some piece of hardware not working. Rare, but it happens.

So, each kernel entry starts with title and ends with the initrd entry.

So, you can hash out each entry that you do not want like so;

#title Fedora Core (2.6.5-1.358)
#root (hd1,0)
#kernel /vmlinuz-2.6.5-1.358 ro root=LABEL=/ rhgb quiet
#initrd /initrd-2.6.5-1.358.img

Save the file and your done.

You can also edit the default=3 entry to change the default entry that is booted first (relevent to the number of booting entries that you have in Grub), if needed, but this is another matter.

This is different from Lilo, in that no further modifications are needed, such as running /sbin/lilo, after making changes to /etc/lilo itself.

#5 Cardinal

Cardinal

    member

  • Members
  • 193 posts

Posted 23 November 2004 - 03:44 PM

Thank you for that smile

It works fine. I'll send you some nice Karma for helping me wink






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

IPB Skin By Virteq