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

Google 自訂搜尋

Goole 廣告

隨機相片
F09_335.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

小企鵝開談 : [教學]Linux Boot Rescue

發表者 討論內容
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15773
[教學]Linux Boot Rescue
http://mirror.xteamlinux.com.cn/CLDP/LILO-crash-rescue-HOWTO-1.html

http://cldp.linuxforum.net/HOWTO/admin/LILO-crash-rescue-HOWTO/

http://www.php5.idv.tw/documents/redhatTW/RHX86/s1-x86-bootloader.html
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15773
[轉貼]重建 GRUB (linux boot loader)
GRUB (GRand Unified Bootloader 縮寫) 是 linux 系統中常用的系統啟動軟體,另一個同功能的是 LILO (LInux LOader 縮寫),它的作用是接管 BIOS 交付控制權給作業系統時的第一個工作–把作業系統正確地從硬碟載入。通常一般使用者在用光碟裝完 linux 後,例如 ubuntu,系統就會自動裝好 GRUB,就像 Windows 系統一樣。然而如果有某種原因被毀損了,最常見的是在同個硬碟想有 dual system,先裝好 linux 再裝 Windows,Windows 會很不客氣毫不猶豫地直接蓋掉 GRUB,你的 linux 就此無法開機,這時就需要重建 GRUB 了…

如何重建 GRUB 的步驟如下:

•使用原來的 linux 安裝光碟開機。現代的系統都是 live-cd,即開機光碟 boot 完就是可操作的系統。
•開一個終端機程式,可以輸入命令。
•執行 sudo grub,回答密碼。
grub> find /boot/grub/stage1
它會找原來裝 GRUB 的硬碟分區,例如 (hd1,0),即第二個硬碟的第一個分區。
grub> root (hd1,0)
告訴它 linux root 在哪裡。
grub> setup (hd0)
安裝 GRUB 在第一個硬碟的 MBR (Master Boot Record)。把 Windows 的 bootloader 蓋掉… 之後可以在 GRUB menu 中加入進 Windows 系統的選項,本文不討論這個。
grub> quit
結束,這樣就完成 GRUB rebuild,可以 reboot 了。
另一作法是把 GRUB 安裝在硬碟分區裡,例如 grub> setup (hd1,0),安裝 GRUB 在第二個硬碟的第一個分區,而不是 MBR。這種方法可以使用 Windows 的 boot loader 來作 dual system 啟動,我就是這麼作的,下回再來介紹。

原文出處:重建 GRUB (linux boot loader)
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15773
[轉貼]重裝 grub to MBR (reinstall grub to MBR)
由於重裝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_百度空间
前一個主題 | 下一個主題 | 頁首 | | |



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