Solve the Problem of attaching lvm partitions to CentOS

Source: Internet
Author: User

Today, a friend has a problem with the server hard disk. After a new hard disk is installed and the system is installed, the problem occurs when the old hard disk is mounted,
In linux, use a new hard disk to install the system. After the system is installed, mount the original hard disk. The partition format is all the default partitions of the system.
It is in lvm format, and the default volume is VolGroup00. Well, you can understand the cause of the problem. let's solve this problem.

Use pvs to view the following information:

[root@localhost ~]# pvsPV    VG     FmtAttrPSizePFree/dev/sda2 VolGroup00 lvm2 a-372.50G0/dev/sdb2 VolGroup00 lvm2 a-136.62G0

I found that I can identify two VG correctly, but I have the same name. How can I mount it?

The solution is to rename the original VG and mount it after resolving the conflict.

Rename: vgrename VolGroup00 VolGroup01

The following message is displayed:

[root@localhost ~]# vgrename VolGroup00VolGroup01Found more than one VG called VolGroup00.Please supply VG uuid.

The reason is that there are two VolGroup00 instances. The modified method prompts you to specify the VG uuid.

Run the following command to view the VG uuid:

[root@localhost ~]# vgs -vFinding all volume groupsFinding volume group"VolGroup00"Finding volume group"VolGroup00"VG AttrExt#PV #LV #SN VSize VFree VG UUIDVolGroup00 wz--n-32.00M120372.50G0 dcHa6G-abU2-Xfq8-EPBm-jBLj-sf18-O5uH0UVolGroup00 wz--n-32.00M120136.62G0 OF8g7h-PQJB-9D9z-yPxn-1kfY-Advq-YbNHJ9

After the VG uuid is found, rename it again:

[root@localhost ~]# vgrename OF8g7h-PQJB-9D9z-yPxn-1kfY-Advq-YbNHJ9VolGroup01Volumegroup"VolGroup00" still has active LVs

After the modification is successful, run: lvscan

[root@localhost ~]# lvscaninactive '/dev/VolGroup01/LogVol00'[130.84 GB] inheritinactive '/dev/VolGroup01/LogVol01'[1.94 GB] inheritACTIVE '/dev/VolGroup00/LogVol00'[367.09 GB] inheritACTIVE '/dev/VolGroup00/LogVol01'[5.41 GB] inherit

The modified VolGroup01 is inactive.

Use vgchange to load VolGroup01

[root@localhost ~]# vgchange -ay /dev/VolGroup012 logical volume(s)in volume group"VolGroup01" now active

Run: lvscan

[root@localhost ~]# lvscanACTIVE      '/dev/VolGroup01/LogVol00'[134.69 GB] inheritACTIVE      '/dev/VolGroup01/LogVol01'[1.94 GB] inheritACTIVE      '/dev/VolGroup00/LogVol00'[367.09 GB] inheritACTIVE      '/dev/VolGroup00/LogVol01'[5.41 GB] inherit

VolGroup01 is ACTIVE.

Last mount

[root@localhost ~]# mount /dev/VolGroup01/LogVol00/data/www

Now, all are completed.


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.