backing up a non-functional Qubes installation

49 views
Skip to first unread message

Achim Patzner

unread,
May 13, 2016, 1:51:48 PM5/13/16
to qubes-users
Hi!

Is there a recommendation how to copy a Qubes setup to another machine if the system I need to move died during backup? Additional points if I could just copy the Qubes partition to another disk of appropriate size. Even more points if someone would tell me how to boot a Lenovo W540 using EFI (as that would permit me just to move the disk to different hardware).


Achim

Chris Laprise

unread,
May 13, 2016, 5:11:34 PM5/13/16
to Achim Patzner, qubes-users


On 05/13/2016 01:51 PM, Achim Patzner wrote:
> Hi!
>
> Is there a recommendation how to copy a Qubes setup to another machine if the system I need to move died during backup?

Did you kill it experimenting with PCI bridge passthrough? You could try
mounting the root LUKS partition with a trusted Live distro and perhaps
fix the settings.

Otherwise, you need to copy /var/lib/qubes to the other machine,
preferably one that has a fresh Qubes install. You can also copy the
dom0 user home folder and that will preserve some of your desktop settings.

> Additional points if I could just copy the Qubes partition to another disk of appropriate size. Even more points if someone would tell me how to boot a Lenovo W540 using EFI (as that would permit me just to move the disk to different hardware).

Do you mean UEFI? That should be possible if you also have secure boot
feature disabled.

> Achim

Chris

Marek Marczykowski-Górecki

unread,
May 13, 2016, 7:56:35 PM5/13/16
to Achim Patzner, qubes-users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Fri, May 13, 2016 at 07:51:44PM +0200, Achim Patzner wrote:
> Hi!
>
> Is there a recommendation how to copy a Qubes setup to another machine if the system I need to move died during backup? Additional points if I could just copy the Qubes partition to another disk of appropriate size.

Yes, you can. If you block copy it (dd) it should just work. But if you
copy just files, you'll need to adjust some settings (/etc/fstab,
bootloader parameters etc).
If you're switching from UEFI to legacy boot, you'll need to install
bootloader first, so it isn't that simple.

For really emergency data migration, you can:
1. Install Qubes on new disk
2. Shutdown all the VMs.
3. Remove all of them from libvirt:

virsh -c xen:/// list --all
virsh -c xen:/// undefine VMNAME (for all of them listed in by first
command)

4. Connect the old disk
5. Replace /var/lib/qubes with the one from old disk
6. Restart.

This will not handle all the settings (for example application menu will
not be restored), but will handle the most important parts (VM settings,
data).

> Even more points if someone would tell me how to boot a Lenovo W540 using EFI (as that would permit me just to move the disk to different hardware).

Looks like a common Lenovo UEFI bug, use first option here:
https://www.qubes-os.org/doc/uefi-troubleshooting/

- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJXNmmrAAoJENuP0xzK19csdPYH/RYJhkDS1T0RnjP6BMF9vSNc
LxlL3dSSpbHHTCfE4ypTwa8cBnlrTd/ZevypFgi6Pe32sai3aAU+1dqc2zBXRhFl
YGrhv9N1dEnmIbLf/28i6twBjPiQeQ1T3JK6vC799WI1ASlIUCWtZyh2xOIIgJr1
RiCnzclFxGIKlBoVwMEuGuy40geZ7UGTLMaJtKFg1kKC69c5PN+Sx0d98LdRyoI1
SNybc+sgmBm/fHMARZbtHV06K6VLyDwcwTK5igexIt88jFw4AqCIqtSildfutv8D
RC6FksC2309Kgy75Ac6vgWXRV357VeOnbDV2xge0vV2Xni84fC1CDWQZoEkaFlY=
=YAYK
-----END PGP SIGNATURE-----

Achim Patzner

unread,
May 15, 2016, 7:58:45 PM5/15/16
to qubes-users

> Am 13.05.2016 um 23:11 schrieb Chris Laprise <tas...@openmailbox.org>:
>
>
>
> On 05/13/2016 01:51 PM, Achim Patzner wrote:
>> Hi!
>>
>> Is there a recommendation how to copy a Qubes setup to another machine if the system I need to move died during backup?
>
> Did you kill it experimenting with PCI bridge passthrough?

No. After an arbitrary number of reboots (somewhere between 20 and 200 after installation of a new mainboard or delivery of a new machine) it isn’t able to do anything that requires loading an EFI image anymore. As even the “BIOS boot” is an EFI program (using the CSM) as well as anything else like running the on-board diagnostic application the machine is effectively dead. And you don’t have to have a crash or need to actively touch an EFI variable for this; just shut down the machine and try rebooting it.

Right now I had multiple repetitions of this running Qubes as last OS before dead, Windows 7 once, Windows 10 and Ubuntu also. I’ve got the slight suspicion that the Lenovo boot manager is buggy but writing a complaint to Lenovo only succeeded in their cancelling the on-site support ticket and demanding to get the machine into their lab. Without sending me a replacement (or offering to send me one). So much about “on-site NBD maintenance” (which was included in the package, you can’t buy it without).

> You could try mounting the root LUKS partition with a trusted Live distro and perhaps fix the settings.

On another system. This one is dead.

> Otherwise, you need to copy /var/lib/qubes to the other machine, preferably one that has a fresh Qubes install. You can also copy the dom0 user home folder and that will preserve some of your desktop settings.

I’m wondering if I should do this and copy everything to a btrfs (just to see if there is any advantage using something else but ext4).


>> Additional points if I could just copy the Qubes partition to another disk of appropriate size. Even more points if someone would tell me how to boot a Lenovo W540 using EFI (as that would permit me just to move the disk to different hardware).
>
> Do you mean UEFI? That should be possible if you also have secure boot feature disabled.

I tried using about every trick on the book with an easy target (rEFInd) but did not succeed. The W540 is a strange thing.


Achim

Achim Patzner

unread,
May 15, 2016, 8:05:50 PM5/15/16
to Marek Marczykowski-Górecki, qubes-users

> Am 14.05.2016 um 01:56 schrieb Marek Marczykowski-Górecki <marm...@invisiblethingslab.com>:
> For really emergency data migration, you can:
> 1. Install Qubes on new disk
> 2. Shutdown all the VMs.
> 3. Remove all of them from libvirt:
>
> virsh -c xen:/// list --all
> virsh -c xen:/// undefine VMNAME (for all of them listed in by first
> command)
>
> 4. Connect the old disk
> 5. Replace /var/lib/qubes with the one from old disk
> 6. Restart.

Worked, thank you. This should be documented somewhere as part of the FAQ. I just added “compare /etc” as additional item as I had to modify X11 quite a bit for the P50 (hardcoding resolution and panel size in several places)

> This will not handle all the settings (for example application menu will
> not be restored), but will handle the most important parts (VM settings,
> data).

Especially important if you didn’t succeed to create a backup after creating keys. 8-)

> Looks like a common Lenovo UEFI bug, use first option here:
> https://www.qubes-os.org/doc/uefi-troubleshooting/

This one is different; no matter what I’m throwing at it (Qubes install media, rEFInd, …) it just returns to the built-in boot manager menu.


Achim

Andrew David Wong

unread,
May 15, 2016, 10:49:43 PM5/15/16
to Achim Patzner, Marek Marczykowski-Górecki, qubes-users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 2016-05-15 17:05, Achim Patzner wrote:
> This should be documented somewhere as part of the FAQ.

Thanks, tracking:

https://github.com/QubesOS/qubes-issues/issues/1992

- --
Andrew David Wong (Axon)
Community Manager, Qubes OS
https://www.qubes-os.org
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJXOTU/AAoJENtN07w5UDAw9gQP/jTD90yOReEw6ZhHq3s7Ewiu
7BxrR5mL3xA+wRS0ZX/3tcbf3spqB8hzxxrJNQqtyueO0GI6AT99bmvaeZPOLgqy
j2879nHGvw1L0T0ai9vAts58JKYxTbS4WNygxjVPnVkHgRJc8aqpbhPl/IHdebLr
hWxJ8hWZS2MMcIqbwXtvCwxRRMlWBvxuJUq4GRbLeyn4xv2xwrMfazJGD7QEIcwd
LbghDGWdYctN8I0M0otJU4/N6o2qyngtO+tfCPv1hLPOrLpt5KULEGOMX0PdXoFd
/UJ9Zexw6EvXNg7lk5M79V1zly8+Xdy5dKJOMsWq8buaGpvBlHYhNUzUj9CHteOa
7TXmimfOadWkHD4ukVi08LFyNe6co+mRPORyQ+aUKk/uxtOU/Ppm7OIvbJ6yx2Dz
JCBNAjvERqtC+Lk5I7Lq8KXnkXOMabU6dpwFV9XFPi+6o/VPIiE9FEFdrj4kaXT+
luQxFFKfPG5Kqn0sw7toBMRYQNhfdTDdJQInLuQLCWIw3Q3Zo9ste2KnHjGU1dbo
XE1wYwNTLp/FO7bKcdDYSouz/E2+XNL2sGrDMQthpzWA3KndW+WCJVPavmH3UGSy
rQGWztxbO2FMUJo433UOs2OcDWHaP1A6nuAn4rOzPPANJ+toP/3J5h8nzH/x0vFn
rgA7uTdfwuRSULFqzgXX
=5pgz
-----END PGP SIGNATURE-----

Reply all
Reply to author
Forward
0 new messages