+ -
当前位置:首页 → 问答吧 → 使用grub引导第二块硬盘上的Windows

使用grub引导第二块硬盘上的Windows

时间:2006-08-31

来源:互联网

  新添一块儿硬盘给Linux使用,在旧的硬盘上安装了windows,在BIOS中设置新硬盘为第一个硬盘,因此计算机默认从新硬盘启动,仍然使用grub作为loader。

  由于windows安装在第二块硬盘上,使用以前的方法来引导windows的时候并不能凑效:
  1. root (hd1,0)
  2. chainloader +1
复制代码
  查看了grub的文档,发现要引导DOS/Windows等系统时,如果其不在第一块硬盘上,还需要做一些特殊的设置,比如我的windows安装在第二块硬盘的第一个主分区上,我要使用grub来引导的话需要使用这样的grub命令:
  1. map (hd0) (hd1)
  2. map (hd1) (hd0)
  3. root (hd1,0)
  4. chainloader (hd1,0)+1
复制代码
  可以看出这两者的不同了吧?
  在这里使用了map命令,map命令用来把一个硬盘设备映射为另一个,官方文档中是这样写的:
  1. Map the drive from_drive to the drive to_drive. This is necessary when you chain-load some operating systems, such as DOS, if such an OS resides at a non-first drive.
复制代码
  chainloader的使用也有些不同,在这里要显式的指出windows所在的分区。

作者: 译元   发布时间: 2006-08-31

谢谢

作者: saber312   发布时间: 2011-12-25