Grub2
跳到导航
跳到搜索
默认启动Windows的例子:
1. 首先找到Windows的menuentry.
# cat /boot/grub2/grub.cfg | grep Windows menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {
2. 设置Windows 作为默认的启动项(这儿只能使用上面命令输出中双引号 “ ” 或者单引号 ‘ ‘ 中的内容)
# grub2-set-default "Windows 7 (loader) (on /dev/sda1)"
3. 验证默认启动项
# grub2-editenv list saved_entry=Windows 7 (loader) (on /dev/sda1)
4. 生成,更新 grub.cfg (可选)
# grub2-mkconfig -o /boot/grub2/grub.cfg
/etc/default/grub 中可以配置timeout,背景图片等。
如:
GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="Fedora" GRUB_DEFAULT=saved GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0 LANG=en_US.UTF-8" GRUB_BACKGROUND=/boot/grub2/background.png GRUB_TERMINAL_OUTPUT=gfxterm GRUB_THEME=/boot/grub2/mytheme/theme.tx