How to handle Linux File System corruption

Source: Internet
Author: User

When the file system is damaged, if the ext2fs file system is used, you can run the e2fsck command from the floppy disk to correct corrupted data in the file system. 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 status, size, and idle disk blocks of the file system. If a file system's super block is damaged, such as accidentally writing data directly to the file system's super block partition), the system may not recognize the file system at all, in this way, you cannot install it, even if you use the e2fsck command.
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 a super block backup:
# E2fsck-B 8193 refers to the partition where the file system is located. The-B 8193 option is used to display the 8193-block super block backup data stored in the file system.
Restore Lost files
If you accidentally delete important system files, you can still copy the files to the hard disk using the First Aid disk. For example, if the file/bin/login is deleted and the system cannot run normally on the logon page, you can use the First Aid disk 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.

Related Articles]

  • How to Set file permissions in Linux
  • Linux File System desktop applications
  • Introduction to the Linux File System Reverse deletion method

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.