红联Linux门户
Linux帮助

求助,双硬盘双系统启动

发布时间:2009-07-16 03:55:06来源:红联作者:luoqindong
大家好!
我有两个硬盘,一个是IDE,另一个是SATA的,我在IDE硬盘上装了RHEL5,串口的硬盘装了windows xp,在bios下设置IDE或串口为第1启动盘时,两个系统都可以启动。但是这样太麻烦了,是否可以不用在bios里设置启动盘,用grub来引导(装在IDE硬盘的第一个分区上),让我选择启动任意的一个系统呢?下面是我修改过的grub.conf,但在选择xp启动里出错,恳请知道的各位网友帮忙看一下哪出错了。

......
//下面是我自己加的
title windows xp
root(hd1,0)
makeactive
chainloader +1
......
文章评论

共有 5 条评论

  1. 刘冲 于 2009-07-17 19:16:54发表:

    引用:
    大家好!
    我有两个硬盘,一个是IDE,另一个是SATA的,我在IDE硬盘上装了RHEL5,串口的硬盘装了windows xp,在bios下设置IDE或串口为第1启动盘时,两个系统都可以启动。但是这样太麻烦了,是否可以不用在bios里设 ...

    ......
    //下面是我自己加的
    title windows xp
    root(hd1,0)
    makeactive
    chainloader +1
    ......

    luoqindong 发表于 2009-7-16 03:55
    红色的地方错了,,按照楼主写的,应该是chainloader [color=Blue](hd1,0)+1[/color]

  2. luoqindong 于 2009-07-17 19:10:12发表:

    网址错了,不好意思,

    ///G:/RHEL/UbuntuFeisty%20-.mht(我保存在硬盘上的网页)应改为:
    http://ubuntuguide.org/wiki/Ubuntu:Feisty#How_to_identify_the_name_of_the_boot_drive_.28hd0.2C_hd1.2C_hd2.2C_etc.29

  3. luoqindong 于 2009-07-17 19:08:43发表:

    行了,在file:///G:/RHEL/UbuntuFeisty%20-.mht上有解决的办法,在“1.17 Boot Menu 下的 How to boot into Windows installed on a seperate SATA drive”小节下,不过都是英文,下面是英文原文:
    How to boot into Windows installed on a seperate SATA drive
    Read #General Notes
    Read #How to identify the name of the boot drive (hd0, hd1, hd2, etc)
    This configuration applies to people who have Linux installed on a IDE drive, and Windows installed on a seperate SATA. The IDE drive boots first, so we need to add an entry to the boot menu on the Linux disk. Here we assume the name of your Windows drive is hd1. If you are not sure, click the link above to find out.

    sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
    gksudo gedit /boot/grub/menu.lst
    Append the following lines at the end of file.
    title Windows XP on SATA drive
    map (hd0) (hd1)
    map (hd1) (hd0)
    chainloader (hd1,0)+1
    Save the edited file
    Finally, do
    sudo update-grub
    This will update the grub bootloader and finalize any changes you made

    这个是ubuntu下的解决方法,不过在RHEL5下也能用。,下面说一下注意事项:
    map (hd0) (hd1) --在map、(hd0) 、(hd1)三个之间有空格,(hd0)中,“hd0”与“(”,“)”之间 不能有空格,否则会出错。
    map (hd1) (hd0) --与上面的一样
    chainloader (hd1,0)+1 --“+1”直接在“(hd1,0)”后面,它们之间没有空格。

    在我的电脑里,hd0为IDE的硬盘,hd1为SATA的硬盘,在linux系统启动到选择菜单后按下“c”,可以进入grub,然后输入“root (hd0,0)”,会显示出该盘的格式为ext2,说明是IDE盘(我装linux在IDE上),输入“root (hd1,0)”,会显示出“unknow”之类的,记不清了,说明是SATA盘。

    在grub下,串口硬盘与并口硬盘用统一的命名方法,即都以hd开头。在进入linux系统以后,可以用“fdisk -l”命令查看可以作为启动盘的硬盘,在“1.17 Boot Menu ”里都说得很清楚了,自己看了,呵呵。

    在grub.conf下只要加入这段就可以选择从SATA盘启动了:
    title Windows XP on SATA drive
    map (hd0) (hd1)
    map (hd1) (hd0)
    chainloader (hd1,0)+1

  4. luoqindong 于 2009-07-17 00:06:51发表:

    好的谢谢!

  5. wangyu 于 2009-07-16 09:22:57发表:

    title windows xp
    root(sd1,0)
    makeactive
    chainloader +1
    不能保证可以,你试下吧