Linux file system corruption causes no normal startup with the Fsck Repair tool

Source: Internet
Author: User

Questions:
Today when you open your own virtual machine to learn, found in the file system check the following error:
/dev/mapper/volgroup-lv_root:unexpected inconsistency; RUN fsck manually. [FAILED]
This hint means that the Linux file system is damaged, causing the file system to become corrupted due to an abnormal shutdown, such as a sudden power outage.
The hints here have been clearly stated, "unexpected inconsistency; RUN fsck manually. " : Accidental inconsistency causes file system corruption and requires manual fsck repair.
Follow the system prompts, enter the password into the system


Then enter the command: fsck (then enter Yes as prompted)

Re-enter command: FSCK–Y/DEV/SDA1

Finally reboot reboot the system to

/etc/fstab configuration file
First of all, here's why the file system check is a step in the boot.
To mount and check the file system, you can set the file system configuration file automatically by/etc/fstab boot.


Meaning of each column in the configuration file:
First column: Mounted file system
Second column: mount point
Third column: File system type
Fourth column: Mount option (typically using the default defaults)
Fifth column: Whether to back up
Sixth column: Whether to do disk check boot
Obviously, want to boot the disk check, the sixth column is set to "1", it is recommended that the normal disk is set 0 do not check, or the disk has a problem, may cause the system can not come up, the system disk can be set to 1 or 2.
FSCK Repair Tool
Use the man fsck to find this explanation: check and repair a Linux file system.
As you can see, the fsck tool can not only do file system check (scan), but also repair the file system, of course, fsck can fix the problem is limited, but it is also a convenient self-contained repair tool. The use rights of fsck must be root permissions.
Syntax: fsck [-SACVRP] [-t fstype] [--] [fsck-options] filesys [...]
Parameters:
-T: Given the type of the file system, this parameter is not required if there is already a definition in/etc/fstab or if the kernel itself is supported
-S: Execute the fsck command one by one to check
-A: Check all listed partition in/etc/fstab
-C: Show complete Check progress
-D: Print e2fsck debug Results
-P: Simultaneously with the-a condition, multiple fsck checks are performed together
-R: Omit/not check (ignore root file system) with-a condition
-V: Verbose display mode
-A: Automatically fix if check is wrong
-R: If the check is wrong, the user answers whether the repair
-N: All files are detected, all questions are answered with no (interactive unified No, no manual input); Only the file system is detected, not repaired, only reported.
-Y: With-N, all files are detected, all questions are answered with Yes, without manual intervention, automatically repair the file system.
-D: Notifies fsck to check the system for additional consistency.
-F Force Check

Linux file system corruption causes no normal startup with the Fsck Repair tool

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.