Linux: LVM Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
Během přenášení dat mezi dvěma disky může najít ke kolizi VG names. V mém případě se to stalo, když jsem vyměnil v PC původní disk za nový a pak se snažil data z nového překopírovat na ten nový, takže poměrně častá situace...
Chyba
WARNING: VG name vgkubuntu is used by VGs RoU4KK-ZvH1-Wuyc-Zqna-tcRe-0jgL-e1pIyA and xYkBEY-lHg6-B0Ym-WJKz-0b0q-mcYD-Qv3cRX.
Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
WARNING: activating multiple VGs with the same name is dangerous and may fail.
Řešení
Řešením je provést přejmenování VG name na starém disku takto:
sudo vgchange -ay
WARNING: VG name vgkubuntu is used by VGs RoU4KK-ZvH1-Wuyc-Zqna-tcRe-0jgL-e1pIyA and xYkBEY-lHg6-B0Ym-WJKz-0b0q-mcYD-Qv3cRX.
Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
WARNING: activating multiple VGs with the same name is dangerous and may fail.
device-mapper: create ioctl on vgkubuntu-root LVM-RoU4KKZvH1WuycZqnatcRe0jgLe1pIyA19vjGvXQWCh5yG8Hyms9voCV627Cj4gI failed: Device or resource busy
device-mapper: create ioctl on vgkubuntu-swap_1 LVM-RoU4KKZvH1WuycZqnatcRe0jgLe1pIyAJmIfAiTGjwpaM40Te7j53zYb7eMclpXc failed: Device or resource busy
0 logical volume(s) in volume group "vgkubuntu" now active
WARNING: activating multiple VGs with the same name is dangerous and may fail.
2 logical volume(s) in volume group "vgkubuntu" now active
sudo vgdisplay
WARNING: VG name vgkubuntu is used by VGs RoU4KK-ZvH1-Wuyc-Zqna-tcRe-0jgL-e1pIyA and xYkBEY-lHg6-B0Ym-WJKz-0b0q-mcYD-Qv3cRX.
Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
--- Volume group ---
VG Name vgkubuntu
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 110,55 GiB
PE Size 4,00 MiB
Total PE 28302
Alloc PE / Size 28300 / <110,55 GiB
Free PE / Size 2 / 8,00 MiB
VG UUID RoU4KK-ZvH1-Wuyc-Zqna-tcRe-0jgL-e1pIyA
--- Volume group ---
VG Name vgkubuntu
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 221,62 GiB
PE Size 4,00 MiB
Total PE 56735
Alloc PE / Size 56735 / 221,62 GiB
Free PE / Size 0 / 0
VG UUID xYkBEY-lHg6-B0Ym-WJKz-0b0q-mcYD-Qv3cRX
# nyní konečně přejmenování VG name "RoU4KK-ZvH1-Wuyc-Zqna-tcRe-0jgL-e1pIyA" na "newname"
sudo vgrename RoU4KK-ZvH1-Wuyc-Zqna-tcRe-0jgL-e1pIyA newname
WARNING: VG name vgkubuntu is used by VGs RoU4KK-ZvH1-Wuyc-Zqna-tcRe-0jgL-e1pIyA and xYkBEY-lHg6-B0Ym-WJKz-0b0q-mcYD-Qv3cRX.
Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
Processing VG vgkubuntu because of matching UUID RoU4KK-ZvH1-Wuyc-Zqna-tcRe-0jgL-e1pIyA
Volume group "RoU4KK-ZvH1-Wuyc-Zqna-tcRe-0jgL-e1pIyA" successfully renamed to "newname"
sudo vgscan --mknodes
Found volume group "newname" using metadata type lvm2
Found volume group "vgkubuntu" using metadata type lvm2
sudo vgchange -ay
2 logical volume(s) in volume group "newname" now active
2 logical volume(s) in volume group "vgkubuntu" now active