Use Linux rescue mode

In the process of running Linux, sometimes because of erroneous operation causes the system to fail to start. Linux comes with rescue mode, you can solve

Never such a failure. Rescue mode is actually a miniature operating system, various repair systems, but also for Linux into
line cold backup read-only data. Rescue mode simply running in memory, will not affect the real system. This
paper Take common failure for example, about how to enter rescue mode to repair the system.
    Environment: VMware12
    system: Centos7
    question: accidentally deleted files /lib64/libc.so.6
    reason: In many Linux command depends on /lib64/libc.so.6 the library file, when the file is deleted, many commands
can not run, can not reboot the system
    : You can use rescue mode to solve such failures
as follows:
    first, make sure to mount a disc image needs at VMware, wives of brothers did not mount the steps to mount the figure below. Then choose
select 'restart the client', the pop-up page, select 'to confirm the restart'.
    If the environment is real, then the Linux installation CD (if you are using a CD, then into the first - Zhang bootable CD) into the drive,
set the firmware CMOS / BOIS is a CD-ROM guide. BOIS different computer settings are different, according to their type queries computer
how to set. When the installation screen appears linux. In the 'boot:' prompt enter the 'linux rescue' Enter into rescue mode.

After the restart VMware, the first mouse moved on the boot screen, press the left mouse button in, then quickly press the ESC key

(只能按一次),注意,这时考验手速的时候到了,刚开始我也失败了好多次,不要着急,多试
几次

 

 

在VMware下按ESC可以临时把启动菜单调出来,然后选择用哪个设备来引导,这时我们选用
的是光盘引导,即第三项'CD-ROM Drive',回车

 

看到下图的界面,选择Troubleshoooting回车

选择Rescue a CentOS Linux system 救援模式 

 接下来系统将试图查找根分区,出现如下图所示。 默认在救援模式,硬盘的根分区将挂载到光
盘Linux环境的/mnt/sysimage目录下。选项'continue'表示挂载权限为读写,'Read only'为
只读,如果出现检测失败可以选择'skip to shell'跳过。此时,因为要对系统进行修复,所以
需要读写权限,一般选择默认选项'continue',输入1,回车
 可以看到系统提示'your system has been mounted under/mnt/sysimage.'此时挂载成
功。我们还可以选择执行'chroot/mnt/sysimage'命令,可以将根目录挂载到我们硬盘系统
的根目录中去。此时我们不执行这条命令,按enter直接进入shell。
 看到'sh-4.2#',代表已经进入光盘Linux shell,此时找到我们需要的文件/lib64/libc.si.6,复制
到/lib64目录下即可。复制完成后,就可以执行'exit'命令,退出光盘shell,接着系统将重
启,耐心等待.

重新启动就可以开机了。

Guess you like

Origin www.cnblogs.com/guozihan/p/11027325.html