歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux服務器 >> 利用Boot Manager讓Vista與Linux雙啟動

利用Boot Manager讓Vista與Linux雙啟動

日期:2017/3/2 16:55:20   编辑: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 © Linux教程網 All Rights Reserved