This episode dives into LXC snapshots and clones: taking a snapshot with lxc-snapshot, listing them with -L, then cloning containers with lxc-copy — full copy for independence and -s (snapshot clone) which is disk-efficient with the btrfs/zfs backends.

In episode 8 we saw lxc-snapshot and lxc-copy at a glance. Now we'll break down both completely — because these are the skills that save you from sleepless nights after a system-breaking update. Snapshots for going backward (rollback), clones for going forward (scale out). In episode 9 we master both along with their backend trade-offs.
A snapshot is a recording of a container's state at a point in time: rootfs, config, and (on certain backends) process state. Use it before risky changes — big package updates, config changes, or experiments — so you always have a safe point to return to.
lxc-snapshot -n c1Its behavior depends on the backend:
lxc-snapshot -n c1 -LThe output shows a list of snapshots with index, creation date, and name if given:
1 2026-08-13 10:00:00 snap0
2 2026-08-13 12:30:00 snap1To restore the container to a snapshot's state:
lxc-snapshot -n c1 -r snap1Each snapshot can also be run as its own container for inspection (snapshots are auto-populated in /var/lib/lxc/c1/snaps/):
lxc-start -n c1/snap1
lxc-attach -n c1/snap1 -- ls /
lxc-stop -n c1/snap1Warning
Restore overwrites the container's current state. Make sure the snapshot you're restoring to is really the one you want — and for safe work, first copy the container to a new name with lxc-copy before experimenting with restore.
lxc-copy -n c1 -N c2A full copy creates a completely independent rootfs copy: changes in c2 don't affect c1, and vice versa. The cost: copy time and full disk space. Choose this when both containers will coexist long-term with different contents.
lxc-copy -n c1 -N c3 -sThe -s flag creates a snapshot clone: c3 shares data with c1 via the backend's copy-on-write mechanism. The process is nearly instant, and the disk used is only for the differences between the two. It's perfect for:
Tip
Choosing rule: need full independence and have spare disk? Full copy. Need fast duplication, disk savings, and a shared base? Snapshot clone (-s). Remember, a snapshot clone depends on its source — if the source is deleted, don't delete it before the clone is no longer in use.
lxc-snapshot -n c1 (safe point).lxc-snapshot -n c1 -r <snap> to go back.lxc-stop -n master.lxc-copy -n master -N node1 -s (and node2, node3...).lxc-snapshot -n master
lxc-copy -n master -N web-1 -s
lxc-copy -n master -N web-2 -s
lxc-start -n web-1
lxc-start -n web-2Note
Snapshots and clones involving runtime state (e.g. a database that's actively writing) should be done while the container is stopped or in a consistent state — otherwise the snapshot might capture files that are half-written. For critical data, combine with filesystem backups rather than relying only on snapshots.
Make sure the clone is truly separate:
lxc-ls -f
lxc-attach -n web-1 -- hostnameChange the hostname in web-1, then check that master doesn't change along with it — proof the isolation works.
Key takeaways:
lxc-snapshot -n c1 records a state; -L lists them; -r restores.lxc-copy -n c1 -N c2 = independent full copy; -s = disk-efficient snapshot clone.In the next episode 10 we'll cover autostart, systemd & service management — lxc.start.auto = 1 in the config, the lxc@.service systemd unit, the lxc-autostart command, running init/systemd inside containers, plus lxc-stop and lxc-shutdown for orderly shutdown.