How to handle common emergencies in Linux

Source: Internet
Author: User

Today, with the development of technology networks, computers are becoming more and more popular. We use computers, but do we know how computers work? The computer is essential to the operating system, and the development of the Linux operating system is also very rapid. Here we will introduce the knowledge of Linux, so that you can learn how to use Linux. Today we will talk about common emergency handling methods for Linux operating systems. I hope you will remember the Common Emergency Handling Methods for Linux operating systems.

1. 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 start and run 1 independently.

Linux operating system. In fact, there is a complete Linux operating system, including the root file system, on the first-aid disk group's 2nd disks.

While 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, the following command can be installed in the/mnt directory.

Ext2fs Linux File System on/dev/hda2:

# Monut-t ext2/dev/hda2/mnt

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 it to 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.

2. Handling methods 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 the floppy disk to correct the file system.

Damaged data. 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 the file system's

Status, size, and idle disk block. If a file system's super block is damaged, for example, the data is accidentally written directly

The system may not recognize the file system at all, so it cannot be installed even if

The e2fsck command cannot solve this problem either.

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.

3. 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.

4. How to Deal with function library damage

If the system function library file is accidentally damaged or the symbolic link in the/lib directory is broken, the commands dependent on these libraries cannot be executed. The simplest solution is to start the system with an emergency disk group, install the hard disk file system in the/mnt directory, and fix the library in the/mnt/lib directory.

This article helps you learn how to handle common emergencies in Linux.

  1. Analyze the future of the Linux Mobile Software Industry
  2. Yuan Meng
  3. Chinese Linux operating systems may be used in China's trillions of supercomputers
  4. Discuss and test the use of Fedora Linux hardware
  5. Is the Linux operating system a future terminal for small and medium-sized enterprises?

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.