Removing an OS from the GRUB boot loader.
Posted 21 November 2004 - 03:44 PM
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.
Thanks in advance guys.
Posted 22 November 2004 - 03:29 AM
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.
Posted 22 November 2004 - 06:33 AM
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
title Fedora Core (2.6.9-1.3_FC2)
kernel /vmlinuz-2.6.9-1.3_FC2 ro root=LABEL=/ rhgb quiet
title Fedora Core (2.6.8-1.521)
kernel /vmlinuz-2.6.8-1.521 ro root=LABEL=/ rhgb quiet
title Fedora Core (2.6.5-1.358)
kernel /vmlinuz-2.6.5-1.358 ro root=LABEL=/ rhgb quiet
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.
Posted 22 November 2004 - 12:04 PM
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)
#kernel /vmlinuz-2.6.5-1.358 ro root=LABEL=/ rhgb quiet
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.