Automatic System Snapshots

Utilizing Automatic System Snapshots and Recovery Procedures

Automatic system snapshots are configured independently of the chosen file system when the corresponding setting is enabled (see “Expert Settings” ⇒ “System Maintenance Tools” ⇒ “Configure Automatic System Snapshots”). These snapshots are created each time a complete system upgrade is performed. On ZFS and BTRFS filesystems, these snapshots are atomic, meaning they occur almost instantaneously and ensure a consistent state by capturing all files at the exact same point in time.

The initial snapshot is taken at the end of the installation process. Additionally, for XFS and EXT4 filesystems, this strategy offers the advantage that the first snapshot in a running system requires significantly less time (typically under 5 seconds), similar to subsequent snapshots.

Recovery Procedure

If your system fails to boot, you can recover by booting from the ISO, which provides access to a rescue system. Within this environment, you can use the commands below to restore a snapshot.

Note: As these are “system snapshots,” your home directory and other volumes remain unchanged. This allows you to restore a system snapshot without affecting your personal files.

Filesystem-Specific Instructions

ZFS

  1. List Available Snapshots:

    zfs list -t snapshot
    

    Example output:

    ❯ zfs list -t snapshot 
    NAME                                                    USED  AVAIL  REFER  MOUNTPOINT
    ditana-root/ROOT/default@autosnap_2024-11-21_23-14-41   453K      -  3.96G  -
    ditana-root/ROOT/default@autosnap_2024-11-21_23-25-28   394K      -  3.96G  -
    ditana-root/ROOT/default@autosnap_2024-11-21_23-26-06  1.05M      -  3.96G  -
    
  2. Restore a Snapshot:

    sudo zfs rollback <SNAPSHOT_NAME>
    

    Example:

    sudo zfs rollback ditana-root/ROOT/default@autosnap_2024-11-21_23-27-12
    

BTRFS, XFS, EXT4

Automatic snapshots are managed by the timeshift-autosnap package and do not require additional configuration via Timeshift. This package ensures that system snapshots are created automatically during each Arch Linux system upgrade.

  1. List Available Snapshots:

    sudo timeshift --list
    

    Example output:

    > sudo timeshift --list
    Mounted '/dev/dm-0 (sda4)' at '/run/timeshift/195216/backup'
    Device : /dev/dm-0 (sda4)
    UUID : cca08543-da4e-44a0-839b-d20e6f258c9a
    Path : /run/timeshift/195216/backup
    Mode : RSYNC
    Status : OK
    1 snapshots, 14.2 GB free
    
    Num Name Tags Description
    --------------------------------------------------
    0 > 2024-12-21_18-04-37 0 after installation of Ditana GNU/Linux
    
  2. Restore a Snapshot:

    sudo timeshift --restore --snapshot <SNAPSHOT_ID>
    

    Example:

    > sudo timeshift --restore --snapshot 2024-12-21_18-04-37
    Mounted '/dev/dm-0 (sda4)' at '/run/timeshift/208067/backup'
    
    **************************************************************************
    * To restore with default options, press the ENTER key for all prompts! *
    **************************************************************************
    
    Press ENTER to continue...
    
    Re-install GRUB2 bootloader? (recommended) (y/n): n