Cloud Host File System repair

Source: Internet
Author: User

First, the problem description
The cloud hosts failed to boot due to corrupted cloud Host file System! Customer request to retrieve the data!!!

Ii. preparatory work
2.1 Create a cloud host to do file repair.
2.2 Find a physical machine (RHEL7.1 can) do file repair.

Third, the operation process
3.1 Take a snapshot of the problematic cloud host machine, system disk.
3.2 Create a cloud drive based on a snapshot of 3.1.
3.3 The Cloud drive created in 3.2 is mounted on a 2.1 cloud host for file repair.
3.4 If the above steps can be repaired successfully, then the problem of the cloud host system disk is hung on to 2.2 of the physical machine to do file repair.

Iv. Repair process of EXT4
4.1 View Super Block backup
Mkfs.ext4-n/dev/mapper/${lv_name}
4.2 Mounting with a backup super block
Mount-o sb=32768/dev/mapper/${lv_name}/mnt # 32768 is a super block position isolated in 4.1
4.3 Repairing partitions With the backup Super Block fsck
Fsck.ext4-b 32768/dev/mapper/${lv_name} # 32768 for the Super block position isolated in 4.1
4.4 Repairing partitions directly with fsck
Fsck.ext4-y/dev/mapper/${lv_name}
4.5 Rebuild Super Block (! Use with caution! All data may be lost)
Mkfs.ext4-s/dev/mapper/${lv_name}
4.5 or more operations fail! Continue to view Log +google
Resize2fs/dev/mapper/${lv_name} 73399296 # still fails
4.6 Inspired by 4.5 decided to expand under LV test
Lvextend/dev/mapper/${lv_name}/dev/${vdisk_path} # finally successful
4.7 Attach the Cloud host system disk to the physical machine
RBD map ${pool_name}/$ (volume_name)
4.8 Extended LVM
Lvextend/dev/mapper/${lv_name}/dev/${vdisk_path}
4.9 Uninstalling the Cloud host system disk
Lvchange-an/dev/mapper/${lv_name}
RBD Unmap ${mapped_point}

V. XFS Repair Process
5.1 Executive Xfs_repair
Xfs_repair-l/dev/mapper/${lv_name} # One success
5.2 Attach the Cloud host system disk to the physical machine
RBD map ${pool_name}/$ (volume_name)
5.3 Executive Xfs_repair
Xfs_repair-l/dev/mapper/${lv_name}
5.4 Uninstalling the Cloud host system disk
Lvchange-an/dev/mapper/${lv_name}
RBD Unmap ${mapped_point}

Vi. references
http://blog.chinaunix.net/uid-26557245-id-3748168.html # Fix Ext4
http://oss.sgi.com/archives/xfs/2013-12/msg00670.html # Fix XFS
http://www.linuxquestions.org/questions/linux-enterprise-47/shrink-lvm-without-dataloss-557746/# Fix Ext4
http://www.linuxquestions.org/questions/linux-general-1/ cannot-mount-hard-disk-block-count-exceeds-size-of-device-bad-partition-table-880149/# Fix Ext4

Cloud Host File System repair

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.