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
the output will be:
menuentry "Windows 7 (loader) (on /dev/sda1)" --clas-clss window -ass os {
To set Windows menuentry as default (only entry mentioned in either " or ' from above command)
I had problem using doubble quotes in the command line. The problem was resolved when in changed the keyboard type from "US" to "US(Engish)" using
#system-config-keyboard
To 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
If you get grub error "Environment block too small" then:
#rm -rf /boot/grub2/grubenv
and then rebuild it using
#grub2-editenv /boot/grub2/grubenv create
Now follow all the above steps.
Here will take example to keep Windows as default boot.
First of all find menuentry for Windows
#cat /boot/grub2/grub.cfg |grep Windows
the output will be:
menuentry "Windows 7 (loader) (on /dev/sda1)" --clas-clss window -ass os {
To set Windows menuentry as default (only entry mentioned in either " or ' from above command)
I had problem using doubble quotes in the command line. The problem was resolved when in changed the keyboard type from "US" to "US(Engish)" using
#system-config-keyboard
To 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
If you get grub error "Environment block too small" then:
#rm -rf /boot/grub2/grubenv
and then rebuild it using
#grub2-editenv /boot/grub2/grubenv create
Now follow all the above steps.
No comments:
Post a Comment