How to use fsck to solve system faults?

Source: Internet
Author: User
I went to work at the company today and started the system in the morning. After I went out for a while and came back, I pressed any key and the machine did not respond, only the white mouse with a black background is displayed, and the display indicator is still on. The only dialog box that does not show the pop-up password is displayed. so I restarted the machine... information & nbs

 

I went to work at the company today and started the system in the morning. After I went out for a while and came back, I pressed any key and the machine did not respond, only the white mouse with a black background is displayed, and the display indicator is still on. the only one that does not have a pop-up password input dialog box is displayed. so I restarted the host and encountered a problem:

****************

 

* ** AN error occurred during the file system check

* ** Dropping you to a shell; the specified M will reboot

*** When you leave the shell

Give root password for maintenance

(Or type Control-D to continue ):

 

 

My system is redhat 5.5. the following hopes will be useful to you:

After this problem occurs, I looked at it:

Give root password for maintenance

(Or type Control-D to continue ):

This means that I have to enter the root password or press CTR + D to restart.

So after I lose the root password, the following situation occurs:

(Repair filesystem) 1 #

Because fsck is not very familiar at first, it will directly lose, followed by a series of inquiries, just yes

(Repair filesystem) 1 # fsck

It may take some time in the middle, because the file repair event is a bit long and there is no prompt that it may upset you, so please be patient.

.......

After the modification is successful, a message is displayed:

(Repair filesystem) 2 #

In this case, you only need to reboot it and restart it.

(Repair filesystem) 2 # reboot

Let's talk about the fsck command!

The fsck command is short for file system check to check and maintain inconsistent file systems. If the system power is down or the disk is faulty, use the fsck command to check the file system.

Linux Tips: Use the Fsck command to repair damaged partitions

Enter the Root password and use fsck-t ext3-r/usr/local to fix the issue.

Command: fsck

Permission: Super User root

Usage: fsck [-sACVRP] [-t fstype] [-] [fsck-options] filesys […]

Description: checks and fixes the Linux file system. you can check one or more Linux file systems at the same time.

Parameter: filesys: device name (eg./dev/sda1), mount point (eg./or/usr)

-T: The format of the given file system. this parameter is not required if it is defined in/etc/fstab.

-S: execute the fsck command one by one in sequence to check

-A: check the partition of all columns in/etc/fstab.

-C: displays the complete check progress.

-D: print the debug result of e2fsck.

-P: When both-A conditions exist, multiple fsck checks are executed together.

-R: if both-A conditions are available, this parameter is omitted/not checked.

-V: detailed display mode

-A: If the check is incorrect, it will be automatically repaired.

-R: if the check is incorrect, the user will answer whether the problem is fixed.

Example: Check whether/dev/hda5 of the msdos file system is normal. if an exception exists, it is automatically repaired: fsck-t msdos-a/dev/hda5

Note: this command can be used with/etc/fstab for reference operations.

 

From linuxOOstudy's column

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.