How to enter rescue mode in case of Linux system failure

In the process of Linux running, sometimes the system can not start because of misoperation. The rescue mode of Linux can solve this kind of fault. In fact, the rescue mode is a micro operating system, which can repair the system and perform cold backup of read-only data for Linux. The rescue mode only runs in memory and will not affect the real system data. This paper takes the common faults as an example, describes how to enter the rescue mode to repair the system.

Environment: VMware12

System: Centos7.3

Problem: accidentally deleted / lib64/ file

Reason: under Linux, many commands depend on the library file / lib64/ When this file is deleted, many commands cannot run and the system cannot be restarted

Method: the rescue mode can be used to solve this kind of fault

The steps are as follows:

Under VMware, first confirm whether the required optical image is mounted. If not, mount it as per the steps below. Then select restart client and confirm restart on the pop-up page.

If it is a real environment, put the Linux Installation CD (or the first boot cd if you use the CD) into the CD-ROM drive, and set the firmware CMOS/BOIS to boot for the CD-ROM. Different computers have different BOIS settings. Please inquire how to set it according to the model of your own computer. When the Linux Installation screen appears. Enter "linux rescue" after "boot:" prompt to enter rescue mode.


After VMware restarts, first move the mouse to the boot interface, press the left mouse button, click in, and then quickly press the ESC key (only once). Note that it's time to test the hand speed. At the beginning, I also failed many times. Don't worry, try several times more

Press ESC under VMware to temporarily adjust the Startup menu, and then choose which device to use to boot. At this time, we choose CD-ROM boot, that is, the third item "CD-ROM Drive", enter

See the following interface, select "troubleshooting", and enter

At this time, we finally see that "Rescue a CentOS Linux system" is the rescue mode. Select this option and press enter

Next, the system will try to find the root partition, as shown in the following figure. By default, in rescue mode, the root partition of the hard disk will be attached to the / mnt/sysimage directory of the CD-ROM Linux environment. The option "continue" means that the mount permission is read-write and "read only". If the detection fails, you can choose "skip to shell" to skip. At this time, because you want to repair the system, you need read-write permission. Generally, select the default option "continue", enter 1, enter

You can see the system prompt "your system has been mounted under /mnt/sysimage.". We can also choose to execute "chroot /mnt/sysimage" command, and mount the root directory to the root directory of our hard disk system. At this time, instead of executing this command, press enter to enter the shell directly.

See "sh-4.2", which means that you have entered the CD Linux shell. Now find the file / lib64/ we need, and copy it to the directory / lib64. After copying, you can execute the "exit" command to exit the CD shell. Then the system will restart and wait patiently.

See the following interface, you can log in to the system, on behalf of using the Linux rescue mode to repair the system successfully and successfully!



                        <li class="tool-item tool-active is-like "><a href="javascript:;"><svg class="icon" aria-hidden="true">
                            <use xlink:href="#csdnc-thumbsup"></use>
                        </svg><span class="name">Give the thumbs-up</span>
                        <span class="count"></span>
                        <li class="tool-item tool-active is-collection "><a href="javascript:;" data-report-click="{&quot;mod&quot;:&quot;popu_824&quot;}"><svg class="icon" aria-hidden="true">
                            <use xlink:href="#icon-csdnc-Collection-G"></use>
                        </svg><span class="name">Collection</span></a></li>
                        <li class="tool-item tool-active is-share"><a href="javascript:;"><svg class="icon" aria-hidden="true">
                            <use xlink:href="#icon-csdnc-fenxiang"></use>
                        <!--Reward begins-->
                                                <!--End of reward-->
                                                <li class="tool-item tool-more">
                            <svg t="1575545411852" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="" p-id="5717" xmlns:xlink="" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M179.176 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5718"></path><path d="M509.684 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5719"></path><path d="M846.175 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5720"></path></svg>
                            <ul class="more-box">
                                <li class="item"><a class="article-report">Article report</a></li>
            <div class="person-messagebox">
                <div class="left-message"><a href="">
                    <img src="" class="avatar_pic" username="Ruoshuiss">
                                            <img src="" class="user-years">
                <div class="middle-message">
                                        <div class="title"><span class="tit"><a href="" data-report-click="{&quot;mod&quot;:&quot;popu_379&quot;}" target="_blank">Ruoshuiss</a></span>
                    <div class="text"><span>Published 30 original articles</span> · <span>Praise 32</span> · <span>70000 visitors+</span></div>
                                <div class="right-message">
                                            <a href="https://Im. CSDN. Net / im / main. HTML? Username = ruoshuiss "target =" [blank "class =" BTN BTN SM BTN red hollow BT button personal letter "> private message
                                                            <a class="btn btn-sm  bt-button personal-watch" data-report-click="{&quot;mod&quot;:&quot;popu_379&quot;}">follow</a>
    Published 5 original articles, won praise 0, visited 251
    Private letter follow

    Tags: Linux shell Vmware Javascript

    Posted on Mon, 24 Feb 2020 01:27:30 -0500 by ddoc