博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux启动报错missing operating system
阅读量:4658 次
发布时间:2019-06-09

本文共 3388 字,大约阅读时间需要 11 分钟。

     用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,然后按照上面操作解决问题。

 

 

 

参考资料:

 

转载于:https://www.cnblogs.com/kerrycode/p/5764017.html

你可能感兴趣的文章
HTML5与CSS3权威指南之CSS3学习记录
查看>>
docker安装部署
查看>>
AVL树、splay树(伸展树)和红黑树比较
查看>>
多媒体音量条显示异常跳动
查看>>
运算符及题目(2017.1.8)
查看>>
ssh自动分发密匙脚本样板
查看>>
转 小辉_Ray CORS(跨域资源共享)
查看>>
Linux安装postgresql
查看>>
MyBatis启动:MapperStatement创建
查看>>
【 全干货 】5 分钟带你看懂 Docker !
查看>>
[转]优化Flash性能
查看>>
popStar手机游戏机机对战程序
查看>>
lambda表达式树
查看>>
二次注入原理及防御
查看>>
会话记住已登录功能
查看>>
Linux内核分析——可执行程序的装载
查看>>
第一阶段冲刺3
查看>>
父类引用指向子类对象
查看>>
网页如何实现下载功能
查看>>
IT男专用表白程序
查看>>