CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Centos下的rescue救援模式大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

【MBR故障】 用命令来把MBR的前446字节覆盖 Dd if=/dev/zero of=/dev/sda bs=446 count=1 结果:无法登录系统 1. 虚拟机进去bios,将CD-ROM Drive设置为第一启动项 2. 加载镜像文件,进入救援模式 3. 默认选项 4.  继续选择 5. 选择默认 6. 选择sHell编辑模式 7. 输入clear,回车清屏 8. chroot /mn

【MBR故障】

用命令来把MBR的前446字节覆盖

Dd if=/dev/zero of=/dev/sda bs=446 count=1

结果:无法登录系统

Centos下的rescue救援模式

@H_403_20@

1. 虚拟机进去bios,将CD-ROM Drive设置为第一启动项

Centos下的rescue救援模式

@H_403_20@

Centos下的rescue救援模式

@H_403_20@

2. 加载镜像文件,进入救援模式

Centos下的rescue救援模式

@H_403_20@

3. 认选项

Centos下的rescue救援模式

@H_403_20@

Centos下的rescue救援模式

@H_403_20@

4. 继续选择

Centos下的rescue救援模式

@H_403_20@

Centos下的rescue救援模式

@H_403_20@

5. 选择

Centos下的rescue救援模式

@H_403_20@

Centos下的rescue救援模式

@H_403_20@

6. 选择sHell编辑模式

Centos下的rescue救援模式

@H_403_20@

7. 输入clear,回车清屏

Centos下的rescue救援模式

@H_403_20@

@H_403_20@

8. chroot /mnt/sysimage,即切换到机器系统的根目录,改写MBR

命令 grub-install /dev/sda@H_403_20@

Centos下的rescue救援模式s.width=650;" src="http://img.code.cc/vcimg/static/loading.png" src="http://s3.51cto.com/wyfs02/M02/8D/5C/wKioL1iZi2TCTUfwAAAeysFHsWg369.png">

@H_403_20@

@H_403_20@

9. 输入两次exit命令,重启,成功登录

Centos下的rescue救援模式

@H_403_20@

@H_403_20@

@H_403_20@

【误删grub.conf文件救援】

@H_403_20@

1. 删除文件 rm -rf /boot/grub/grub.conf

@L_675_41@

@H_403_20@

2. 重启linux,无法登录系统

Centos下的rescue救援模式

@H_403_20@

3. 启动linux,通过kernel和initramfs

@H_403_20@

a. root (hd0,0) 系统的安装位置 注:root (hd0,按tab键,自动打印分区,0x83的分区都需测试

b. kernel /vmlinuz-2.6.18-8.el5注:输入/vmlinuz按tab健补全,表示测试正确

c. initrd/initrd-2.6.18-8.el5.img注:输入/init 按tab健可以补全

d. boot 启动

@H_403_20@

Centos下的rescue救援模式s.width=650;" src="http://img.code.cc/vcimg/static/loading.png" style="BACkground:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd;" src="http://huangzp.blog.51cto.come/u261/themes/default/images/spacer.gif">

Centos下的rescue救援模式

@H_403_20@

注:如启动不了,说明根分区选择错了(即/根分区和boot分区不在同一分区),需重新设置根分区:

root=/dev/sda3

说明:(hd0,0)=/dev/sda1 (hd0,2)=/dev/sda3

4. 成功登入系统

Centos下的rescue救援模式s.width=650;" src="http://img.code.cc/vcimg/static/loading.png" style="BACkground:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd;" src="http://huangzp.blog.51cto.come/u261/themes/default/images/spacer.gif">

@L_618_51@

@H_403_20@

5. 查看根分区uuid,用于创建grub配置文件

Centos下的rescue救援模式

@H_403_20@

6. 创建grub.conf文件

vim /boot/grub/grub.conf

Centos下的rescue救援模式s.width=650;" src="http://img.code.cc/vcimg/static/loading.png" style="BACkground:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd;" src="http://huangzp.blog.51cto.come/u261/themes/default/images/spacer.gif">

Centos下的rescue救援模式

@H_403_20@

配置文件详解:

default=0 //认系统列表的第一个启动

timeout=5 //认启动等待时间5秒

splashimage=(hd0,0)/grub/splash.xpm.gz //系统选择菜单背景所在的位置

hiddenmenu //隐藏菜单

title Re-system Centos 6.8 //在grub界面所显示的系统名称

root (hd0,0) //启动时从IDE接口的第一块硬盘第一个分区启动

kernel /vmlinuz-2.6.32-642.el6.x86_64 ro root=UUID=3fcf7112-c461-4d02-90b8-416b0d587856 //启动的内核版本,可以在后面添加内核参数

initrd /initramfs-2.6.32-642.el6.x86_64.img //加载的镜像文件

7. 重启,成功登入系统

Centos下的rescue救援模式s.width=650;" src="http://img.code.cc/vcimg/static/loading.png" style="BACkground:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd;" src="http://huangzp.blog.51cto.come/u261/themes/default/images/spacer.gif">

Centos下的rescue救援模式

@H_403_20@

【误删grub目录救援】

@H_403_20@

Centos下的rescue救援模式

Centos下的rescue救援模式s.width=650;" src="http://img.code.cc/vcimg/static/loading.png" style="BACkground:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd;" src="http://huangzp.blog.51cto.come/u261/themes/default/images/spacer.gif">

结果:无法登入系统

Centos下的rescue救援模式

1. 通过镜像,进入救援模式,生成grub目录

grub-install --root-directory=/ /dev/sda

说明:grub.conf配置文件不能生成

Centos下的rescue救援模式s.width=650;" src="http://img.code.cc/vcimg/static/loading.png" style="BACkground:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd;" src="http://huangzp.blog.51cto.come/u261/themes/default/images/spacer.gif">

Centos下的rescue救援模式

@H_403_20@

2. 进入grub界面,通过kernel和initramfs启动Linux系统,并创建grub.conf文件即可

Centos下的rescue救援模式

大佬总结

以上是大佬教程为你收集整理的Centos下的rescue救援模式全部内容,希望文章能够帮你解决Centos下的rescue救援模式所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。