Skip to contentSkip to conversation

how to change UUID of PV of duplicate partition (followup)

linux-lvm Xen 3 participants 6 messages Jan 6, 2017

lore
Share & tools
lore

Xen

author
#0 lore raw

I mean,

This is what I mean:

Found duplicate PV 3U9ac3Ah5lcZUf03Iwm0cgMMaKxdflg0: using /dev/sdb4
not /dev/sdc4
Using duplicate PV /dev/sdb4 without holders, replacing /dev/sdc4 Volume group containing /dev/sdb4 has active logical volumes Physical volume /dev/sdb4 not changed
0 physical volumes changed / 1 physical volume not changed

It immediately replaced the good PV with the bad PV (that I was trying to change) so I cannot actually get to the "bad" PV (which is duplicate) to change it without booting an external system in which I can effect one disk in isolation.

But, after running that command my root filesystem was now mounted read-only instantly so even just attaching the disk basically causes the entire system to instantly fail.

Real good right.

Probably my entire fault right :-/.

"Let's cause this system to crash, we'll attach a harddisk." "Job done!"

Actually I guess in this case it replaced the bad with the good but behind the scenes something else happened as well. This time it is hiding /dev/sdc4, the other time it was hiding /dev/sdb4, it seems to be random.

Basically any eSata system that a disk gets attached to could cause the operating system to fail. The same would probably be true of regular USB disks.

Even inserting a USB stick could crash a system like this.

#1 lore raw
Quoted 4 lines · Xen

This is what I mean:

Found duplicate PV 3U9ac3Ah5lcZUf03Iwm0cgMMaKxdflg0: using /dev/sdb4 not
/dev/sdc4

The handling of duplicate PVs has been entirely redone in recent versions. The problems you are having are well known and should now be fixed.

author
#2 lore raw

David Teigland schreef op 06-01-2017 20:19:

Quoted 9 lines · Xen
Quoted 5 lines

This is what I mean:

Found duplicate PV 3U9ac3Ah5lcZUf03Iwm0cgMMaKxdflg0: using /dev/sdb4
not
/dev/sdc4

The handling of duplicate PVs has been entirely redone in recent versions. The problems you are having are well known and should now be fixed.

Oh right, I was going to write my LVM version, but did not manage to produce it yet, sorry :p.

Good to know. Yeah I am using 16.04 from Ubuntu's version.

LVM version: 2.02.133(2) (2015-10-30)
Library version: 1.02.110 (2015-10-30)
Driver version: 4.34.0

Sigh... I guess I'll have to make some time to start using a recent version then on this system. Perhaps it was due time. Always these old versions...

#3 lore raw

Dne 6.1.2017 v 20:21 Xen napsal(a):

Quoted 15 lines

David Teigland schreef op 06-01-2017 20:19:

Quoted 8 lines · Xen
Quoted 4 lines

This is what I mean:

Found duplicate PV 3U9ac3Ah5lcZUf03Iwm0cgMMaKxdflg0: using /dev/sdb4 not
/dev/sdc4

The handling of duplicate PVs has been entirely redone in recent versions. The problems you are having are well known and should now be fixed.

Oh right, I was going to write my LVM version, but did not manage to produce it yet, sorry :p.

Good to know. Yeah I am using 16.04 from Ubuntu's version.

Quoted 8 lines

LVM version: 2.02.133(2) (2015-10-30)
Library version: 1.02.110 (2015-10-30)
Driver version: 4.34.0

Sigh... I guess I'll have to make some time to start using a recent version then on this system. Perhaps it was due time. Always these old versions...

_______________________________________________

You can always 'fix it' you way.

Just setup device filter in lvm.conf so you either see diskA or diskB

In you particular case:

filter = [ "r|/dev/sdb4|" ]

or

filter = [ "r|/dev/sdc4|" ]

And set/change things with your existing lvm2 version....

Regards

Zdenek

author
#4 lore raw

Zdenek Kabelac schreef op 06-01-2017 21:06:

Quoted 6 lines

You can always 'fix it' you way.

Just setup device filter in lvm.conf so you either see diskA or diskB

In you particular case:

Quoted 8 lines

filter = [ "r|/dev/sdb4|" ]

or

filter = [ "r|/dev/sdc4|" ]

And set/change things with your existing lvm2 version....

Oh right, thank you man. I was looking for that but barring an option available on pvchange or vgimportclone itself I just decided to go the easy package upgrade route with David's help or suggestion.

I knew that should have been possible, so thanks. I just hadn't gotten around to diving into the config file yet. Much appreciated.

Regards.

author
#5 lore raw
In reply to David Teigland

David Teigland schreef op 06-01-2017 20:19:

Quoted 9 lines · Xen
Quoted 5 lines

This is what I mean:

Found duplicate PV 3U9ac3Ah5lcZUf03Iwm0cgMMaKxdflg0: using /dev/sdb4
not
/dev/sdc4

The handling of duplicate PVs has been entirely redone in recent versions. The problems you are having are well known and should now be fixed.

Thank you. I've installed the version from Ubuntu 16.10 and the vgimportclone command worked fine now :).

Still gives those same errors mostly (the duplication detection output) and provides no other success output that made me a little scared,

WARNING: PV 3U9ac3-Ah5l-cZUf-03Iw-m0cg-MMaK-xdflg0 on /dev/sdc4 was
already found on /dev/sdb4.
WARNING: PV 3U9ac3-Ah5l-cZUf-03Iw-m0cg-MMaK-xdflg0 prefers device
/dev/sdb4 because device is used by LV.
WARNING: PV 3U9ac3-Ah5l-cZUf-03Iw-m0cg-MMaK-xdflg0 on /dev/sdc4 was
already found on /dev/sdb4.
WARNING: PV 3U9ac3-Ah5l-cZUf-03Iw-m0cg-MMaK-xdflg0 prefers device
/dev/sdb4 because of previous preference.
Couldn't find device with uuid ZvvuxB-8sgu-quBO-ZQDW-zKr8-pYzI-qF1ygK.

Particularly because one half of a mirrored LV is always missing :p so I get that last line too, but because I don't memorize my PV UUIDs I'm always a bit uncertain what it could mean :P.

But the output from lvs indicated that the result was achieved:

msata-lv coll -wi------- 28,91g
raid-lv coll -wi------- 464,36g
msata-lv coll2 -wi-ao---- 28,91g
raid-lv coll2 -wi-ao---- 464,36g

(I renamed my vgs in reverse after the fact).

The above is a terrible design choice I made lol. Instead of creating an extra partition which would have meant an extended partition to hold 2 distinct PVs, I embedded them in a single partition using a single PV.

The amount of trouble that gives.

Anyway, thank you for your dear answers, previously I was told it was all my fault because I was stupid and didn't know how to use the tools properly.

So thanks for that, cya.