Solve the problem of mounting lvm under Linux

  

Use the new hard disk to install the system under Linux. After installing it, mount the original hard disk. The partition format is the system default partition. The system uses the lvm format by default. The volumes are all VolGroup00

Use pvs to view the display as follows: [root@localhost ~]# pvs PV VG Fmt Attr PSize PFree /dev/sda2 VolGroup00 lvm2 a- 136.62G 0 /dev/sdb2 VolGroup00 lvm2 a- 136.62G 0 Found that you can confirm that you have two VGs, but the same name, how to mount it? The solution is to rename the original VG and resolve the conflict to mount.

The rename format is: vgrename VolGroup00 VolGroup01 will prompt: [root@localhost ~]# vgrename VolGroup00 VolGroup01 Found more than one VG called VolGroup00. Please supply VG uuid. The reason is that there are two VolGroup00, modify He has already suggested that you want to specify VG uuid.

The command to view VG uuid is: [root@localhost ~]# vgs -v Finding all volume groups Finding volume group "VolGroup00" Finding volume group "VolGroup00" VG Attr Ext #PV #LV #SN VSize VFree VG UUID VolGroup00 wz--n- 32.00M 1 2 0 136.62G 0 dcHa6G-abU2-Xfq8-EPBm-jBLj-sf18-O5uH0U VolGroup00 wz--n- 32.00M 1 2 0 136.62G 0 OF8g7h-PQJB-9D9z -yPxn-1kfY-Advq-YbNHJ9


After checking VG uuid, rename it again: [root@localhost ~]# vgrename OF8g7h-PQJB-9D9z-yPxn-1kfY-Advq- YbNHJ9 VolGroup01 Volume group "VolGroup00" still has active LVs

After the modification is successful, execute: lvscan [root@localhost ~]# lvscan inactive '/dev/VolGroup01/LogVol00' [130.84 GB] inherit inactive ' /dev/VolGroup01/LogVol01' [5.78 GB] inherit ACTIVE '/dev/VolGroup00/LogVol00' [130.84 GB] inherit ACTIVE '/dev/VolGroup00/LogVol01' [5.78 GB] inherit You can see that the newly modified VolGroup01 is inactive .


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

The last mount can be [root@localhost ~]# mount /dev/VolGroup01/LogVol00 /mnt/old So far, all done

Copyright © Windows knowledge All Rights Reserved