menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os { insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)' search --no-floppy --fs-uuid --set=root AAAAAAAAAA
chainloader +1
}
NOTICE
其中 AAAAAAAA 为Filesystem UUID,使用以下命令替换对应的UUID
1
blkid|grep sda1
blkid命令是‘定位/打印块设备属性’的作用
最后
1
sudo update-grub
打印出
1234567
Generating grub.cfg ...
Found background image: /home/grub.png
Found linux image: /boot/vmlinuz-3.2.0-52-generic
Found initrd image: /boot/initrd.img-3.2.0-52-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
done