Qubes uses copy-on-write snapshots to achieve this. With a default
install, that means an LVM "thin pool" holds all of the VM volumes, and
when a VM starts a snapshot is taken of both "disk A" and "disk B" (the
*-root and *-private volumes). With a normal AppVM (base on a template)
the root and private volumes are treated differently on shutdown: Root
snapshot is discarded, and private is rotated to replace the persistent
copy (what appears in the VM as /rw and /home).
A similar snapshot routine is used if you installed Qubes with Btrfs
format instead of LVM (Btrfs is a copy-on-write filesystem).
Copy-on-write provides the ability to create new representations or
snapshots of an existing file or volume, instantly. Snapshotting is like
copying, but using a collection of pointers instead of the data itself.
Thus, when a new snapshot is changed, the system only needs to write
some new blocks in a different location and replace some pointers in the
snapshot's metadata to point to the new location. This all can save a
lot of time and disk space.
--
Chris Laprise,
tas...@posteo.net
https://github.com/tasket
https://twitter.com/ttaskett
PGP: BEE2 20C5 356E 764A 73EB 4AB3 1DC4 D106 F07F 1886