Today, a friend has a problem with the server hard disk. after a new hard disk is installed and the old hard disk is mounted, a problem occurs. in linux, use the new hard disk to install the system, after the installation, mount the original hard disk. the partition format is all the default partitions of the system. The system uses the lvm format by default, and the default volumes are VolGroup00.
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 ~] # Pvs
Pv vg Fmt Attr PSize PFree
/Dev/sda2 VolGroup00 lvm2. a-372.50G 0
/Dev/sdb2 VolGroup00 lvm2 a-136.62G 0
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 VolGroup00 VolGroup01
Found 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-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.00 M 120372.50G 0 dcHa6G-abU2-Xfq8-EPBm-jBLj-sf18-O5uH0U
VolGroup00 wz -- n-32.00 M 120136.62G 0 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-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' [1.94 GB] inherit
ACTIVE '/dev/VolGroup00/logvol00' [367.09 GB] inherit
ACTIVE '/dev/VolGroup00/logvol01' [5.41 GB] inherit
The 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
Run: lvscan
[Root @ localhost ~] # Lvscan
ACTIVE '/dev/VolGroup01/logvol00' [134.69 GB] inherit
ACTIVE '/dev/VolGroup01/logvol01' [1.94 GB] inherit
ACTIVE '/dev/VolGroup00/logvol00' [367.09 GB] inherit
ACTIVE '/dev/VolGroup00/logvol01' [5.41 GB] inherit
VolGroup01 is ACTIVE.
Last mount
[Root @ localhost ~] # Mount/dev/VolGroup01/LogVol00/data/www
Now, all are completed.