Sounds like you made some alterations that I cannot help you with.
But just mentioning that hard shutdowns have been causing me problems too. I get back in with a combination of rebooting multiple times and when i get past the login with no qubes/vms launching open a dom0 Terminal and run:
Boot from some Live USB and mount Qubes.
Assuming /dev/nvme0n1n3 - your Qubes LUKS partition.
# Decrypt LVM and mount dom0
sudo cryptsetup open /dev/nvme0n1n3 qubes_dom0
sudo vgchange -ay
sudo mount /dev/mapper/qubes_dom0-root /mnt
# Edit backup and change transaction ID to what it was before
sudo cp /mnt/etc/lvm/backup/qubes_dom0 /mnt/etc/lvm/backup/qubes_dom0.backup
sudo nano /mnt/etc/lvm/backup/qubes_dom0
# Restore the new metadata
sudo vgcfgrestore qubes_dom0 --file /mnt/etc/lvm/backup/qubes_dom0
# Need --force
sudo vgcfgrestore qubes_dom0 --file /mnt/etc/lvm/backup/qubes_dom0 --force
sync
Thank you @tzwcfq for trying to help! Unfortunately it did not seem to solve the problem. The second command vgchange -ay took a very long time (about an hour) and printed a bunch of these errors:
Thin pool qubes_dom0-vm--pool-tpool (253:9) transaction_id is 8558, while expected 8560.
Then I could mount the partition, but file /mnt/etc/lvm/backup/qubes_dom0 does not contain any mentions of 8558 and the first transaction_id is actually 8560 (and later, many other numbers, too). So I don’t understand what I should change in this file. Subsequent reboot without changes did not solve the problem.
By the way, I had to perform a couple of impossible tasks for that: choosing an ultimately trusted USB stick and an ultimately trusted live distro… Is reinstalling always a more secure action in such cases (so lost data might even worth it)?
You can try to follow this guide: https://blog.monotok.org/lvm-transaction-id-mismatch-and-metadata-resize-error/
After you create volume config backup with: vgcfgbackup vg-fed -f /home/<user>/backup
Open the file /home//backup and change the transaction_id in qubes_dom0 { logical_volumes { vm-pool { segment1 { transaction_id = XXX } } } } block:
Change vg-fed to qubes_dom0 and thin-fed to vm-pool in the giudes commands.
It’s a good practice to keep a trusted USB with Live system for a system rescue.
Since you’ll need to create a trusted USB with Qubes installer ISO to reinstall the system anyway then you can create and use it for system rescue when you boot from it and enter Troubleshooting → Rescue a Qubes OS system in grub.
Thank you very much, my problem is solved now! Pure magic!
The problem is (or was) that the transaction_id was already correct (if you trust the error message from vgchange -ay). So I changed it to the “wrong” one, 8558. I guesst it’s not why the problem got solved.
and, after some waiting, it fixed the problem for me. I can boot and even the VMs can start. Booting however takes a bit more time for some reason with a slight delay at
Job is running for LVM event activation on device 253:0
I guess I will just backup the qubes and reinstall the OS, just in case.
This “transaction-id is xxxx, while expected yyyy” issue just occured here. Unfortunately that blogpost is down but it is in the archives. So the solution was: