Article Title: linuxrescue mode: how to cross the console. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The rescue mode in linux usually has many technical points. When we use the rescue mode, there will still be many problems, next, let's take a look at how we can better use operations related to the linux rescue mode.
You do not need to enter the root password for a real cross-Console Logon. If you lose the root password, you need to log on across the console. the linux rescue mode we mentioned earlier is essentially, it means to log on across the console, because you can log on to the system without password verification;
Cross-Console Logon mainly includes: Using grub and lilo to log on across the console; linux rescue mode; third-party livecd system and third-party Linux system;
1. log on to the console through grub and lilo boot;
1) if grub is used for system guidance;
After grub is started, move the keyboard to the Linux Startup item; press the e key; then move the keyboard to a line similar to the following, that is, the line of the kernel:
Kernel/boot/vmlinuz-2.6.11-1.1369_FC4 ro root = LABEL =/1 rhgb quiet
Move the cursor to this line and press the e key to edit the line. At the end of the line, enter a space and linux single, which is similar to the following:
Kernel/boot/vmlinuz-2.6.11-1.1369_FC4 ro root = LABEL =/1 rhgb quiet linux init =/bin/bash
End editing. Press enter to return;
Next we need to start the system and press the B key to start it;
The system may be read-only. Run the following command;
# Mount-o remount, rw/
Then we can use df-h to check the file system loading. Since all the file systems are mounted, What can't we do? Reset the root password and backup the file ......
For example, resetting the root password;
# Passwd
2) if you use lilo for system boot;
In boot: Enter
Boot: linux init =/bin/bash
After entering the system, you can use df-h to view the Mount location of the file system, or use fdisk-l to view partitions. However, you can write data to the file system, you may want to see the following;
The system may be read-only. Run the following command;
# Mount-o remount, rw/
2. linux rescue mode;
Refer to the repair mode mentioned in the second point above;
3. Use linux livecd CD or a third-party linux system;
Linux livecd is a linux system that runs on a CD without installation. livecd is mostly used for restoration. livecd integrates common system operating tools;
A third-party Linux system refers to the installation of more than one Linux system on your machine. If one of them has a problem, we can use the other to fix it;
Livecd and a third-party linux system are used to fix damaged Linux systems. Common tools include mount and chroot. If you simply change the problematic system file, mount is enough. The chroot tool can change/and then enter another system. This tool is indeed useful.
Let's give an example to illustrate how to use mount and chroot;
The use of third-party Linux and Livecd on machines is relatively simple.