星空网 > 软件开发 > 操作系统

Linux启动报错missing operating system

     用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盘。

Linux启动报错missing operating system

 

网上有些资料介绍了如何解决这个问题,就是插入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 ~]# 


Linux启动报错missing operating system

 

然后修改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=(hd,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,然后按照上面操作解决问题。

 

Linux启动报错missing operating system

Linux启动报错missing operating system

 

 

参考资料:

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

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

 




原标题:Linux启动报错missing operating system

关键词:linux

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流