歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> Linux啟動報錯missing operating system,missingoperating

Linux啟動報錯missing operating system,missingoperating

日期:2017/3/6 9:23:20   编辑:學習Linux

Linux啟動報錯missing operating system,missingoperating


Linux啟動報錯missing operating system,missingoperating


用UltraISO制作了一個Red Hat Enterprise Linux Server release 5.7系統的U盤啟動盤,然後在一台PC上安裝,由於安裝過程中在干別的事情,有些選項沒有細看。安裝完成後,啟動系統時報錯:missing operating system。

插上U盤,在BIOS裡面選擇從U盤啟動就能正常啟動系統,搜索了一些資料後,發現在安裝LINUX操作系統過程中,由於使用的是U盤方式安裝,引導的grub信息被默認安裝到了U盤中(很多時候沒有注意到這個),拔除U盤後,啟動過程無法讀取相應的啟動管理器的代碼信息,導致系統無法啟動。關於GRUB的介紹如下:

GRUB全稱為Grand Unified Boot Loader,是Linux操作系統主流的啟動引導管理器。主要作用是啟動和裝載Linux操作系統。系統啟動過程中一旦完成了BIOS自檢,GRUB會被立刻裝載。在GRUB裡面包含了可以載入操作系統的代碼以及將操作系統引導權傳遞給其他啟動引導管理器的代碼。GRUB可以允許用戶選擇使用不同的kernel啟動系統,或者在啟動系統的過程中設置不同的啟動參數。

於是特意重裝驗證一下,如下圖所示,在安裝過程中,Linux的grub安裝選項默認為“The GRUB boot loader will be installed on /dev/sdb"。這個/dev/sdb設備恰恰就是我的U盤。

網上有些資料介紹了如何解決這個問題,就是插入U盤,成功啟動操作系統後,在終端做下面操作

[root@localhost ~]# grub
Probing devices to guess BIOS drives. This may take a long time.
 
 
    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)
 
 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]
grub> root(hd0,0);
root(hd0,0);
 
Error 27: Unrecognized command
grub> root (hd0,0);
root (hd0,0);
 Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0)
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,0)/grub/stage2 /grub/grub.conf"... succeeded
Done.
grub> quit
quit
[root@localhost ~]# 

然後修改vi /etc/grub.conf文件中的hd1改為hd0, 我測試實驗當中,根本沒有/boot/gurb/grub.conf這個配置文件,不知是否與操作系統版本有關系。

[root@localhost ~]# vi /etc/grub.conf 
# 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 (hd1,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sdb
default=0
timeout=5
splashimage=(hd1,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-274.el5)
        root (hd1,0)
        kernel /vmlinuz-2.6.18-274.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-274.el5.img
title Other
        rootnoverify (hd1,3)
        chainloader +1
 
[root@localhost ~]# more /etc/grub.conf 
# 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 (hd1,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sdb
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-274.el5)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-274.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
        initrd /initrd-2.6.18-274.el5.img
title Other
        rootnoverify (hd0,3)
        chainloader +1

修改後重啟操作操作系統即可解決問題。另外測試過程中發現不用做grub任何操作,只需修改/etc/grub.conf 亦能解決問題。另外,我測試過程特意測試了一下選擇”No boot loader will be installed“, 安裝結束reboot,就會出現下面界面,可以進入grub,然後按照上面操作解決問題。

參考資料:

http://blog.sina.com.cn/s/blog_5e48f39c0100jmwp.html

http://www.cnblogs.com/darktime/p/3404584.html

http://xxxxxx/Linuxjc/1148872.html TechArticle

Copyright © Linux教程網 All Rights Reserved