I took my hard drive and connected it to another computer with Linux installed. Both HDs had a PV which contained a VG named “vg00″. This collistion was the first time I had encounterd this situation and had to solve it to get access to files on both VGs.
During boot I noticed messages saying there two vg00 on the machine and one is taken precedence over the other. Example message:
[lvm] WARNING: Duplicate VG name vg00: Existing
K0qKAk-Ph5i-BcAX-y4yp-SPF3-TZgj-DufR3L (created here) takes precedence
The trivial solution is to rename the extra VG to something different and get the access I want to the files. But there are two problems:
- As the first vg00 has precedence, I can’t do actions on the second one. The LVM commands ignore the second one.
- I can’t act on the first VG as it’s active for most of the system’s file systems.
Trying vgrename command with the second VG UUID didn’t work. I had to deactivate the first VG first (luckily I have the root FS outside of LVM), rename it, and rename the second VG and then rename the first VG again.
This resulted in having vg00 and vg01. And now I could activate them both and access the files.
I hope to have the time to reproduce the problem on another distro to make sure that’s a general LVM2 problem. Having renmae by UUID would save time to fix the problem and help people who need to boot from CD just to get their VG deactivated (since root FS is on LVM).