- 論壇徽章:
- 0
|
linux系統(tǒng)出現(xiàn)grub loading stage2 解決辦法
放入第一張光盤,重新啟動機器,在boot: linux rescue
進去后執(zhí)行出現(xiàn)Shell執(zhí)行
#chroot /mnt/sysimage
#/sbin/ grub-install /dev/hda(或者sda)
#exit
自己就重啟了。OK.
如果執(zhí)行g(shù)rub-install的,你會得到如下報錯:'/dev/hdx does not have any corresponding BIOS drive'.
解決方法:
請注意在執(zhí)行下述命令之前,確保你的關(guān)鍵數(shù)據(jù)有一個有效的當前備份,不管什么原因?qū)е履愕牡谝豢煊脖P無法引導(dǎo),你就需要使用Red Hat Enterprise Linux 的第一張安裝光盤引導(dǎo)系統(tǒng)進入RESCUE模式。
要想在RESCUE模式下運行g(shù)rub-install命令, 首先需要手動的mount相關(guān)的分區(qū)?梢酝ㄟ^fdisk -l 查看當前系統(tǒng)的分區(qū):
# fdisk -l
你需要手動的mount所有類型是Linux和Linux RAID autodetect的分區(qū),在如下的例子中,/boot分區(qū)是/dev/hda1, /分區(qū)是/dev/hda2。
Device Boot Start End Blocks Id System
/dev/hda1 1 13 104391 fd Linux raid autodetect
/dev/hda2 14 1288 10241437+ fd Linux raid autodetect
/dev/hda3 1289 1352 514080 82 Linux swap
在如下的樣例中,你可以通過如下命令掛載分區(qū):
# mkdir /mnt/sysimage
# mount /dev/hda2 /mnt/sysimage
# mount /dev/hda1 /mnt/sysimage/boot
# chroot /mnt/sysimage
下一個步驟是編輯文件/etc/grub.conf(或者是/boot/grub/grub.conf),按照下述描述取消文件中的一些注釋。
修改
#boot=/dev/hda
成為
boot=/dev/hda
重新運行命令grub去安裝GRUB到第二個硬盤的MBR上,從而使第二個硬盤可以引導(dǎo)。
# grub --batch --device-map=/boot/grub/device.map
--config-file=/boot/grub/grub.conf --no-floppy
在grub命令的提示下,執(zhí)行如下命令
grub> root (hd0,0)
grub> setup (hd0)
grub> quit
setup命令會把Grub寫入到MBR。使得第二塊硬盤可以引導(dǎo)。
----------------------
請大家注意以下信息。(troubleshooting了一晚上,就學(xué)到了這點體會)
附:
cat /boot/grub/device.map
(fd0) /dev/fd0
(hd0) /dev/cciss/c0d0
本文來自ChinaUnix博客,如果查看原文請點:http://blog.chinaunix.net/u2/60913/showart_1764631.html |
|