Search This Blog

Thursday, January 26, 2012

HowTo: Change default OS in Grub2 Fedora

Grub2 - FedoraProject

I'm having trouble with kmod-nvidia keeping up with the kernels. So I need to change the default OS more than I'd like on Fedora 16...

Note, the Grub2 rules for Ubuntu are different than Fedora, and conflict.

Whenever you change the drives or OS you need to generate a new configuration file.

grub2-mkconfig -o /boot/grub2/grub.cfg
  
It will display a list of OS files found, Windows and Linux.
Found linux image: /boot/vmlinuz-3.2.3-2.fc16.x86_64
Found initrd image: /boot/initramfs-3.2.3-2.fc16.x86_64.img
Found linux image: /boot/vmlinuz-3.1.9-1.fc16.x86_64
Found initrd image: /boot/initramfs-3.1.9-1.fc16.x86_64.img
Found Windows NT/2000/XP (loader) on /dev/sdc1
done


To list the found OS's:
grep menuentry /boot/grub2/grub.cfg

menuentry 'Fedora Linux, with Linux 3.2.3-2.fc16.x86_64' --class fedora --class gnu-linux --class gnu --class os {
menuentry 'Fedora Linux, with Linux 3.1.9-1.fc16.x86_64' --class fedora --class gnu-linux --class gnu --class os {
menuentry "Windows NT/2000/XP (loader) (on /dev/sdc1)" --class windows --class os {


To check, by name, the saved entry:
grub2-editenv list
saved_entry=Fedora Linux, with Linux 3.1.9-1.fc16.x86_64


If you have not changed disk drives or partitions, start here
To boot the previous OS (i.e. Linux 3.1.9-1):
grub2-set-default 1
 
To boot the usual OS: (once everything is working again)
grub2-set-default 0
 
 
</pre> with the title of the newly installed Fedora's entry. From that point on you can change the default by calling <pre>grub2-set-default <title or number></pre> or view it by running <pre>grub2-editenv list</pre> <p>To do that, you'll need the list of possible menu entries, which you can find with </p> <pre>grep menuentry /boot/grub2/grub.cfg<br /><br /><br /></pre><br />

No comments:

Post a Comment