What do you do when a problem occurs in your Linux system? reinstall it directly or use the Linux rescue mode. Maybe you are unfamiliar with this model, but it does not prevent him from providing great help to you. It can help you to save a lot of important data. You don't have to worry about your superiors.
Now I will explain how to go to the rescue example system: RHEL 3)
1. Use the installation CD or hard disk installation method to enter the installation interface, and enter Linux rescue in shell.
2. Select the language and keyboard format as prompted.
3. select whether to configure the NIC. Generally, when the system reaches rescue, the network does not need to be configured. Therefore, you can choose whether to skip the NIC configuration. You can also choose yes if needed, the specific setting process is the same as that during installation.
4. Select whether to allow the system to search for the RHEL system on the hard disk and choose to continue.
5. The system on the hard disk has been found and mounted to/mnt/sysimage.
6. Press the prompt chroot/mnt/sysimage
After chroot, you can already be in your system to be saved.
Grub is down. grub-install/dev/hdxx
If the configuration file is incorrect, vi/etc/fstab vi/etc/inittab ......
Rpm-F xxx. rpm where the software package is destroyed
After the repair is completed, exit the command to exit chroot and exit the rescue shell system to restart.
Note:
If the system on your hard disk is a non-rhel system, such as debian, the rescue program cannot find the system on the hard disk in step 3, so we chose to "Skip ", directly go to shell. suppose there is one
Debian system/dev/hda1 is/boot partition/dev/hda5 is/partition/dev/hda6 is swap. So we will do this now.
# Fdisk-l view partition information)
# Mkdir/mnt/Linux
# Mkdir/mnt/Linux/boot create a directory based on the information obtained by fdisk-l)
# Mount-t ext3/dev/hda5/mnt/Linux
# Mount-t ext3/dev/hda1/mnt/Linux/boot mount the file system on the hard disk)
# Chroot/mnt/Linux chroot change the working system)
Since then, we have successfully moved into the debian system on the hard disk, and the rest has been the same as before.
In addition:
If your system is corrupted, you do not need to mount the chroot system.
Directly fsck/dev/hdxx.
In fact, if we think about this rescue, we will find that the so-called rescue mode is just a Linux operating environment with shell, and then mount and chroot to access the system to be repaired.
Therefore, without a rescue disk, I can use Linux livecd or Linux on a floppy disk to enter the shell environment and redo it.
# Fdisk-l view partition information)
# Mkdir/mnt/Linux
# Mkdir/mnt/Linux/boot create a directory based on the information obtained by fdisk-l)
# Mount-t ext3/dev/hda5/mnt/Linux
# Mount-t ext3/dev/hda1/mnt/Linux/boot mount the file system on the hard disk)
# Chroot/mnt/Linux chroot change the working system)
You can simply enter a Linux rescue mode.
- Describes the Problems and Solutions of Linux system calls.
- Detailed introduction to Linux USB flash drive boot and installation I) self-guided mode
- Briefly introduces how to install Twitter on Linux
- Roles of seven Linux Command destruction
- Comprehensive Analysis of Linux system management command w