LVM problem during upgrade to 4.3

At long last I started my upgrade to 4.3. I went for in-place upgrade, and ran the steps manually:

  • stage1 barfed on debian10 template (I did not consider that critical) and whonix17 ones (same, I have found them essentially broken and found no time to dig)
  • stage 2 and 3 apparently went OK

Now after the reboot, cryptsetup does its job, I see dracut-initqueue for lvm volumes, reporting

  • qubes_dom0/swap and /root apparently OK
  • “check of qubes_dom0/pool00 failed (status:64). Manual repair required!”
  • then a timeout waiting for the dom0 root

After that I’m in single-user root shell, and strangely:

  • /dev/mapper only contains a node for dom0 swap, not even for root
  • lvm lvs does show all LVs, including the dom0 root (showing it is actually in pool00)
  • lvm vgck qubes_dom0 does not show any issue

Any idea?

lvm lvconvert --repair qubes_dom0/pool00 actually looks like it managed to recover things here…

status:64 on a thin pool means the thin metadata failed its activation check, and metadata/data exhaustion is a common cause on Qubes storage - lvs -o+data_percent,metadata_percent qubes_dom0 shows how close pool00 was to either limit before the upgrade. lvconvert --repair rebuilds that metadata from the on-disk bitmap, so thin volumes mid-transaction at failure time can be lost. After the repair, did every qube’s storage volume come back, or did any disappear?

I did not start up each and every qube yet, but did not notice any loss for now.

Sure my disk is always flirting with the 80/90% data full (metadata much less), but I actually made a big purge of unvaluable artifacts from my largest VMs right before the pre-upgrade backup, I was likely below 75% at that time.

No need to boot every qube to know whether the volumes survived: each qube’s storage volume is an LV in qubes_dom0, so lvs qubes_dom0 lists them all whether or not the qube has ever started, and one missing from that list is gone. Worth checking alongside that: a spare pool metadata LV is reserved space in the VG that lvconvert uses when repairing a pool (controlled by --poolmetadataspare), and at 75% data with metadata low, exhaustion looks like an unlikely trigger for the status:64 you saw. Does lvs qubes_dom0 show a spare metadata LV next to pool00’s, or is there none?

With lvs -a qubes_dom0 I do see a lvol1_pmspare.
Too bad the repair did not give much details (or t least I don’t recall seeing any).

lvconvert --repair just runs the thin repair utility on the pool, so a quiet run is normal - it reports success or failure rather than what it found. The detail you want lives in the metadata itself: lvconvert --swapmetadata extracts a pool’s metadata LV, preserves the extracted copy under the name of the LV that replaced it, and once that LV is out of the pool it can be activated directly and read with thin_dump, which lists every thin device the metadata still knows about. Before anything like that, one cheap check: does lvs -a qubes_dom0 show a second metadata LV alongside pool00’s current one, or only pool00’s plus lvol1_pmspare?

Aside from the various domains’ disks, the whole list is:

  LV                                            VG         Attr       LSize    Pool   Origin                                        Data%  Meta%  Move Log Cpy%Sync Convert
  [lvol1_pmspare]                               qubes_dom0 ewi------- 1016.00m                                                                                             
  pool00                                        qubes_dom0 twi-aotz--  843.57g                                                      78.45  28.88                           
  pool00_meta0                                  qubes_dom0 -ri-a----- 1016.00m                                                                                             
  [pool00_tdata]                                qubes_dom0 Twi-ao----  843.57g                                                                                             
  [pool00_tmeta]                                qubes_dom0 ewi-ao---- 1016.00m                                                                                             

Data% 78.45 is already past the thin_pool_autoextend_threshold example of 70, so before the failure the pool should have been auto-extending - but per the lvm2 config docs that only happens when dmeventd is monitoring the LV, and only while the volume group still has free extents to grow into. The metadata side looks roomy by comparison: pool00_tmeta at 28.88% with lvol1_pmspare reserved at the same size. Two numbers worth checking next: whether dmeventd is running and monitoring pool00, and vgs qubes_dom0 free space. Does vgs qubes_dom0 show free extents left in the volume group, or is pool00 already sized to the whole disk?