利用Boot Manager让Vista与Linux双启动


其实把Grub装在硬盘的MBR上就可以实现Windows和Linux的双启动。原先一直用Grub,但是Grub有一个缺点(其实是Windows的缺点)就是每次重装Windows都会把Grub覆盖。而Grub的恢复需要一张比较好的Linux安装光盘(比如Debian)或者带有Grub的系统修复光盘。
 
  其实Windows的Boot Manager也可以启动Linux的。首先需要将Grub装在具体的Linux分区上(而不是硬盘MBR上),一般Grub安装时会有这样的选项。也可以手动将Grub装在Linux分区上,如果你的linux分区是/dev/hda2,也就是Grub中的(hd0,0):
 
  # grub
 
  grub> setup (hd0,1)
 
  ……
 
  然后将/dev/hda2的头512 bytes读出来,写到文件linux.boot里(文件名随便取)。
 
  # dd if=/dev/hda2 of=linux.boot bs=512 count=1然后想办法把linux.boot转移到windows的分区上,NTFS分区不好写,比较合理的方法是在Linux下通过网络拷贝到别的机器,或者是拷贝到U盘上,然后回到Windows拷贝回来。假设将linux.boot拷贝到了C:\linux.boot.
 
  如果是Windows XP,接下来的双启动设置就很简单了,直接编辑C:\boot.ini文件,加上下面的内容就可以了:
 
  linux.boot="Linux"
 
  重新启动之后就可以看到Linux这个选项了,进入后应该出现Grub的菜单。但是Vista Boot Manager的配置没有这么简单。首先在命令行运行
 
  bcdedit /enum all | find "{ntldr}"如果结果返回 identifier {ntldr},就用方案B,否则用方案A.方案A:
 
  bcdedit /create {ntldr} /d "Linux"
 
  bcdedit /set {ntldr} device boot
 
  bcdedit /set {ntldr} path linux.bootbcdedit /displayorder {ntldr} /addlast
 
  方案B(注意要根据第一个命令返回结果做相应修改):
 
  C:>bcdedit /copy {ntldr} /d "Linux"
 
  The entry was successfully copied to {bcfa924e-07e0-11db-9d86-accf6fd346a1}.
 
  C:>bcdedit /set {bcfa924e-07e0-11db-9d86-accf6fd346a1} device boot
 
  The operation completed successfully.
 
  C:>bcdedit /set {bcfa924e-07e0-11db-9d86-accf6fd346a1} path linux.boot
 
  The operation completed successfully.
 
  C:>bcdedit /displayorder {bcfa924e-07e0-11db-9d86-accf6fd346a1} /addlast
 
  The operation completed successfully.
 
  重启之后就可以在Vista的启动界面看到Linux这个选项了 本文作者:
« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3