找回密码
 
» Linux Fedora
查看: 566|回复: 1

Fedora

[复制链接]
Works with Fedora 20
Works with Fedora 17This 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 Fedoragrub2-set-default "Fedora Linux, with Linux 3.1.0-5.fc16.i686"grub2-editenv listgrub2-mkconfig -o /boot/grub2/grub.cfg
 楼主| jackyhwei 发表于 | 显示全部楼层
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

GMT,

Powered by Discuz!

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表