I have a somewhat disfunctional disk (call it disk B) with lvm which I wanted to inspect on another machine (both machines are virtual machines on Azure). I attached disk B to another machine which also has a similar disk (disk A). Both disks have a volume group root-vg; so I renamed the volume group of disk B, to be able to mount the disks logical volumes. All went fine, I was able to mount the disk and investigate the issues... Now after some work is done on disk B, I want to attach the disk back to the original machine. But now I cannot rename the volume group of disk B back, since the name is already in use by disk A. I was thinking about renaming the volume group of disk A, then rename disk B to root-vg, remove disk B and then rename the volume group of disk A back. But I'm not sure if that is a good idea at all.
Is there another solution to this I'm missing here?
(Forcing vgrename by -f
did not work.)