Remote repair solution after Linux File System corruption

Source: Internet
Author: User
Article Title: Remote repair solution after Linux File System corruption. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Note: To use fsck, you must first detach the partition; otherwise, you are solely responsible for the consequences.

[1]

If the file system fails to pass the force check, the system enters the repair mode,

Remote Assistance is required to enable the network and sshd services, and then cd/boot; umount/; fsck-y/dev/sda3 (assuming the root directory partition is sda3)

Some discontinuous or damaged files may be shelved by the system to the/lost + found Directory, which starts with # And is named after the node,

Manual recovery is required, and the recovery steps are queried online by yourself. You need to confirm the original directory structure.

[2]

The other is serious. For some reasons, such as upgrading the kernel, for example, frequent power outages, the following errors may occur after the kernel is started,

Boot error:

-----------------------------------------------------

Root (hd0, 0)

Filesystem type is ext2fs, partition type 0x83

Kernel/vmlinuz-2.6.15.6 ro root = LABLE =/rhgb quiet

[Linux-bzImage, setup = 0x1e00, size = 0x1807f8]

Initrd/initrd-2.6.15.6.img

[Linux-initrd @ 0x37f82000, 0x6d283 bytes]

Uncompressing Linux... OK, booting the kernel.

Red Hat nash version 4.1.18 starting

Mkrootdev: label/not found

Umount/sys failed: 16

Mount: error 2 mounting ext3

Mount: error 2 mounting none

Switchroot: mount failed: 22

Umount/initrd/dev failed: 2

Kernel panic-not syncing: Attempted to kill init!

-------------------------------------------------------

A. Remote Assistance. After Entering grub, can the system detect the complete LINUX partition? If the partition is complete and the directory structure and file under the further partition are preliminary complete, OK

Change root = LABEL =/after kernel to root =/dev/hda3 or root =/dev/sda3 (root directory partition, which is generally sda3)

You should be able to smoothly enter the system, and then refer to the mklabel command to add a LABEL to the root partition, or modify grub. conf, change the LABEL item to be represented by a partition, and then grub-install ....

Install grub

B. Remote Assistance. After Entering grub, only the partition where/boot is located can be detected, while the root partition is incomplete. You can only access rescue mode or use live cd to use fsck,

Here, I would like to remind you not to use LIVECD with x-window as much as possible.

In addition, try to prepare some CD disks at ordinary times. Everyone is used to DVDs, but this time it is because there are no DVDs on the server. They are all CDs and cannot be found to move the DVDs.

Network PXE can only be used to complete .....

C. Mount the disk to a partition on another host. If you cannot mount the partition, you can restore the data by following these steps:

Data recovery practices !!!

1. Copy a disk

Dd if = source disk partition of = target disk partition (preferably the same size), for example, the target disk partition is/dev/sdb3.

2.

Mkfs. ext3-n/dev/sdb3 (must have-n, remember) Remember the last numeric value

3.

Screen-S check

Fsck-B XXXX/dev/sdb3-y

XXX is the last number in the second part.

Start detection. Do not worry. Press Ctrl + a-> d to switch to the background. After scanning, confirm fsck-y/dev/sdb3.

4.

Mount/dev/sdb3/mnt

[3]

Even grub cannot be connected. Needless to say, remote assistance directly enters live cd or rescue mode. Check whether the partition is complete. If it is complete, directly use grub-install ......., reference Network for specific use

If the partitions are incomplete, you can only use the data recovery software. If the data is important, take some time to find the data, or spend some money. If the data is not important, reinstall the data directly.

Related Article

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.