Differences between volume: kernel, private, root, volatile

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.

while qvm-volume list , i found there are 4 types of volume
i confuse, do you mind to explain, what’s the difference between:

  • kernel
  • private
  • root
  • volatile

why each VM has 4 types of volume ?

& then, some volume are revert possible, and some are not.
therefore, based on what reason they are revert-able or not ?

also, on what kind of condition we need to revert those volume ?

  • kernel volume: Qubes OS exposes a kernel volume for the qubes to boot a kernel made available through dom0 updates. This kernel is used by qubes by default and eases maintainership of Qubes to have a same kernel+initrd used for all appvms, properly tested, instead of having the OS deploy and use a linux distro specific Xen compatible kernel. One can switch the behavior, but this is not subject of your question here.

For the 3 other volumes, the notion of persistence and inheritance from Qubes documentation is needed as a background: Templates | Qubes OS

  • volatile volume: The volatile volume is another exception not taken into consideration in snapshots. The volatile volume is a read/write root overlay, aimed at giving the qube the illusion that / is read/write. As the name gives insights about, this volatile volume is discarded by that qube at shutdown. This volatile volume overlay is the reason why yo ucan install applications under a qube that will not be available on next reboot, unless that application is installed in the Template.

  • private volume: relative mainly to /home. This is basically what a “qube” is. It contains qubes related data, outside of the template. This one is “mounted” under /home under a qube. So snapshots of a private volume will give different point in time versions of user’s related content.

  • root volume: relative to / (also called “root”). This is for templates, and contains all the filesystem. This is basically the operating system. Snapshots of root volumes will give different point in time versions of OS related content.

There would be no reason to keep snapshots of neither kernel nor volatile volumes.
Having revertible snapshots of root and private volumes makes sense, because those would be desirable to be revertible.

Qubes keeps 2 revisions by default of any root and private volumes it created, outside of dom0’s root volumes.

Let’s picture that quickly:

[user@dom0 ~]$ ls /dev/qubes_dom0/vm-personal-private*

So one could, cautiously do two
qvm-volume revert personal:private here, where doing so would revert first to epoch timestamps 1668974971, second would revert to earliest snapshot with epoch timestamp 1668544875.

The same applies to template’s root volumes and private volumes, or standalones private and root volumes.

That thread is relative to creating dom0’s root snapshot which are currently not created by default.

Note that another thread relative to dom0’s root snapshot is here: Dom0 backup/snapshot?