qubes-doc/user/advanced-topics/volume-backup-revert.rst
Marek Marczykowski-Górecki 7e464d0f40
Convert to RST
This is done using tools at
https://github.com/maiska/qubes-translation-utilz, commit
4c8e2a7f559fd37e29b51769ed1ab1c6cf92e00d.
2025-07-04 14:23:09 +02:00

35 lines
2 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

========================
Volume backup and revert
========================
.. warning::
This page is intended for advanced users.
With Qubes, it is possible to revert one of a VMs storage volumes to a previous state using the automatic snapshot that is normally saved every time a VM is shutdown. (Note that this is a different, lower level activity than the :doc:`Backup, Restoration, and Migration </user/how-to-guides/how-to-back-up-restore-and-migrate>` process.)
In Qubes, when you create a new VM, its volumes are stored in one of the systems :doc:`Storage Pools </user/advanced-topics/secondary-storage>`. On pool creation, a ``revisions_to_keep`` default value is set for the entire pool. (For a pool creation example, see :doc:`Storing app qubes on Secondary Drives </user/advanced-topics/secondary-storage>`.) Thereafter, each volume associated with a VM that is stored in this pool inherits the pool default ``revisions_to_keep``.
For the private volume associated with a VM named *vmname*, you may inspect the value of ``revisions_to_keep`` from the dom0 CLI as follows:
.. code:: bash
qvm-volume info vmname:private
The output of the above command will also display the “Available revisions (for revert)” at the bottom. For a very large volume in a small pool, ``revisions_to_keep`` should probably be set to the maximum value of 1 to minimize the possibility of the pool being accidentally filled up by snapshots. For a smaller volume for which you would like to have the future option of reverting, ``revisions_to_keep`` should probably be set to at least 2. To set ``revisions_to_keep`` for this same VM / volume example:
.. code:: bash
qvm-volume config vmname:private revisions_to_keep 2
With the VM stopped, you may revert to an older snapshot of the private volume from the above list of “Available revisions (for revert)”, where the last item on the list with the largest integer is the most recent snapshot:
.. code:: bash
qvm-volume revert vmname:private <revision>