Qubes VM snapshots using git / SVN

86 views
Skip to first unread message

Patrick Schleizer

unread,
Dec 5, 2016, 3:03:43 PM12/5/16
to qubes-users, Whonix-devel
Has anyone used git / SVN on huge Qubes templates (in case they break
during upgrades or for development purposes) for snapshot / rollback
purposes and can can share some tips (for speeding git it up)?

(Since qvm-revert-template-changes works only on templates and can
revert only to the previews state, not any after multiple VM restarts.)

(Previously posted here:)
https://forums.whonix.org/t/qubes-vm-snapshots-using-git-svn

Andrew David Wong

unread,
Dec 5, 2016, 8:42:47 PM12/5/16
to Patrick Schleizer, qubes-users, Whonix-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
What are the pros and cons of managing templates under Git (as opposed
to, say, manually `cp -r`ing a template directory)?

Pros of Git:
* Organization (timestamps, metadata, commit messages, etc.)
* Saves disk space? (can't be much, since Git has to store every
distinct binary file)

Cons of Git:
* Complex operations performed in dom0 (non-zero security risk)
* A lot slower than `mv`

Is this accurate? Are there others?

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

iQIcBAEBCgAGBQJYRheRAAoJENtN07w5UDAwKJgQAKGDVbcobfdLqPePDLk/QeVu
2hmYvl57EEiRbjGme5EKxGsu/aZD6/Oqeb4NN1XjGWGk4V5YHaYJUoeoRB5aFgWo
NXykuuCcAhbmTCBhJsarczvfOm09LpynUYOm77vqyrNsQZe9V/2EerkUb7U7mUrJ
E8xTJcAzSTKAEQXCsp98kuKgzI2OOJ6frBIcA1u5xlaYKkSskfr85hF+xIuD/cWm
ZD2Mdz/R7uoNqah/x/sQVaxlwjGR8e6+SG06Oz5hfRBCtV4JS/qgCtP/gD5zwDtW
F2zMXzAtGVttSCAdj44AcxMTArywLRrQXQhxBeNCqsEUBHZYLsjQvN3XSYm9dteF
PFDe1GsIOKCOIyebO6dsdeUWhByncLhYCxFXBQGLykSKP894CP6WCJm9LB1SxuqX
ZwiFZDOlAVPi8tDPcNAMf9FEoshdZ/l/Z6gm2XgB2ettmgN6Uy2QqJ3jvkE4XEIM
8Kep2HORQ4/3kd0LNXuN1as0eNNQ9cRKKMA2fSwfU/zlZLB2QvDtKs3wP6HO5eUx
8cODVfJTQsToyZYwGLYKERFxTZKz8Lows7W8HJ0QbiEZkeKjTVQvoK3YQkBYZqSD
kicfnfhn7a+U0z67YeHXeH0goEdLJHGlKPnYb4HyJeH9HhnnWixJwwKb+C0WlFvA
/4BTnVxGWDPJCmNJgEvc
=aNz7
-----END PGP SIGNATURE-----

Patrick Schleizer

unread,
Dec 5, 2016, 9:06:23 PM12/5/16
to Andrew David Wong, qubes-users, Whonix-devel
Why I used git:

* I found it simpler and quicker to type to manage the whole
/var/lib/qubes/vm-templates/vm-name including all files using git rather
than manually that folder.

Chris Laprise

unread,
Dec 6, 2016, 1:14:43 AM12/6/16
to Patrick Schleizer, Andrew David Wong, qubes-users, Whonix-devel
Using LVM or Btrfs snapshots would accomplish this far more quickly and
efficiently. Its also much closer to standard practice for managing disk
volumes.

On Btrfs, if I wanted snapshots to contain a certain folder, I could
make that folder into a subvolume and then start snapshotting it.
Alternately, I could forgo subvolumes and use 'cp --reflink source dest'
to create COW copies.

LVM is less flexible and requires more commands, but your system may
already be setup with it and it would at least give you snapshots
without any need to copy large volumes of data unnecessarily.

Chris
Reply all
Reply to author
Forward
0 new messages