<div dir="ltr"><div>For a case like this vgcfgrestore is probably the best option.  man vgcfgrestore.<br></div><div><br></div><div>You need to see if you have archived vg copies that you can revert to before the "add" of the pv that went bad.</div><div><br></div><div>The archives are typically  in /etc/lvm/archiive/<vgname>* on RedHat derivative OSes, not sure if they are different(and/or configured to exist) on other distributions.<br></div><div><br></div><div>grep -i before /etc/lvm/archive/<vgname>* and see which archive was made before the initial pv addition.  vgcfgrestore -f <goodconfig> should work but I usually have to adjust command line options to get it work when I have used it to revert configs.  I think in that case it will find the vg and pvid correctly.  No cleanup should need to be done so long as the other device is completely gone.<br></div><div><br></div><div>And you will probably need to answer some prompts and warnings, and then reboot the machine, and/or do this all under a livecd rescue boot.</div><div><br></div><div>What kind of cheap ssd were you using?  I have had really bad luck with ones without RAM.  I RMA'ed one that failed in under a week and the new one also failed in a very similar way in under a week.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 28, 2022 at 1:38 AM Roger James <<a href="mailto:roger@beardandsandals.co.uk">roger@beardandsandals.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>

<div>
<div dir="auto">
Hi,<div dir="auto"><br></div><div dir="auto">I am struggling to recover from a failed pvmove. Unfortunately I only have a limited knowledge of lvm. I setup my lvm configuration many years ago.</div><div dir="auto"><br></div><div dir="auto">I was trying to move a lv to a SSD using pvmove. Unfortunately my brand new SSD choose that moment to fail (never buy cheap SSDs, lesson learnt!").</div><div dir="auto"><br></div><div dir="auto">This is the current status.</div><div dir="auto"><br></div><div dir="auto">roger@dragon:~$ sudo pvs</div><div dir="auto">  WARNING: Couldn't find device with uuid uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ.</div><div dir="auto">  WARNING: VG wd is missing PV uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ (last written to [unknown]).</div><div dir="auto">  PV         VG Fmt  Attr PSize    PFree</div><div dir="auto">  /dev/sda1  wd lvm2 a--  <465.76g      0</div><div dir="auto">  /dev/sdb1  wd lvm2 a--  <465.76g <80.45g</div><div dir="auto">  /dev/sdc2  wd lvm2 a--   778.74g 278.74g</div><div dir="auto">  /dev/sdd1  wd lvm2 a--  <465.76g      0</div><div dir="auto">  [unknown]  wd lvm2 a-m  <784.49g 685.66g</div><div dir="auto">roger@dragon:~$ sudo lvs</div><div dir="auto">  WARNING: Couldn't find device with uuid uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ.</div><div dir="auto">  WARNING: VG wd is missing PV uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ (last written to [unknown]).</div><div dir="auto">  LV   VG Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert</div><div dir="auto">  home wd -wi-------    1.46t                                               </div><div dir="auto">  root wd -wI-----p- <108.83g                                               </div><div dir="auto">  swap wd -wi-------    8.00g                                               </div><div dir="auto">  work wd -wi-------  200.00g                                               </div><div dir="auto">roger@dragon:~$ sudo vgs</div><div dir="auto">  WARNING: Couldn't find device with uuid uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ.</div><div dir="auto">  WARNING: VG wd is missing PV uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ (last written to [unknown]).</div><div dir="auto">  VG #PV #LV #SN Attr   VSize VFree</div><div dir="auto">  wd   5   4   0 wz-pn- 2.89t 1.02t</div><div dir="auto"><br></div><div dir="auto">This is a recap of what I have tried so far.</div><div dir="auto"><br></div><div dir="auto">roger@dragon:~$ sudo pvmove --abort</div><div dir="auto">  WARNING: Couldn't find device with uuid uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ.</div><div dir="auto">  WARNING: VG wd is missing PV uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ (last written to [unknown]).</div><div dir="auto">  LVM command executed by lvmpolld failed.</div><div dir="auto">  For more information see lvmpolld messages in syslog or lvmpolld log file.</div><div dir="auto">roger@dragon:~$ sudo vgreduce --removemissing wd</div><div dir="auto">  WARNING: Couldn't find device with uuid uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ.</div><div dir="auto">  WARNING: VG wd is missing PV uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ (last written to [unknown]).</div><div dir="auto">  WARNING: Couldn't find device with uuid uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ.</div><div dir="auto">  WARNING: Partial LV root needs to be repaired or removed.</div><div dir="auto">  WARNING: Partial LV pvmove0 needs to be repaired or removed.</div><div dir="auto">  There are still partial LVs in VG wd.</div><div dir="auto">  To remove them unconditionally use: vgreduce --removemissing --force.</div><div dir="auto">  To remove them unconditionally from mirror LVs use: vgreduce --removemissing --mirrorsonly --force.</div><div dir="auto">  WARNING: Proceeding to remove empty missing PVs.</div><div dir="auto">  WARNING: Couldn't find device with uuid uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ.</div><div dir="auto">roger@dragon:~$ sudo lvchange -an wd/root</div><div dir="auto">  WARNING: Couldn't find device with uuid uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ.</div><div dir="auto">  WARNING: VG wd is missing PV uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ (last written to [unknown]).</div><div dir="auto">roger@dragon:~$ sudo vgreduce --removemissing wd</div><div dir="auto">  WARNING: Couldn't find device with uuid uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ.</div><div dir="auto">  WARNING: VG wd is missing PV uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ (last written to [unknown]).</div><div dir="auto">  WARNING: Couldn't find device with uuid uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ.</div><div dir="auto">  WARNING: Partial LV root needs to be repaired or removed.</div><div dir="auto">  WARNING: Partial LV pvmove0 needs to be repaired or removed.</div><div dir="auto">  There are still partial LVs in VG wd.</div><div dir="auto">  To remove them unconditionally use: vgreduce --removemissing --force.</div><div dir="auto">  To remove them unconditionally from mirror LVs use: vgreduce --removemissing --mirrorsonly --force.</div><div dir="auto">  WARNING: Proceeding to remove empty missing PVs.</div><div dir="auto">  WARNING: Couldn't find device with uuid uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ.</div><div dir="auto">roger@dragon:~$ sudo lvremove wd/pvmove0</div><div dir="auto">  WARNING: Couldn't find device with uuid uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ.</div><div dir="auto">  WARNING: VG wd is missing PV uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ (last written to [unknown]).</div><div dir="auto">  WARNING: Couldn't find device with uuid uMtjop-PmMT-603f-GWWQ-fR4f-s4Sw-XSKNXZ.</div><div dir="auto">  Can't remove locked logical volume wd/pvmove0.</div><div dir="auto"><br></div><div dir="auto">I am quite happy to loose the root lv, I just need the home and work lvs. What am I missing?</div><div dir="auto"><br></div><div dir="auto">Help!</div><div dir="auto"><br></div><div dir="auto">Roger</div><div dir="auto"><br></div>
</div></div>

_______________________________________________<br>
linux-lvm mailing list<br>
<a href="mailto:linux-lvm@redhat.com" target="_blank">linux-lvm@redhat.com</a><br>
<a href="https://listman.redhat.com/mailman/listinfo/linux-lvm" rel="noreferrer" target="_blank">https://listman.redhat.com/mailman/listinfo/linux-lvm</a><br>
read the LVM HOW-TO at <a href="http://tldp.org/HOWTO/LVM-HOWTO/" rel="noreferrer" target="_blank">http://tldp.org/HOWTO/LVM-HOWTO/</a><br>
</blockquote></div>