浮沉不大什么意思:利用GRUB实现Linux和Windows双重启动

来源:百度文库 编辑:偶看新闻 时间:2024/05/05 02:34:50

利用GRUB实现Linux和Windows双重启动

发布日期:2011-07-21  编辑:No.Seven  来源:华诚同创  浏览次数:63 次 


我有两个硬盘,硬盘hda(即hd0)装的是Linux系统,硬盘hdb(即hd1)装的是Windows系统。
打开/boot/grub/grub.conf
在文件后面加上下面的语句:
title Windows 2003
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1
makeactive
boot
 
这样就可以实现了 
注意:命令与参数之间的空格;还有,上面的“chainloader +1”中,“chainloader”与“+1”
之间有空格,但“+1”的“+”和“1”之间是没有空格的。
 
rootnoverify (hd1,0)中的“0”表示第二块硬盘(hd1)的第一个分区(0),这里可依实际情况更改。至于Windows系统是FAT格式还是NTFS格式无关紧要,GRUB都能支持。
 
我的grub.conf全文如下:
#------------------------------------------------------------------------------
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hda2
# initrd /initrd-version.img
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-8)
root (hd0,0)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
initrd /initrd-2.4.20-8.img
title Windows 2003
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1
makeactive
boot
#------------------------------------------------------------------------------
 
注意各参数中间的空格:map空格(hd0)空格(hd1)
如果是两个系统都装在一个硬盘上,那就不需要用“map”这两行了,改成如下即可:
title windows 2003
root (hd0,4)
chainloader +1
makeactive
boot
# 或将“root (hd0,4)”改成“rootnoverify (hd0,4)”也是可以的
# 这里假设Windows系统装在第五个分区