CentOS在開(kāi)機(jī)的時(shí)候,突然出現(xiàn)了GRUB引導(dǎo)錯(cuò)誤,導(dǎo)致系統(tǒng)進(jìn)入不了,遇到這種情況很多人就束手無(wú)策了,其實(shí)這類(lèi)的問(wèn)題不難解決,下面小編就給大家介紹下CentOS開(kāi)機(jī)出現(xiàn)GRUB引導(dǎo)錯(cuò)誤的解決方法,希望對(duì)你有所幫助。

解決辦法:使用CentOS安裝光盤(pán)進(jìn)行開(kāi)機(jī)GRUB引導(dǎo)修復(fù)
具體操作:
使用CentOS系統(tǒng)光盤(pán)引導(dǎo)計(jì)算機(jī)(系統(tǒng)盤(pán)要與原來(lái)安裝的系統(tǒng)版本相同)
如下圖所示

按F5進(jìn)入系統(tǒng)修復(fù)模式,出現(xiàn)下面的界面

輸入:linux rescue 回車(chē)
默認(rèn)OK
選擇Continue出現(xiàn)下面的界面

輸入:chroot /mnt/sysimage ,回車(chē) #將當(dāng)前目錄切換到原來(lái)系統(tǒng)的根目錄

繼續(xù)輸入:grub 回車(chē),出現(xiàn)下面的界面

輸入:root (hd0,0) 回車(chē) #注意root與(hd0,0) 之間必須要有空格
繼續(xù)輸入:setup (hd0) 回車(chē) #注意root與(hd0) 之間必須要有空格
再次輸入:quit 回車(chē) #退出grub模式
最后輸入:reboot #重啟系統(tǒng)
拿出光盤(pán),grub修復(fù)完畢,可以正常進(jìn)入系統(tǒng)
備注:如果通過(guò)上面的操作還是無(wú)法正常進(jìn)入系統(tǒng)
可以在
輸入:chroot /mnt/sysimage 之后繼續(xù)輸入
vi /boot/grub/grub.conf #編輯,添加以下內(nèi)容(CentOS 5.9為例)
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda3
# initrd /initrd-version.img
#boot=/dev/sda1
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-348.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-348.el5 ro root=LABEL=/
initrd /initrd-2.6.18-348.el5.img
?。簑q! #保存退出
輸入:quit 回車(chē) #退出grub模式
輸入:reboot #重啟系統(tǒng)
一般都可修復(fù)成功,正常進(jìn)入系統(tǒng)。

如果系統(tǒng)是通過(guò)U盤(pán)安裝的,拔了U盤(pán)之后就進(jìn)不了系統(tǒng),插上U盤(pán)又可以正常啟動(dòng)
可以采用如下方法修復(fù)
插上U盤(pán),正常進(jìn)入系統(tǒng)
輸入:grub-install /dev/sda #安裝grub到sda
vi /boot/grub/device.map #編輯修改為
(hd0) /dev/sda
之前可能為:
?。╤d1) /dev/sda
?。╤d0) /dev/sdb
vi /boot/grub/grub.conf #編輯修改里面的(hd1,0)為(hd0,0)
title CentOS (2.6.18-348.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-348.el5 ro root=LABEL=/
initrd /initrd-2.6.18-348.el5.img
后面的全部刪除
保存后重啟,拿掉U盤(pán),即可正常進(jìn)入系統(tǒng)。
上面就是CentOS出現(xiàn)GRUB引導(dǎo)錯(cuò)誤的解決方法介紹了,遇到這個(gè)問(wèn)題需要使用CentOS光盤(pán)進(jìn)行g(shù)rub引導(dǎo)修復(fù),按照文章的步驟,問(wèn)題輕松解決。