茫茫網海中的冷日 - 對這文章發表回應
茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1734070 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
IMG_60D_00021.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

對這文章發表回應

發表限制: 非會員 可以發表

發表者: 冷日 發表時間: 2010/5/18 13:38:50
由於重裝windows系統會破壞MBR中的grub,所以需要修復grub才能引導linux系統(俺用的是centos5.3,估計REDHAT和centos的5.X和4.X都可以使用此方法修復),最方便的修復是用centos的系統光盤,如果沒有光盤可以下載grub_for_dos-0.4.2.zip來處理。
先說系統光盤的處理方法:用系統光盤引導,來到問你是否檢查 cd media 時,選擇 「skip」 然後回車,再出現另一個界面時,同時按下ctrl alt F2 進入命令行模式。操作如下:
sh# grub
grub > find /grub/grub.conf
(hd0,7)
grub > root (hd0,7)
Filesystem type is ext2fs, partition type 0x83

grub > setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"...  15 sectors are embedded.
succeeded
Running "install /grub/stage1 (hd0) (hd0)1+15 p (hd0,7)/grub/stage2 /grub/grub
.conf"... succeeded
Done.

grub > quit
sh#

到此就修復成功了,直接重啟系統,就ok了。

接下來說說用 grub_for_dos 來處理,假設重裝了xp後(裝在c盤),現在只能進入xp系統,然後下載grub_for_dos-0.4.2.zip 並解壓到c:下,並將c:/menu.lst裡的內容清空;修改c:/boot.ini 在最後添加一行:c:\grldr="grub for dos" 重啟系統 選擇grub for dos 進入,會發現進入了 grub的命令模式
grub >
輸入如下內容:
grub > find /grub/grub.conf
(hd0,7)
grub > root (hd0,7)
Filesystem type is ext2fs, partition type 0x83

奇怪的是,用grub_for_dos時,setup (hd0) 命令有問題,最後顯示的錯誤信息是:
Notice: the two commands SETUP and INSTALL will be removed soon!
please use the OS utility to BOOTLACE.COM to install GRLDR boot record to the MBR or to the boot area of a specified partition.


failed
得,不懂,先不理了,引導linux啟動了 再用裡面的grub來安裝。
接著輸入:
grub > kernel  /vmlinuz-2.6.18-128.el5 ro root=LABEL=/
grub > initrd /initrd-2.6.18-128.el5.img
grub > boot

開始引導linux
註:「2.6.18-128.el5」 這部分會隨版本的不同而不同,如果你不知是什麼,請按 tab鍵吧 它會自動幫你補充
進入系統後,切換成root用戶,操作如下:
[root@mail ~]# grub
grub> root (hd0,7)
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"...  15 sectors are embedded.
succeeded
Running "install /grub/stage1 (hd0) (hd0)1+15 p (hd0,7)/grub/stage2 /grub/grub
.conf"... succeeded
Done.

grub> quit


ok 打完收工。重啟系統你就發現grub恢復過來了

原文出處:重装grub to MBR (reinstall grub to MBR)_DoubleLook_百度空间
內容圖示
url email imgsrc image code quote
樣本
bold italic underline linethrough   












 [詳情...]
validation picture

注意事項:
預覽不需輸入認證碼,僅真正發送文章時才會檢查驗證碼。
認證碼有效期10分鐘,若輸入資料超過10分鐘,請您備份內容後,重新整理本頁並貼回您的內容,再輸入驗證碼送出。

選項

Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|