Lvm catastrophic recovery

Source: Internet
Author: User

Some time ago, vps deleted python lib by mistake, and the reinstallation still failed. Finally, we decided to reinstall the system. The previous personal website data was stored on a logical volume. Therefore, when you reinstall the system, you only need to retrieve the partition table.
The following are some operation steps to facilitate future query.
After reinstalling the system, run the following command to search for the volume group. Obtain the name of the previous volume group.
1: [root @ MyVPS ~] # Vgscan
2: Reading all physical volumes. This may take a while...
3: Found volume group "vg" using metadata type lvm2
4: Found volume group "VolGroup0064" using metadata type lvm
Here, we can see that the volume group vg is the volume group that previously stored data.
Next, perform the following operations:
1: [root @ MyVPS ~] # Pvdisplay
2: --- Physical volume ---
3: PV Name/dev/xvdb
4: VG Name vg
5: PV Size 10.00 GB/not usable 4.00 MB
6: Allocatable yes
7: PE Size (KByte) 4096
8: Total PE 2559
9: Free PE 511
10: Allocated PE 2048.
11: pv uuid PpfjU7-X0bY-3naD-FrIb-2CVJ-3zQB-9QmWuq
12:
13: --- Physical volume ---
14: PV Name/dev/xvda2
15: VG Name VolGroup0064
16: PV Size 7.90 GB/not usable 23.41 MB
17: Allocatable yes (but full)
18: PE Size (Kbytes) 32768
19: Total PE 252
20: Free PE 0
21: Allocated PE 252.
22: pv uuid EuF4s3-2IEu-vcFC-yJns-jaUe-dOIs-nteEwS
View the pv of the vg. We can determine that vg is allocated to vg from the/dev/xvdb disk.
Import xvdb to vg.
1: [root @ MyVPS ~] # Vgimport vg
Notify system logical volume group changes
1: [root @ MyVPS ~] # Vgchange-a y
View vgdisplay-v to view the detailed information of vg.
Then mount to the previous mount point and then fsck. This is omitted ......
 
 
This article is from the "wangyue Feiyu" blog

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.