Chinaunix

标题: 双硬盘双系统启动问题 [打印本页]

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

......
//下面是我自己加的
title windows xp
       root(hd1,0)
       makeactive
       chainloader +1
......
作者: jine6666    时间: 2009-07-17 09:45
标题: 串口硬盘
串口硬盘应该是SD
作者: jine6666    时间: 2009-07-17 09:59
title windows xp

  rootnoverify (sd0,0)

  chainloader +1
作者: streetboy85    时间: 2009-07-17 10:48
好像执行grub-setup还是grub-install,grub会自动识别安装到的系统的,规则不用自己写
作者: luoqindong    时间: 2009-07-17 13:39
好的,谢谢大家!我试一下。
作者: phoenixson    时间: 2009-07-17 16:24
就知道胡说八道的
map (hd0) (hd1)
map (hd1) (hd0)
去试试吧
作者: luoqindong    时间: 2009-07-17 19:13
行了,在http://ubuntuguide.org/wiki/Ubun ... d1.2C_hd2.2C_etc.29上有解决的办法,在“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
作者: jerryjzm    时间: 2009-07-17 20:34
我就奇怪了,grub是指认到 hd(*,*)无论你是sada,pata,scsi那!
尽管linux中ide(pata)是hd,sata是sd
看来map,不错!
作者: ktaog6    时间: 2009-07-18 19:51
路过,学习
作者: kns1024wh    时间: 2009-07-29 11:35
标题: 回复 #1 luoqindong 的帖子
方式1
在linux中重新安装grub
方式2
使用windows中的grub for dos 调用linux的grub的引导的参数




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2