I've switched to using Qubes with BTRFS when upgrading to 4.2, and my backup script broke as a result (the script mounts some qubes as read-only images to an offline backup qube and rsync
s any changes).
The method previously used for mounting was the one here: https://www.qubes-os.org/doc/mount-lvm-image/, which doesn't work with BTRFS since the images don't show up as devices in the same way.
The only change that needed to be made was changing the $dev
variable:
$YOUR_APPVM=personal
# Set up loop device, like /dev/loop42, that can be used with qubesdb-write
loopdevice=$(sudo losetup --find --read-only --show /var/lib/qubes/appvms/$YOUR_APPVM/private.img)
# Remove the leading /dev/ from the losetup output
dev=${loopdevice#/dev/}
Note that the path for a template will be different than for an appvm, check /var/lib/qubes
to find that path.
Then follow the rest of the steps from https://www.qubes-os.org/doc/mount-lvm-image/ to mount the image.
After detaching, remove the loop device since it's no longer needed:
sudo losetup -d $loopdevice