一般安装Linux, Windows双系统都是先安装Windows然后安装Linux,这种情况下Grub会自动检测到Windows并添加到启动列表中。如果安装顺序颠倒则可以有以下解决方法:
- 安装Grub4Dos http://www.linuxidc.com/Linux/2009-01/18027.htm
- 使用Ubuntu LiveCD安装Grub到MBR
新版的Ubuntu使用的是Grub2,命令与Grub稍微有一些不同,大致操作如下
my-desktop:~$ sudo grub–setup –d /media/disk/boot/grub /dev/sda
其中disk和sda需要根据Linux所在硬盘进行调整。
以下是grub-setup的帮助信息
my-desktop:~$ sudo grub–setup —help
Usage: grub–setup [OPTION]… DEVICE
Set up images to boot from DEVICE.
DEVICE must be a GRUB device (e.g. `(hd0,1)‘).
-b, –boot-image=FILE use FILE as the boot image [default=boot.img]
-c, –core-image=FILE use FILE as the core image [default=core.img]
-d, –directory=DIR use GRUB files in the directory DIR [default=/boot/grub]
-m, –device-map=FILE use FILE as the device map [default=/boot/grub/device.map]
-r, –root-device=DEV use DEV as the root device [default=guessed]
-f, –force install even if problems are detected
-s, –skip-fs-probe do not probe for filesystems in DEVICE
-h, –help display this message and exit
-V, –version print version information and exit
-v, –verbose print verbose messages
Report bugs to <bug-grub@gnu.org>.