Differences between qvm-volume revert & qvm-backup-restore

hi @Insurgo

this thread is to parallel continue the thread how to create snapshots,
since maybe a bit off topic.

maybe i am not at that level yet,
so i feel hard to understand your explanation in how to create snapshots.

i confuse, do you mind to explain, what’s the difference between:

  • qvm-volume revert
  • qvm-backup-restore

whether restore backup = reverting volume in /dev/qubes_dom0/*back ?

are there any other functionality, that has same / similar purpose, as reverting / restoring ?

A lot of things are mixed.

When you do a backup and restore such backup, qubes will attempt to restore templates/qubes to their original locations, if they do not exist, otherwise, if my memory is good, restoring them with a -number suffix.

Those backups are not restored into -back volumes, which are linked to voumes snapshots rotation Coping with OS-level snapshot rotation · Issue #88 · tasket/wyng-backup · GitHub

When you would call qvm-volume restore qube:volume where volume is either root/private, you are asking qvm-volume to restore the latest -back volume snapshot you have available for that qube/template in its original location without further confirmation

That restores that -back volume into its original lvm (in standard installation here, trying to not mix things here). qvm-volume does the abstraction of the pool type, just like qubes backup tool.

restoring a backup will not overwrite a volume, it will create another volume and appends a suffix to it so you can investigate if you will, and then rename the qubes as you’d like and or delete as you’d like.

The sole purpose of qvm-volume revert qube:volume is to revert a qube to its past state in case of a user error.

Main use case is “DAMN! I just deleted xyz important file. Let’s revert.” Or: “Oupsies, I just deleted a configuration file doing rm ryz from the command line.” In such case, you can calmly shutdown that template/qube and simply call qvm-volume revert qube:volume, where volume is private in the case of a qube where a file deleted under /home/ happened, or volume being root in the case you messed up a configuration file under the template you were currenlty modifying.

qvm-backup-restore is useable in case you have a backup available to restore.
qvm-volume restore is available, with two snapshots states (two past shutdown states) in case of mishaps, quick cancellation.

Hope this is clearer. Don’t hesitate to quote replies from the 3 separate threads you created.