2020-04-26 06:18:55 -04:00
|
|
|
---
|
2021-03-13 13:06:18 -05:00
|
|
|
lang: en
|
2020-04-26 06:18:55 -04:00
|
|
|
layout: doc
|
2021-06-16 22:56:25 -04:00
|
|
|
permalink: /doc/volume-backup-revert/
|
2020-04-26 06:18:55 -04:00
|
|
|
redirect_from:
|
2020-04-26 06:28:41 -04:00
|
|
|
- /en/doc/volume-backup-revert/
|
|
|
|
- /doc/VolumeBackupRevert/
|
|
|
|
- /wiki/VolumeBackupRevert/
|
2021-03-13 13:06:18 -05:00
|
|
|
ref: 206
|
2021-07-08 21:06:41 -04:00
|
|
|
title: Volume backup and revert
|
2020-04-26 06:18:55 -04:00
|
|
|
---
|
|
|
|
|
|
|
|
With Qubes, it is possible to revert one of a VM's 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
|
|
|
|
[Backup, Restoration, and Migration](/doc/backup-restore/) process.)
|
|
|
|
|
|
|
|
In Qubes, when you create a new VM, it's volumes are stored in one of the
|
|
|
|
system's [Storage Pools](/doc/storage-pools/). On pool creation, a
|
|
|
|
revisions_to_keep default value is set for the entire pool. (For a pool creation
|
2021-06-18 04:55:53 -04:00
|
|
|
example, see [Storing app qubes on Secondary Drives](/doc/secondary-storage/).)
|
2020-04-26 06:18:55 -04:00
|
|
|
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:
|
|
|
|
|
2021-03-13 12:03:23 -05:00
|
|
|
```
|
|
|
|
qvm-volume info vmname:private
|
|
|
|
```
|
2020-04-26 06:18:55 -04:00
|
|
|
|
2021-03-13 12:03:23 -05:00
|
|
|
The output of the above command will also display the "Available revisions
|
2020-04-26 06:18:55 -04:00
|
|
|
(for revert)" at the bottom. For a very large volume in a small pool,
|
|
|
|
revisions_to_keep should probably be set to the minimum value of 1 to minimize
|
|
|
|
the possibility of the pool being accidentally filled up by snapshots. For a
|
2021-03-13 12:03:23 -05:00
|
|
|
smaller volume for which you would like to have the future option of reverting,
|
2020-04-26 06:18:55 -04:00
|
|
|
revisions_to_keep should probably be set to at least 2. To set
|
|
|
|
revisions_to_keep for this same VM / volume example:
|
|
|
|
|
2021-03-13 12:03:23 -05:00
|
|
|
```
|
|
|
|
qvm-volume config vmname:private revisions_to_keep 2
|
|
|
|
```
|
2020-04-26 06:18:55 -04:00
|
|
|
|
|
|
|
With the VM stopped, you may revert to an older snapshot of the private volume
|
|
|
|
from the the above list of "Available revisions (for revert)", where the last
|
|
|
|
item on the list with the largest integer is the most recent snapshot:
|
|
|
|
|
2021-03-13 12:03:23 -05:00
|
|
|
```
|
|
|
|
qvm-volume revert vmname:private <revision>
|
|
|
|
```
|