Solve the Problem of duplicate names of lvm partitions mounted to CentOS

Source: Internet
Author: User

Solve the Problem of duplicate names of lvm partitions mounted to CentOS

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:

  1. [Root @ localhost ~] # Pvs
  2. PVVGFmtAttrPSizePFree
  3. /Dev/sda2VolGroup00lvm2a-372.50G0
  4. /Dev/sdb2VolGroup00lvm2a-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:

  1. [Root @ localhost ~] # VgrenameVolGroup00VolGroup01
  2. FoundmorethanoneVGcalledVolGroup00.PleasesupplyVGuuid.

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:

  1. [Root @ localhost ~] # Vgs-v
  2. Findingallvolumegroups
  3. Findingvolumegroup "VolGroup00"
  4. Findingvolumegroup "VolGroup00"
  5. VGAttrExt # PV # LV # SNVSizeVFreeVGUUID
  6. VolGroup00wz -- n-32.00M120372.50G0dcHa6G-abU2-Xfq8-EPBm-jBLj-sf18-O5uH0U
  7. VolGroup00wz -- n-32.00M120136.62G0OF8g7h-PQJB-9D9z-yPxn-1kfY-Advq-YbNHJ9

After the VG uuid is found, rename it again:

  1. [Root @ localhost ~] # VgrenameOF8g7h-PQJB-9D9z-yPxn-1kfY-Advq-YbNHJ9VolGroup01
  2. Volumegroup "VolGroup00" stillhasactiveLVs

After the modification is successful, run: lvscan

  1. [Root @ localhost ~] # Lvscan
  2. Inactive '/dev/VolGroup01/logvol00' [130.84 GB] inherit
  3. Inactive '/dev/VolGroup01/LogVol01' [1.94 GB] inherit
  4. ACTIVE '/dev/VolGroup00/logvol00' [367.09 GB] inherit
  5. ACTIVE '/dev/VolGroup00/logvol01' [5.41 GB] inherit

The modified VolGroup01 is inactive.

Use vgchange to load VolGroup01

  1. [Root @ localhost ~] # Vgchange-ay/dev/VolGroup01
  2. 2 logicalvolume (s) involumegroup "VolGroup01" nowactive

Run: lvscan

  1. [Root @ localhost ~] # Lvscan
  2. ACTIVE '/dev/VolGroup01/logvol00' [134.69 GB] inherit
  3. ACTIVE '/dev/VolGroup01/logvol01' [1.94 GB] inherit
  4. ACTIVE '/dev/VolGroup00/logvol00' [367.09 GB] inherit
  5. ACTIVE '/dev/VolGroup00/logvol01' [5.41 GB] inherit

VolGroup01 is ACTIVE.

Last mount

  1. [Root @ localhost ~] # Mount/dev/VolGroup01/LogVol00/data/www

Now, all are completed.

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.