PDA

View Full Version : Grub menu



JohnnyF
26th March 2012, 06:44 AM
I was thinking that I would like to remove old linux entries from my Grub menu...I did it with Ubuntu but can't quite see how with Fedora. Thank you

diamond_ramsey
26th March 2012, 07:14 AM
I was thinking that I would like to remove old linux entries from my Grub menu...I did it with Ubuntu but can't quite see how with Fedora. Thank you

Which version of Fedora?

In my Fedora 15, I would update my grub.conf -

[root@localhost grub]# pwd
/boot/grub

[root@localhost grub]# ll grub.conf
-rw-------. 1 root root 1447 Mar 22 10:44 grub.conf

"...
title Fedora (2.6.42.12-1.fc15.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.42.12-1.fc15.x86_64 ro root=/dev/mapper/VolGroup-lv_
root rd_LVM_LV=VolGroup/lv_root rd_LVM_LV=VolGroup/lv_swap rd_NO_LUKS rd_NO_MD r
d_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet
initrd /initramfs-2.6.42.12-1.fc15.x86_64.img
title Fedora (2.6.42.10-3.fc15.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.42.10-3.fc15.x86_64 ro root=/dev/mapper/VolGroup-lv_..."

In Fedora 16 -

There is the /boot/grub2/grub.cfg file

Hope this helps. ;)

JohnnyF
26th March 2012, 07:20 AM
Thanks. I have been upgraded to F16. Would I use gedit to alter the grub.conf file? Thanks John

diamond_ramsey
26th March 2012, 07:40 AM
Thanks. I have been upgraded to F16. Would I use gedit to alter the grub.conf file? Thanks John

Good question, may need to check.

For Fedora 16 -

[root@localhost ~]# uname -airvn
Linux localhost.localdomain 3.3.0-4.fc16.x86_64 #1 SMP Tue Mar 20 18:05:40 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

* Do you have a Fedora 16 kernel installed?

[root@localhost ~]# more /boot/grub2/grub.cfg

"...
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Fedora (3.3.0-4.fc16.x86_64)' --class fedora --class gnu-linux --clas
s gnu --class os {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set root='(hd0,gpt2)'
search --no-floppy --fs-uuid --set=root 5976521c-e5cc-4f28-a4cd-69cf16c6
ffdd
echo 'Loading Fedora (3.3.0-4.fc16.x86_64)'
linux /vmlinuz-3.3.0-4.fc16.x86_64 root=/dev/mapper/VolGroup-lv_root r
o rd.md=0 rd.dm=0 rd.lvm.lv=VolGroup/lv_swap KEYTABLE=us quiet SYSFONT=latarcyr
heb-sun16 rhgb rd.lvm.lv=VolGroup/lv_root rd.luks=0 LANG=en_US.UTF-8
echo 'Loading initial ramdisk ...'
initrd /initramfs-3.3.0-4.fc16.x86_64.img
}
..."

JohnnyF
26th March 2012, 08:02 AM
Gosh! I thought that if I opened the grub.conf I would be able to delete those lines not needed, however, gedit won't let me open the file (restricted) so I would have to edit via the terminal. I will re-read your directions to see if I understand what I am going to do....:blink:

marriedto51
26th March 2012, 10:07 AM
Yes, (annoyingly) by default the grub.cfg file is set as read-only even for root. You can fix that first with

su -c 'chmod 600 /boot/grub2/grub.cfg'
After that, you can edit it with

su -c 'gedit /boot/grub2/grub.cfg'
but I would be very tempted to make a backup copy first in case a finger slips during the editing!

If you want to remove old versions of the linux kernel for Fedora, you can use

rpm -q kernel
to list which ones are installed, then remove the ones you don't need with something like

su -c 'yum erase kernel-3.1.0-7.fc16.x86_64 kernel-3.1.6-1.fc16.x86_64'
The removed kernels will be removed from the grub.cfg file without you needing to do that manually.