admin 管理员组文章数量: 1184232
Linux系统grub损坏修复案例
- /boot 目录清理后,grub损坏修复
- 现象
- 处理步骤
- 1)将光盘挂载,ESC后进入系统拯救模式
- 2)确认系统的根文件是否损坏,没有损坏,系统将会挂载到 /mnt/sysimage下,需要切换至系统中运行如下命令 chroot /mnt/sysimage
- 3)lsblk命令查看根文件在哪个磁盘以及分区中
- 4)重新安装grub , grub-install --root-directory=/ /dev/sda
- 5)将内核文件和initi镜像文件拷贝到/boot下面,以便grub识别
- 6)修改/boot/grub/grub.conf文件,注意Selinux=0
- 7)重启系统正常。
/boot 目录清理后,grub损坏修复
现象
处理步骤
1)将光盘挂载,ESC后进入系统拯救模式
2)确认系统的根文件是否损坏,没有损坏,系统将会挂载到 /mnt/sysimage下,需要切换至系统中运行如下命令 chroot /mnt/sysimage
3)lsblk命令查看根文件在哪个磁盘以及分区中
4)重新安装grub , grub-install --root-directory=/ /dev/sda
5)将内核文件和initi镜像文件拷贝到/boot下面,以便grub识别
cp /boot/grub/initramfs*.img /boot/grub/vmlinux* /boot
6)修改/boot/grub/grub.conf文件,注意Selinux=0
# 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 (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/vg_host70-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux (2.6.32-431.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/vg_host70-lv_root rd_NO_LUKS crashkernel=auto rd_LVM_LV=vg_host70/lv_swap rd_NO_MD rd_LVM_LV=vg_host70/lv_root LANG=zh_CN.UTF-8 KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet selinux=0
initrd /initramfs-2.6.32-431.el6.x86_64.img
# 其中root以实际系统分区为准
7)重启系统正常。
版权声明:本文标题:Linux系统grub损坏修复案例 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/b/1766139342a3440943.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论