Skip to content

Automatic system snapshots

Ditana takes an automatic snapshot of the system state before every system upgrade, via a pacman hook. This is configured independently of the chosen filesystem under Expert Settings → System Maintenance Tools → Configure Automatic System Snapshots in the installer (enabled by default).

On ZFS and BTRFS, snapshots are atomic — captured at a single instant, with negligible storage and time overhead. On XFS and EXT4, Timeshift is used in rsync mode; the initial snapshot is the slowest one, and subsequent snapshots typically complete in under five seconds.

The first snapshot is taken by the installer itself, just before the first reboot. That means you have a clean baseline from day one — you can roll back to “freshly installed” without ever having performed an upgrade first.

Snapshots are system-only. Your home directory and other data volumes are not included. Restoring a system snapshot does not touch your personal files — roll back the system, keep your work.

Edge case: rolling back to the installer’s snapshot

Section titled “Edge case: rolling back to the installer’s snapshot”

If you roll back to the very first snapshot taken at the end of installation, one minor consequence: the first-boot Flatpak deployment service (ditana-flatpak-finalize.service) will run again on next login, reinstalling the Flatpaks you originally selected. This is by design — those Flatpaks are part of the configured system, so they are reinstated alongside everything else. Subsequent rollbacks (to later snapshots after first-boot completion) do not exhibit this.

Ditana ships its own zfs-autosnap fork, which removes the pacman lock file (/var/lib/pacman/db.lck) from the snapshot before capture. This means a ZFS rollback leaves you with a usable pacman immediately — no manual rm /var/lib/pacman/db.lck step. The upstream Timeshift variant for non-ZFS filesystems does not handle this, which is why the Timeshift recovery procedure below includes that manual step.

If your system fails to boot, boot from the Ditana ISO — it doubles as a rescue environment. The commands below restore a snapshot from inside the live system.

List available snapshots:

Terminal window
zfs list -t snapshot

Example output:

NAME USED AVAIL REFER MOUNTPOINT
ditana-root/ROOT/default@autosnap_2026-05-19_23-14-41 453K - 3.96G -
ditana-root/ROOT/default@autosnap_2026-05-19_23-25-28 394K - 3.96G -
ditana-root/ROOT/default@autosnap_2026-05-19_23-26-06 1.05M - 3.96G -

Restore a specific snapshot:

Terminal window
sudo zfs rollback ditana-root/ROOT/default@autosnap_2026-05-19_23-27-12

Automatic snapshots are managed by timeshift-autosnap, which creates a snapshot before every full upgrade.

List available snapshots:

Terminal window
sudo timeshift --list

Example output:

Mounted '/dev/dm-0 (sda4)' at '/run/timeshift/195216/backup'
Device : /dev/dm-0 (sda4)
Mode : RSYNC
Num Name Tags Description
------------------------------------------
0 > 2026-05-19_18-04-37 0 after installation of Ditana GNU/Linux

Restore a snapshot:

Terminal window
sudo timeshift --restore --snapshot 2026-05-19_18-04-37

When prompted, do not reinstall GRUB2 as Timeshift recommends — it assumes the presence of an update-grub tool that Ditana does not use. If you need to update GRUB after restoration, run:

Terminal window
grub-mkconfig -o /boot/grub/grub.cfg

After a Timeshift restore, also clear the pacman database lock:

Terminal window
sudo rm /var/lib/pacman/db.lck

This is required because timeshift-autosnap (the upstream project for non-ZFS filesystems) captures the pacman lock file as part of the snapshot. Ditana’s zfs-autosnap fork removes the lock file before snapshotting, which is why the equivalent step is unnecessary on ZFS (zfs rollback is sufficient).