Btrfs migration of broken qubes install to new qubes install?

Broke my old dom0 trying to config something. Want to migrate all my old qube appvms to the fresh dom0 install thats waiting.

Tried mounting the old ssd via USB from a new qubes install.

Following How to mount a Qubes partition from another OS — Qubes OS Documentation

Realized this is not LVM. However can’t even pass disk to dom0 getting "qvm-block: error: backend vm dom0 doesn’t expose device xvdi.

Due to hardware my only option is usb enclosure of the old install ssd connected to the new install on ssd.

If it matters vgdisplay also displays no output. I’m guessing because this is LVM only?

Due to hardware best option is somehow to attach usb of old install to new install through dom0. And some how clone those qubes to the new install.

I’m not expert about btrfs, can only click btrfs option during install. So whats the easiest way to do this? Drive decrypts fine. Thnx

To clarify: Both the old and the new Qubes OS installation are Btrfs? And the old installation’s drive has been connected through USB - currently in the new installation’s sys-usb or directly in its dom0? (Either way is fine, but the instructions are different)

Yes correct.

Correct.

Yes am using sys-usb option. And if required I don’t know how to connect USB directly to dom0, so would need instructions.

Thank you for your time.

For each AppVM you want to restore, you could create a new VM and copy over the old storage. Assuming that you’ve mounted your decrypted old installation* in sys-usb at /mnt/removable/, and that you’re restoring an AppVM called work and you’ve already created a new AppVM of the same name, which is not currently running:

[root@dom0 ~]# VM=work
[root@dom0 ~]# VOLUME=private
[root@dom0 ~]# rm /var/lib/qubes/appvms/$VM/$VOLUME*.img*
[root@dom0 ~]# qvm-run --pass-io --user=root sys-usb "cd /mnt/removable/root/var/lib/qubes/appvms/$VM && if test -e $VOLUME-dirty.img; then cat $VOLUME-dirty.img; else cat $VOLUME.img; fi" | cp --sparse=always /dev/stdin /var/lib/qubes/appvms/$VM/$VOLUME.img
[root@dom0 ~]# chmod 600        /var/lib/qubes/appvms/$VM/$VOLUME.img
[root@dom0 ~]# chown root:qubes /var/lib/qubes/appvms/$VM/$VOLUME.img

For a StandaloneVM (they are confusingly stored in /var/lib/qubes/appvms/ as well) you’d also have to repeat these steps with VOLUME=root instead of VOLUME=private


* I’m also assuming your old installation used the installer’s automatic way to create a Btrfs layout, which puts the dom0 filesystem hierarchy into a Btrfs subvolume called root, hence /mnt/removable/root/var/lib/qubes/… (otherwise adjust that path)