"pvchange --uuid" failed when PV is in use
Hello,
I tried to "pvchange --uuid /dev/sdc1" to change of PV UUID. But FAILED to change PV UUID on PV metadata, only changed on VG metadata. I'm trying to correct source code, please help.
When PV is orphan, "pvchange --uuid /dev/sdc1" changes PV UUID successfully. At this time, pvchange calls pv_write(). But when PV is in use by VG, pvchange only calls vg_write(), pv_write() is not called.
vg_write() does not have function to change PV metadata. Therefore, probably pvchange needs to call pv_write() to write UUID into PV metadata. But pv_write() is forbidden to call when PV is in use by VG. LV is not mounted... Even if there was no LV, it failed.
Please teach me why it is forbidden.
If there is a method of allowing pv_write(), I want to try it.
BTW, I want to activate VG on raw-level duplicated PV. I look for this ML. When edit lvm.conf and "pvchange --uuid" and vgrename, it turned out that it is possible. However, if pvchange does not function correctly, there is no how to adopt a measure.
Best Regards,
Signature · 3 lines
/* ------------------------------------------------------------- Shinn'ya Hoshino mailto:[email protected] ------------------------------------------------------------- */
Quoted 3 lines · Shinn'ya Hoshino
I tried to "pvchange --uuid
/dev/sdc1" to change of PV UUID. But FAILED to change PV UUID on PV metadata, only changed on VG metadata. I'm trying to correct source code, please help.
I'd hoped to extend vg_write to handle this, but it got too complicated and I didn't complete it.
I've checked an alternative fix into CVS.
(Treats it like vgreduce + pvchange -u + vgcfgrestore then
optimises most of the intermediate steps away)
Alasdair
Signature · 1 line
[email protected]
Quoted 3 lines · Alasdair G Kergon
I've checked an alternative fix into CVS.
(Treats it like vgreduce + pvchange -u + vgcfgrestore then
optimises most of the intermediate steps away)
I could "pvchange --uuid" non-orphan PV successfully, and duplicated VG successfully activated.
Thanks.
Signature · 3 lines
/* ------------------------------------------------------------- Shinn'ya Hoshino mailto:[email protected] ------------------------------------------------------------- */