最新消息:

Fedora 21 改变启动顺序以及grub2 配置技巧

Linux 梧桐 20098浏览 0评论

1. 首先找到Windows的menuentry.

cat /boot/grub2/grub.cfg | grep Windows

2.  设置Windows 作为默认的启动项(这儿只能使用上面命令输出中双引号 “ ” 或者单引号 ‘ ‘ 中的内容)

sudo grub2-set-default 'Windows 7 (loader) (on /dev/sda1)'

3. 验证默认启动项

sudo grub2-editenv list

4. 生成,更新grub.cfg (可选)

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

 

 

注:不过,在fedora 21 里,上面的方法不管用。我用了最原始的方法

直接修改/boot/grub2/grbu.cfg文件。

sudo gedit /boot/grub2/grbu.cfg

将windows系统这段

menuentry ‘Windows 7 (loader) (on /dev/sda1)’ –class windows –class os $menuentry_id_option ‘osprober-chain-84E2D562E2D558CE’ {
insmod part_msdos
insmod ntfs
set root=’hd0,msdos1′
if [ x$feature_platform_search_hint = xy ]; then
search –no-floppy –fs-uuid –set=root –hint-ieee1275=’ieee1275//disk@0,msdos1′ –hint-bios=hd0,msdos1 –hint-efi=hd0,msdos1 –hint-baremetal=ahci0,msdos1 –hint=’hd0,msdos1′ 84E2D562E2D558CE
else
search –no-floppy –fs-uuid –set=root 84E2D562E2D558CE
fi
parttool ${root} hidden-
chainloader +1
}

剪切到原第一启动项的前面。

menuentry ‘Fedora (3.18.7-200.fc21.i686) 21 (Twenty One)’ –class fedora –class gnu-linux –class gnu –class os –unrestricted $menuentry_id_option ‘gnulinux-3.17.4-301.fc21.i686-advanced-23717a1d-ab24-445d-81f1-6ebdf47a8a26′ {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root=’hd0,msdos8′
if [ x$feature_platform_search_hint = xy ]; then
search –no-floppy –fs-uuid –set=root –hint-ieee1275=’ieee1275//disk@0,msdos8′ –hint-bios=hd0,msdos8 –hint-efi=hd0,msdos8 –hint-baremetal=ahci0,msdos8 –hint=’hd0,msdos8’ 8d1f190b-cf9d-49a4-ac86-e8eaa83d9c21
else
search –no-floppy –fs-uuid –set=root 8d1f190b-cf9d-49a4-ac86-e8eaa83d9c21
fi
linux16 /vmlinuz-3.18.7-200.fc21.i686 root=UUID=23717a1d-ab24-445d-81f1-6ebdf47a8a26 ro rhgb quiet LANG=zh_CN.UTF-8
initrd16 /initramfs-3.18.7-200.fc21.i686.img
}

这样,就是默认win7启动了

fedora-penguin

 

转载请注明:八度生活 » Fedora 21 改变启动顺序以及grub2 配置技巧

您必须 登录 才能发表评论!