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盘。
网上有些资料介绍了如何解决这个问题,就是插入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
最新文章
- 剑指Offer面试题:27.最小的k个数
- C#开发微信门户及应用(43)--微信各个项目模块的定义和相互关系
- CloudStack4.4安装 ubuntu14.04
- mysql的存储过程
- abs()函数的返回值问题
- 11.Java反射机制 哦对了,前面的序号来自随笔关于编程之路的思索第一篇
- lucas 定理学习
- Linux-Ubuntu 启用root账户
- java_io_操作封装
- 【HDOJ】4317 Unfair Nim
- Objective-C中的Block(闭包) (轉載)
- BZOJ 3998 [TJOI 2015] 弦论 解题报告
- 一个完善的ActiveX Web控件教程
- T4 Template Overview
- CodeForces 677D Vanya and Treasure
- 用makecert.exe生成一个自签名的证书
- 在SQL Server中实现关系模型
- Beta发布用户使用报告
- springboot项目如何打包成war包
- python生成exe文件
热门文章
- Cesium应用篇:3控件(2)BaseLayerPicker
- nodejs 代理 解决开发环境跨域问题
- jQuery网页版五子棋小游戏源码下载
- C#测试题若干,都是基础阿
- 异步编程系列06章 以Task为基础的异步模式(TAP)
- 自定义分页控件PageList
- .Net调用R语言
- C++_系列自学课程_第_10_课_表达式_《C++ Primer 第四版》
- Tomcat问题,不能正确访问http://localhost:8080/
- IT基础架构规划方案三(IT基础软件和系统规划)