menuentry "Windows 7" {
insmod ntfs
set root=(hd0,1)
chainloader +1
}
(grub2从1计数,win7装在C盘上的可以在终端里输入 fdisk -l来确定下,一般win都是装在C的吧)
写入以下内容:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'Windows7'{
set root=(hd0,1)
chainloader +1
}
注释掉GRUB_DEFAULT=saved,在这一行的下面插入GRUB_DEFAULT='Windows 7',保存并退出
输出:
saved_entry=Windows 7
注释掉GRUB_DEFAULT=saved,在这一行的下面插入GRUB_DEFAULT='Windows 7',保存并退出
输出:
saved_entry=Windows 7