How can I recover my Qube'sVM if I cannot boot anymore ?

41 views
Skip to first unread message

cacao...@tutanota.com

unread,
Mar 21, 2020, 9:10:02 PM3/21/20
to Qubes Users

Hello,

I cannot boot on Qubes anymore but I can access the file system. When I mount my qubes partition, it give me a huge mess of small 2g partition and bigger ones.

My goal is to reinstall qubes and I would like to restore my old VM with the backup restoration and migration feature of qubes.

Is it possible and if so, which files should I look for ?

If not, what are my other options ?




Chris Laprise

unread,
Mar 22, 2020, 1:48:10 AM3/22/20
to cacao...@tutanota.com, Qubes Users
On 3/21/20 9:09 PM, cacaosucre via qubes-users wrote:
> Hello,
>
> I cannot boot on Qubes anymore but I can access the file system. When I
> mount my qubes partition, it give me a huge mess of small 2g partition
> and bigger ones.
>
> My goal is to reinstall qubes and I would like to restore my old VM with
> the backup restoration and migration
> <https://www.qubes-os.org/doc/backup-restore/> feature of qubes.
>
> Is it possible and if so, which files should I look for ?
>
> If not, what are my other options ?
>
>
> ( this is a clone the following reddit post :
> https://www.reddit.com/r/Qubes/comments/fmjr98/how_can_i_recover_my_qubesvm_if_i_cannot_boot/
> )

Assuming you didn't make backups before the crash: You need to have a
running Qubes system to backup VMs the normal way.

If you have room to spare on your disk, you may be able to install Qubes
in that space. At that point, you have some options after booting into
the fresh Qubes install. One is to define a Qubes storage pool that
points to the old Qubes partition, but I'm not 100% sure how Qubes will
react in that case.

Another way: In your new Qubes system, create VMs of the same name and
then copy the relevant 'vm*-private' volumes from your old partition/vg
into the current one using 'dd conv=sparse'. Repeat with any 'vm*-root'
volumes for templates or standalone VMs you want to bring over. Lastly,
this method does NOT bring over special VM settings, but if you had some
that were firewall configs you can copy those easily from
/var/lib/qubes/ on the old partition to the same path in the new dom0.
OTOH, if you didn't customize any VM settings then its not really an issue.

One other possibility: There is an unofficial 'Qubes Live' distro you
could use to boot into Qubes from USB stick or DVD. Maybe you could use
it to try the storage pool technique without having to do an install.

--
Chris Laprise, tas...@posteo.net
https://github.com/tasket
https://twitter.com/ttaskett
PGP: BEE2 20C5 356E 764A 73EB 4AB3 1DC4 D106 F07F 1886

haaber

unread,
Mar 22, 2020, 6:57:44 AM3/22/20
to qubes...@googlegroups.com
[Initial question: snipped ]
>> I cannot boot on Qubes anymore but I can access the file system. When
>> I mount my qubes partition, it give me a huge mess of small 2g
>> partition and bigger ones.

[Chris' answer -- snipped ]

> Assuming you didn't make backups before the crash: You need to have a
> running Qubes system to backup VMs the normal way.

Does that mean Chris, that in case of a disaster, there is no way to
backup your data "by hand" (booting a live linux, opening the luks ..)
because of a "thin pool" mess? That sounds in first hand like a strong
argument against the use of thin pools! As you know a lot about thin
pools, could you please comment on that, Chris? thx, Bernhard

dhorf-hfre...@hashmail.org

unread,
Mar 22, 2020, 7:11:36 AM3/22/20
to haaber, qubes...@googlegroups.com
On Sun, Mar 22, 2020 at 11:57:38AM +0100, haaber wrote:
> > Assuming you didn't make backups before the crash: You need to have a
> > running Qubes system to backup VMs the normal way.
> Does that mean Chris, that in case of a disaster, there is no way to
> backup your data "by hand" (booting a live linux, opening the luks ..)
> because of a "thin pool" mess? That sounds in first hand like a strong
> argument against the use of thin pools! As you know a lot about thin
> pools, could you please comment on that, Chris? thx, Bernhard

thin pools are plain linux tech, nothing qubes specific.
and you can back them up in whatever way you want, from whatever
distro/system you want.
or not back them up at all, and simply attach the disk to some
other system.

it is not trivial to use the _qubes_ backup tooling outside
of a qubes system.
but besides that, they are just blockdevices with filesystems inside.



Chris Laprise

unread,
Mar 22, 2020, 1:17:59 PM3/22/20
to dhorf-hfre...@hashmail.org, haaber, qubes...@googlegroups.com
Right. Another way to phrase my advice is that the "vm*-private" volumes
are simply disk images and contain all the data for regular appVMs. For
templates and standalone VMs, the "vm*-root" volumes are also a part of
the VM's data. Backing these up can be pretty simple, since they are
block devices accessible from /dev/qubes_dom0 and you can use 'dd' or
'dd | gzip' or whatever. You could even use my backup tool (wyng).

The perceived "mess" is actually rather organized, and has nothing to do
with LVM thin pools. If you had installed Qubes with non-LVM storage,
you would still have separate disk image files for each VM. You can make
the volume list more readable with 'lvs | grep private' to filter out
non-private volumes.

Of course there is Qubes-specific metadata (i.e. the Settings dialog for
your VM) in /var/lib/qubes/qubes.xml and maybe firewall.xml files in the
subdirs there. But these should only matter if you changed VM settings
in the Settings dialog or via 'qvm-prefs' or 'qvm-firewall' commands,
and even then many settings like 'Memory' and 'Applications' are trivial.

Finally... It should be possible to write a recovery script for this
situation, which presents the user with a list of VMs to recover and
optionally allows you to recover the contents of /var/lib/qubes.

Peter Funk

unread,
Mar 23, 2020, 10:13:26 AM3/23/20
to Chris Laprise, Qubes OS users mailing list
Dear Chris,

Chris Laprise schrieb am Sonntag, den 22.03.2020 um 13:17:
...
> The perceived "mess" is actually rather organized, and has nothing
> to do with LVM thin pools.
...
I beg your pardon for stealing this discussion thread to ask a somewhat
related question: Can you recommend some text for reading about how
the varying storage demands from the various VMs are handled in Qubes
OS internally for someone who wants to learn more about this?

Best regards, Peter Funk
--
Peter Funk ✉:Oldenburger Str.86, 27777 Ganderkesee, Germany; 📱:+49-179-640-8878
signature.asc

Chris Laprise

unread,
Mar 24, 2020, 1:28:54 PM3/24/20
to Peter Funk, Qubes OS users mailing list
On 3/23/20 10:13 AM, Peter Funk wrote:
> Dear Chris,
>
> Chris Laprise schrieb am Sonntag, den 22.03.2020 um 13:17:
> ...
>> The perceived "mess" is actually rather organized, and has nothing
>> to do with LVM thin pools.
> ...
> I beg your pardon for stealing this discussion thread to ask a somewhat
> related question: Can you recommend some text for reading about how
> the varying storage demands from the various VMs are handled in Qubes
> OS internally for someone who wants to learn more about this?
>
> Best regards, Peter Funk
>

I don't think its documented, but the relevant code should be here:

https://github.com/QubesOS/qubes-desktop-linux-manager/blob/3f080ae2c01150d75d91bfb39a9ee273b7b6de92/qui/tray/disk_space.py#L37
Reply all
Reply to author
Forward
0 new messages