1. 程式人生 > >U盤安裝Linux啟動失敗問題(grub)

U盤安裝Linux啟動失敗問題(grub)

使用U盤安裝Linux系統時,當安裝所有的包後,點選reboot重啟(重啟後還需要對系統進行時間,其他使用者等等的設定),發現啟動時進入了grub> 介面。原來是使用U盤進行Linux安裝時,預設啟動位置設在了U盤中。

         因此重啟系統,和安裝系統時使用快捷鍵(一般為F11)選擇USB方式啟動。然後進行Linux系統的進一步設定(系統時間,其他使用者名稱密碼等)。設定好後,Linux系統安裝完畢。

         但是現在存在一個問題,那就是系統每次重啟都需要從U盤進行啟動,造成很大的不便。那我們該怎麼進行修改呢。

         拔掉U盤,再次啟動系統,當出現grub>介面時,進行以下操作:

1、grub >root(hd0,0)   回車

2、grub>setup(hd0)    回車

3、grub>reboot        回車重啟系統

4、重啟後,會出現”Press anykey to continue…”.按任意鍵進入GRUB介面

5、進入GRUB介面後,按”e”進入編輯介面,然後再按”e”進入

grub edit> root (hd1,0)介面

6、修改grub edit> root(hd1,0) 為grub edit> root (hd0,0) 按回車鍵進入GRUB介面

7、在GRUB介面中按”b”就可以進行系統的啟動。

8、系統啟動成功後,修改/boot/grub/grub.conf檔案中(hd1,0) 改為(hd0,0)

# cat /boot/grub/grub.conf

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grubafter making changes to this file
# NOTICE: You have a /boot partition.  Thismeans that
#         all kernel and initrd paths are relative to /boot/, eg.
#         root (hd1,0)
#         kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#         initrd /initrd-version.img
#boot=/dev/sdb
default=0
timeout=5
splashimage=<strong style="background-color: rgb(255, 255, 255);"><span style="color:#ff0000;">(hd0,0)</span></strong>/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server(2.6.18-194.el5PAE)
        <strong><span style="color:#ff0000;"> root (hd0,0)</span></strong>
         kernel/vmlinuz-2.6.18-194.el5PAE ro root=/dev/VolGroup00/LogVol00 rhgb quiet
         initrd/initrd-2.6.18-194.el5PAE.img
title Other
         rootnoverify(hd0,3)
         chainloader+1


重啟系統進行驗證,檢視是否可以啟動成功。