您的位置:首页 > 运维架构 > Linux

Linux启动报错missing operating system

2016-08-12 10:36 267 查看
用UltraISO制作了一个RedHatEnterpriseLinuxServerrelease5.7系统的U盘启动盘,然后在一台PC上安装,由于安装过程中在干别的事情,有些选项没有细看。安装完成后,启动系统时报错:missingoperatingsystem。插上U盘,在BIOS里面选择从U盘启动就能正常启动系统,搜索了一些资料后,发现在安装LINUX操作系统过程中,由于使用的是U盘方式安装,引导的grub信息被默认安装到了U盘中(很多时候没有注意到这个),拔除U盘后,启动过程无法读取相应的启动管理器的代码信息,导致系统无法启动。关于GRUB的介绍如下:GRUB全称为GrandUnifiedBootLoader,是Linux操作系统主流的启动引导管理器。主要作用是启动和装载Linux操作系统。系统启动过程中一旦完成了BIOS自检,GRUB会被立刻装载。在GRUB里面包含了可以载入操作系统的代码以及将操作系统引导权传递给其他启动引导管理器的代码。GRUB可以允许用户选择使用不同的kernel启动系统,或者在启动系统的过程中设置不同的启动参数。于是特意重装验证一下,如下图所示,在安装过程中,Linux的grub安装选项默认为“TheGRUBbootloaderwillbeinstalledon/dev/sdb"。这个/dev/sdb设备恰恰就是我的U盘。

网上有些资料介绍了如何解决这个问题,就是插入U盘,成功启动操作系统后,在终端做下面操作

[root@localhost~]#grub
ProbingdevicestoguessBIOSdrives.Thismaytakealongtime.
GNUGRUBversion0.97(640Klower/3072Kuppermemory)
[MinimalBASH-likelineeditingissupported.Forthefirstword,TAB
listspossiblecommandcompletions.AnywhereelseTABliststhepossible
completionsofadevice/filename.]
grub>root(hd0,0);
root(hd0,0);
Error27:Unrecognizedcommand
grub>root(hd0,0);
root(hd0,0);
Filesystemtypeisext2fs,partitiontype0x83
grub>setup(hd0)
setup(hd0)
Checkingif"/boot/grub/stage1"exists...no
Checkingif"/grub/stage1"exists...yes
Checkingif"/grub/stage2"exists...yes
Checkingif"/grub/e2fs_stage1_5"exists...yes
Running"embed/grub/e2fs_stage1_5(hd0)"...15sectorsareembedded.
succeeded
Running"install/grub/stage1(hd0)(hd0)1+15p(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.confgeneratedbyanaconda
#
#Notethatyoudonothavetorerungrubaftermakingchangestothisfile
#NOTICE:Youhavea/bootpartition.Thismeansthat
#allkernelandinitrdpathsarerelativeto/boot/,eg.
#root(hd1,0)
#kernel/vmlinuz-versionroroot=/dev/VolGroup00/LogVol00
#initrd/initrd-version.img
#boot=/dev/sdb
default=0
timeout=5
splashimage=(hd1,0)/grub/splash.xpm.gz
hiddenmenu
titleRedHatEnterpriseLinuxServer(2.6.18-274.el5)
root(hd1,0)
kernel/vmlinuz-2.6.18-274.el5roroot=/dev/VolGroup00/LogVol00rhgbquiet
initrd/initrd-2.6.18-274.el5.img
titleOther
rootnoverify(hd1,3)
chainloader+1
[root@localhost~]#more/etc/grub.conf
#grub.confgeneratedbyanaconda
#
#Notethatyoudonothavetorerungrubaftermakingchangestothisfile
#NOTICE:Youhavea/bootpartition.Thismeansthat
#allkernelandinitrdpathsarerelativeto/boot/,eg.
#root(hd1,0)
#kernel/vmlinuz-versionroroot=/dev/VolGroup00/LogVol00
#initrd/initrd-version.img
#boot=/dev/sdb
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
titleRedHatEnterpriseLinuxServer(2.6.18-274.el5)
root(hd0,0)
kernel/vmlinuz-2.6.18-274.el5roroot=/dev/VolGroup00/LogVol00rhgbquiet
initrd/initrd-2.6.18-274.el5.img
titleOther
rootnoverify(hd0,3)
chainloader+1

修改后重启操作操作系统即可解决问题。另外测试过程中发现不用做grub任何操作,只需修改/etc/grub.conf亦能解决问题。另外,我测试过程特意测试了一下选择”Nobootloaderwillbeinstalled“,安装结束reboot,就会出现下面界面,可以进入grub,然后按照上面操作解决问题。






参考资料:
http://blog.sina.com.cn/s/blog_5e48f39c0100jmwp.html
http://www.cnblogs.com/darktime/p/3404584.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: