Linux rescue模式修复由于libc.so.6错误导致系统所有命令不可用的问题

来源:互联网 发布:阿里云先知社区 编辑:程序博客网 时间:2024/05/25 08:12


    最近遇到一个问题,有同事修改了/lib64/libc.so.6文件,结果导致系统所有命令基本都不可用,如下:

[root@themis lib64]# shutdown -h nowshutdown: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory[root@themis lib64]# lsls: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory[root@themis lib64]# ls -lls: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory[root@themis lib64]# 

由于修改了文件导致了命令不可用,此时已经无法回退了,只能使用Linux rescue进行补救

下面介绍Linux下用光盘进行rescue模式的方法,需要注意的是实体机跟虚拟机还是有很大差别的,在实体机中通过光盘启动,可能会自动进入到安装界面,所有我们需要在进入安装界面前(会提示 press any key之类)快速按键盘上的按键(只有三秒钟需要关注,)

如果不理会就会进入以下界面



下面说进入rescue模式步骤:

1、选择rescue模式


2、选择语言


3、选择键盘


4、我们选择不启用网络,因为启用也没用。



5、选择仅需(continue)



6、选择OK




7、选择回车键,打开shell



8、进入模式后,我们就可以进行命令行操作了,此时会把硬盘的文件系统挂载在/mnt/sysimage目录下,如果未挂载使用如下命令挂载

chroot /mnt/sysimage

此时我们进入到/mnt/sysimage,这里其实就是原系统的根目录,我们进行一些补救操作即可



9、重启后重新进入系统一切正常









阅读全文
0 0