Detailed explanation of commands for repairing damaged hard disk files under e2fsck in CentOS

Source: Internet
Author: User

Command: e2fsck

Permission: Super User

Usage: e2fsck [-pacnydfvFV] [-B superblock] [-B blocksize] [-l |-L bad_blocks_file] [-C fd] device

Note: Check whether the partition of the Linux ext2 file system works normally.

Parameters:

Device: hard drive partition to be checked, for example:/dev/sda1
-A: checks the partition and automatically fixes the problem if any. It is equivalent to the-p function.
-B: Set the location for storing superblocks.
-B: Set the block size.
-C: Check whether the partition has a bad track.
-C file: Save the check result to file for viewing.
-D: print the debug result of e2fsck.
-F: force check
-F: Clear the device buffer cache before starting the check to avoid errors.
-L bad_blocks_file: add the blocks with bad tracks to bad_blocks_file.
-L bad_blocks_file: Set the block data of the bad track to be stored in bad_blocks_file. If this file is not found, it is automatically generated.
-N: Enable the file system in the [Read-Only] mode.
-P: Check the partition and automatically fix the problem if any.
-V: Detailed Display Mode
-V: displays the current e2fsck version.
-Y: pre-set answers to all questions during the check [Yes]

Example:
Check whether/dev/hda5 is normal. If any exception occurs, it is automatically repaired. If any question or answer is set, all answers are [Yes]:
E2fsck-a-y/dev/hda5

Note:

Most of the cases where e2fsck is used to check the hard disk partition are usually special. Therefore, you 'd better first check the partition umount and then run e2fsck. If you want to check, enter singal user mode and run the command again.

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.