实测删除/boot的后果及解决方法

删除/boot的非常严重啦。以后一定要备份此目录。删除后重启系统提示截图如下:

    GNU GRUB  version 0.97  (637K lower / 2094976K 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.]


image.png


解决方法:

启动时选择BIOS设置,使用光盘启动进入救援模式(进入过程可看文章http://blog.51cto.com/12107790/2298347 前面部分)

其中有一个界面很重要,如下

使用chroot /mnt/sysimage 切换到自己的系统下。image.png


进行挂载光盘,mount /dev/sr0 /mnt.image.png


使用rpm -ivh /mnt/Packages/kernel-2.6.32-432.e16.x86_64.rpm --root=/mnt/sysimage/ --force 安装kernel内核image.png


安装完内核后,重启进入BIOS从硬盘启动进入grub界面(就是报错的界面)后

使用

grub>root  (hd0,)  #此时两次TAB键看到如下截图


image.png


grub>root  (hd0,0)/     #使用TAB看到如下截图

vmliuz  gurb initramfs信息说明是/boot分区。image.png


grub>root  (hd0,4)/   #使用TAB键看到如下信息 Possible files are: lost+found boot dev proc sys var tmp etc root selinux lib64 usr bin home lib media mnt opt sbin srv .autorelabel   说明是根目录咯。一定要记录此分区时/dev/sda5


grub>root  (hd0,0)   #绑定启动分区
grub>kernel /vmliuz-2.6.32-431.e16.x86_64 ro root=/dev/sda5     #启动内核为只读模式,注意root是根分区
grub>initrd /initramfs-2.6.32-431.e16.x86_64.img    #内核映射
grub>boot   #启动系统,开始恢复grub.conf文件

image.png



注意    加载内核时一定要注意root的路径要正确,否则会出现以下错误

dracut Warning: Signal caught!
?dracut Warning: Boot has faild. To debug this issue add "rdshell" to the kernel command line.
?Kernel panic - not syncing: Attempted to kill init!
?Pid: 1, comm: init Not tainted 2.6.32-504.e16.x86_64 #1
?Call Trace:
[<ffffffff815292bc] ? panic+0xa7/0x16f
? [<ffffffff815292bc] ? do_exit+0xa7/0x16f
? [<ffffffff815292bc] ? fput+0xa7/0x16f
? [<ffffffff815292bc] ? system_call_fastpath+0xa7/0x16f?
?


猜你喜欢

转载自blog.51cto.com/12107790/2300153