zoukankan      html  css  js  c++  java
  • 删除Linux的依赖库并进入救援模式恢复

    删除Linux的依赖库并进入救援模式恢复

    模拟一下依赖库文件被删,并进入救援模式恢复

    系统:CentOS7

    一、删除mv的依赖库文件

    删除/lib64/libc.so.6

    [root@centos7 Packages]# which mv
    alias mv='mv -i'
    	/usr/bin/mv
    [root@centos7 Packages]# ldd /usr/bin/mv
    	linux-vdso.so.1 =>  (0x00007ffd51946000)
    	libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f40c2bd9000)
    	libacl.so.1 => /lib64/libacl.so.1 (0x00007f40c29d0000)
    	libattr.so.1 => /lib64/libattr.so.1 (0x00007f40c27cb000)
    	libc.so.6 => /lib64/libc.so.6 (0x00007f40c23fe000)
    	libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f40c219c000)
    	libdl.so.2 => /lib64/libdl.so.2 (0x00007f40c1f98000)
    	/lib64/ld-linux-x86-64.so.2 (0x00007f40c2e00000)
    	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f40c1d7c000)
    [root@centos7 Packages]# rm -f /lib64/libc.so.6 
    

    删除后mv等很多命令变无法使用

    [root@centos7 Packages]# mv /etc/fstab .
    mv: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
    [root@centos7 Packages]# cp /etc/fstab .
    cp: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
    [root@centos7 Packages]# poweroff
    poweroff: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
    

    二、强制关机,从光盘引导

    0、进BIOS从光盘引导

    1、Troubleshooting

    2、Recure a CentOS system(救援模式)

    3、输入1,回车

    4、提示系统被挂载到了/mnt/sysimage,按下回车

    5、把光盘的库文件复制过来

    使用cp复制库文件到/mnt/sysimage/lib64/;千万别mv,否则光盘的系统又坏了

    三、重启后的系统已经正常使用

    [root@centos7 ~]# cp /etc/fstab . -a
    cp: overwrite ‘./fstab’? y
    [root@centos7 ~]# mv fstab /tmp
    
  • 相关阅读:
    java.lang.UnsatisfiedLinkError: No implementation found for
    target release 1.5 conflicts with default source release 1.7
    (转)makefile里PHONY的相关介绍
    Hint: A potential Change-Id was found, but it was not in the footer (last paragraph) of the commit message
    linux jdk版本随时切换
    提高Service的优先级
    第一章、数字图像的描述
    gluas图形处理——导读
    图像处理学习过程——网站,视频,书籍(长期更新)
    基数排序
  • 原文地址:https://www.cnblogs.com/uscWIFI/p/11293733.html
Copyright © 2011-2022 走看看