Analysis and troubleshooting of common Linux faults

Source: Internet
Author: User

During linux Startup, the MBR Master Boot records, GRUB boot menus, and system initialization configuration files are involved, errors or faults at any stage may cause system crashes or boot exceptions. Therefore, be sure to back up your data properly.

1. Simulate MBR sector failure

Because the MBR sector contains the partition record of the entire hard disk, the backup file of this sector must be stored on another hard disk or another storage device, otherwise, the backup file cannot be read during restoration. Perform the test here.

Add a hard disk partition and format it.

First, create a directory, and then mount the second hard disk.

View after restart


In this case, the rescue system first mounts the CD

Mount the system directory to/mnt/sysimage.

Select Editor

When we witness the miracle, the pictures we are familiar with are back!

2. GRUB boot fault

GRUB is the default boot program used by most linux systems. You can use the boot menu to directly access different operating systems (if any) when the configuration file/boot/grup. conf is lost, or key configuration error occurs. After linux is started, only grup> characters are displayed and cannot be entered into the system.

Destroy first and then restore

Because the command is difficult to use, I would like to introduce the rescue mode to you.

Restart and Press ESC to enter the CD and then rescue mode

Direct Installation

You can re-install the grub boot program to the MBR sector on the first hard disk.

3. the/etc/inittab file is missing.

Is the configuration file of the system initialization process init. When this file is deleted or an error occurs, the system may fail to be started.

Enter rescue mode

Then, use rpm-ivh to download the package.



4. Forget the super administrator password

L restart. When the GURB menu appears, locate the operating system and press e to enter the editing mode.

L locate press e at the beginning of the kernel and Press space to enter single-user mode.

L press enter to confirm and press B to enter the shell environment. In it, passwd can be used to reset and change the administrator password.

Method 2: Rescue Mode

Go to the rescue mode and take two steps.

Chroot/mnt/sysimage

Change Passwd root password.


4. the disk consumes resources.

When the disk space of a file system is exhausted, new file data cannot be created in the partition, for example, the disk space of the root partition is exhausted, some programs may fail to run normally due to system faults.

Simulate disk partition depletion:


Write an empty file to the disk.


In each file system, I nodes are limited. After formatting, the number of I nodes is fixed. If the number of large and small files is large, there is a lot of space for partitions, but you cannot create a new file (No disk quota)

Df-I parameter to view node usage

All nodes are exhausted

After the file is created, the system prompts that there is no space on the device.

However, when we use df to view the disk, we find that there are still 934M which are not used. How can this problem be solved.


Find the empty file and delete it.

You can also use find/-empty to find the empty file and then delete it by rm.

Therefore, we need to understand and analyze various common faults of the system, and then take the right medicine! The most important thing is to back up data!


This article is from the "technical control" blog, please be sure to keep this source http://chenhao6.blog.51cto.com/6228054/1215181


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.