Summary of Linux emergency response methods (1)

Source: Internet
Author: User

Linux emergency response is a solution to the system's catastrophic problems. If appropriate, it can help us minimize losses, here, we will introduce the Linux emergency solutions for the maintenance of the first-aid disk group, the handling methods for file system destruction, and the recovery of lost files.

Use an emergency disk group for maintenance

An emergency disk group, also known as the boot/root disk group), is an essential tool for system administrators. It can be used to independently start and run a complete linux system. In fact, there is a complete linux system on the first-aid disk group's 2nd disks, including the root file system, while the 1st disks store the boot kernel.

It is easy to use an emergency disk group to maintain the system. You only need to use these two disks to start the system and enter the emergency mode. The root account is used. To access files on a hard disk, you must manually install the hard disk file system. For example, run the following command to install the ext2fs linux File System on the/dev/hda2 disk in the/mnt directory:

# M

Note: the root directory is the root directory on the First Aid Board. To access files in the hard drive file system, you must first install them in a directory. In this way, if the file system on the hard disk is installed in the/MT directory, the path of the original/etc/passwd file on the hard disk is/mnt/etc/passwd.

Processing Method when the file system is damaged

If an ext2fs file system is used when the file system is damaged, you can run the e2fsck command on a floppy disk to correct corrupted data in the file system. For other types of file systems, you can use the corresponding fsck command. When checking the file system from a floppy disk, it is best not to mount the installation

Note: the common cause of file system damage is that the super block is damaged, and the super block is the "Header" of the file system ". It contains information such as the status, size, and idle disk block of the file system. If a file system's super block is damaged, such as accidentally writing data directly to the file system's super block partition), the system may not recognize the file system at all, in this way, you cannot install it, even if you use the e2fsck command.

However, the ext2fs File System backs up the contents of the super block and stores the contents in the block group of the driver. You can use the following command to notify e2fsck to use the super block backup.

# E2fsck-B 8193

It refers to the partition where the file system is located. The-B 8193 option is used to display the backup data of 8193 Super blocks stored in the file system.

Restore Lost files

If you accidentally delete important files, you cannot recover them directly. However, you can also copy the corresponding files from the First Aid disk to the hard disk. For example, if the/bin/login file is deleted and the system cannot normally enter the logon interface, you can use the First Aid disk group to start the system and install the hard disk file system in the/mnt directory, run the following command:

# Cp-a/bin/login/mnt/bin

The "-a" option is used to tell cp to maintain the object access permission during copy.

Of course, this method cannot be used if the basic file to be deleted is not in the "First Aid disk group. If you have performed a system backup before, you can also use the previous backup to restore it.

I believe these three Linux emergency solutions will be of great help to the system administrator.

  1. Detailed introduction to the use of Linux redirection
  2. Detailed analysis of Linux password cracking Problems
  3. Detailed parsing of Linux directory structure
  4. Detailed parsing of Linux/etc/passwd files
  5. Describes how to create a Linux wap Gateway.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.