Restore tool needs a verify-only option

34 views
Skip to first unread message

cprise

unread,
May 19, 2014, 11:54:41 AM5/19/14
to qubes...@googlegroups.com
qvm-backup-restore should have a way to verify the integrity of an already existing backup without having to actually restore the data.

Also, it there a way I can do the verification manually? The wiki page only talks about verifying data that was restored.


Axon

unread,
May 19, 2014, 12:00:09 PM5/19/14
to cprise, qubes...@googlegroups.com
cprise:
Would just doing the first two steps of the "emergency recovery"
procedure fit the bill? That is:

1. Untar the main backup file.

[user@restore ~]$ cd backups
[user@restore backups]$ tar -i -xvf qubes-backup-2013-12-26-123456
qubes.xml.000
qubes.xml.000.hmac
vm1/private.img.000
vm1/private.img.000.hmac
vm1/icon.png.000
vm1/icon.png.000.hmac
vm1/firewall.xml.000
vm1/firewall.xml.000.hmac
vm1/whitelisted-appmenus.list.000
vm1/whitelisted-appmenus.list.000.hmac
dom0-home/dom0user.000
dom0-home/dom0user.000.hmac

2. Verify the integrity of the private.img file which houses your data.

[user@restore backups]$ openssl dgst -hmac "your_passphrase"
vm1/private.img.000
HMAC-SHA1(vm1/private.img.000)= 0d5855222a697d0568cf97792318fe53fe963a05
[user@restore backups]$ cat vm1/private.img.000.hmac
(stdin)= 0d5855222a697d0568cf97792318fe53fe963a05

The hash values should match. If they do not match, then the backup file
may have been tampered with, or there may have been a storage error.

signature.asc

cprise

unread,
May 19, 2014, 12:13:57 PM5/19/14
to qubes...@googlegroups.com, cprise, ax...@openmailbox.org


On Monday, May 19, 2014 12:00:09 PM UTC-4, Axon wrote:
cprise:
> qvm-backup-restore should have a way to verify the integrity of an already
> existing backup without having to actually restore the data.
>
> Also, it there a way I can do the verification manually? The wiki page only
> talks about verifying data that was restored.
>

Would just doing the first two steps of the "emergency recovery"
procedure fit the bill? That is:

1. Untar the main backup file.


That would fall under "verifying restored files". I don't want to write 100+GB of files to disk in the process.

Perhaps it would have been better to backup the data by piping the tar file through a standard compression tool like xz. This would allow the archive to be easily verified against disk or transmission errors.

cprise

unread,
May 20, 2014, 7:11:46 PM5/20/14
to Axon, qubes...@googlegroups.com
So, I wrote this and am able to verify my backup with it -- See attached
script...

verify-qbackup

Axon

unread,
May 20, 2014, 9:44:20 PM5/20/14
to cprise, qubes...@googlegroups.com
cprise:
Just out of curiosity, in what sorts of situations might one want/need
to verify the integrity of an existing backup without first restoring
the data? (I'm sure there are a bunch, but I'm struggling to think of
concrete examples by myself.)

Also, a thought occurred to me: Does the GUI restoration tool allow for
this functionality? (I seem to remember that you get to a screen where
you can view all of the VMs in the backup file and choose which ones you
want to restore. Would this not amount to verifying the integrity of the
backup without restoring, if you simply cancel at that screen?)

signature.asc

Franz

unread,
May 20, 2014, 10:33:41 PM5/20/14
to Axon, cprise, qubes...@googlegroups.com
Just before a fresh install. You are going to delete your system and all your data is only on your backup. If it is corrupt, how do you restore your system?

I was so afraid of that, that  before fresh installing RC on my machine,  installed it on an external USB SSD, restored the backup there and only after being satisfied with that  installed RC on my machine.

Best

cprise

unread,
May 20, 2014, 11:03:27 PM5/20/14
to Axon, qubes...@googlegroups.com
Any situation where your original copy (working system) will be
oblitterated, such as doing a fresh re-install of the OS. In my case, I
didn't want to be left with only one copy (the original backup) for X
number of hours and I wasn't even sure if it was good. Archive
verification is a pretty standard function; it would be nice to have it
built-in, but I have a feeling the current backup tool will be replaced
with something better anyway.

> Also, a thought occurred to me: Does the GUI restoration tool allow for
> this functionality? (I seem to remember that you get to a screen where
> you can view all of the VMs in the backup file and choose which ones you
> want to restore. Would this not amount to verifying the integrity of the
> backup without restoring, if you simply cancel at that screen?)

I don't think that is whats happening at that point; seems the restore
util is just reading a list. It actually takes close to an hour to
verify such a large tarfile with even the most efficient code.

If qvm-backup-restore had an option to send the output to /dev/null (or
not even try to) then I would consider that an acceptable verification
process. But it would be no faster than my script (although faster and
less wear than actually writing the files to disk).

Axon

unread,
May 21, 2014, 2:10:12 AM5/21/14
to cprise, qubes...@googlegroups.com
cprise:
Thank you both. I agree that being able to verify the backup is very
important, then.

signature.asc
Reply all
Reply to author
Forward
0 new messages