Update
Works with Fedora 17
This is for dual boot os users, there are many who prefers dual boot to keep another OS optional. For any reason if you wish to change boot sequence unlike grub, grub2 requires couple of commands to run.
Here will take example to keep Windows as default boot.
First of all find menuentry for Windows
cat /boot/grub2/grub.cfg |grep Windows |
result:-
menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os { |
Set Windows menuentry as default (only entry mentioned in either " or ' from above command)
grub2-set-default "Windows 7 (loader) (on /dev/sda1)" |
Verify default entry
grub2-editenv list |
Generate updated grub.cfg
grub2-mkconfig -o /boot/grub2/grub.cfg |
Below is to set Fedora as default boot
cat /boot/grub2/grub.cfg |grep Fedora grub2-set-default "Fedora Linux, with Linux 3.1.0-5.fc16.i686" grub2-editenv list grub2-mkconfig -o /boot/grub2/grub.cfg |
————————————————————————————————————————————————
Update 2011-12-29
This one is dirty way to achieve purpose. Especially if above does not works.
e.g following err faced by one of commenter.
grub2-mkconfig -o /boot/grub2/grub.cfg
/sbin/grub2-probe: error: cannot stat `/dev/root’.
You need to do this after every new kernel installation, as it may change default entry.
vim /boot/grub2/grub.cfg
#replace
set default="${saved_entry}"
#with
set default="2"
Now check on reboot, third boot entry should be default for booting.
for grub first entry is 0, second is 1, third is 2 & so on.
To keep default=2 permanent even after new kernel installation
vim /etc/default/grub
#replace
GRUB_DEFAULT=saved
#with
GRUB_DEFAULT=2
Pingback: How to change boot sequence -Grub2 | Virtualize the World
Pingback: /dev/blog » Change GRUB2 default boot target
Pingback: Compiler Kernel 3.4.2 Stable on Fedora Core 17 | IT水電工-哆啦胖虎
Pingback: grub2 change default boot partition | wsinw.com
Pingback: grub2 change default boot partition | wsinw.com
Pingback: Fedora- How to change the boot order in Grub2 to Windows 7 « flyingpengwin