How to Configure Timeshift for Automated Btrfs System Snapshots in Ubuntu

Applying major distribution upgrades, proprietary graphic driver updates, or experimental kernel packages on Ubuntu occasionally destabilizes system initialization, resulting in black screens or broken boot sequences. While traditional backup tools like rsync duplicate gigabytes of files slowly, modern Linux copy-on-write (CoW) filesystems solve disaster recovery instantaneously. Timeshift paired with the Btrfs filesystem creates atomic, zero-second system snapshots that consume negligible disk space until files are modified, allowing administrators to roll back kernel failures in seconds directly from the GRUB bootloader.

Understanding Btrfs Subvolume Snapshots vs RSYNC Backups

Timeshift operates across two distinct storage backends:

  • RSYNC Mode: Uses hard links on standard ext4 filesystems. While functional on any drive, creating snapshots requires scanning every file, taking several minutes and generating disk I/O load.
  • Btrfs Mode (Recommended): Utilizes native kernel-level Btrfs subvolumes (@ for root and @home for user data). Snapshots are captured atomically in milliseconds via filesystem metadata pointers without copying data blocks.

Installing Timeshift in Ubuntu

Install the official Timeshift package via APT:

sudo apt update && sudo apt install -y timeshift

If administering a headless Ubuntu Server, Timeshift includes full command-line functionality alongside its desktop GTK interface.

Configuring Timeshift with Btrfs Subvolumes

To configure automated snapshots via terminal:

  1. Verify that your root filesystem is formatted as Btrfs:
    findmnt / -o FSTYPE,TARGET
  2. Launch the initial Timeshift setup or create a manual baseline snapshot:
    sudo timeshift --create --comments "Initial System Baseline" --btrfs
  3. Timeshift instantly targets the @ root subvolume and creates a read-only snapshot located under /run/timeshift/backup/timeshift-btrfs/snapshots/.

Automating Scheduled Daily and Boot Snapshots

Edit Timeshift configuration parameters directly in /etc/timeshift/timeshift.json or through the GUI wizard:

{
  "backup_device_uuid": "YOUR-BTRFS-UUID",
  "parent_slice": "",
  "do_first_run": "false",
  "btrfs": "true",
  "include_btrfs_home_for_backup": "false",
  "schedule_hourly": "0",
  "schedule_daily": "5",
  "schedule_boot": "3",
  "count_daily": "5",
  "count_boot": "3"
}

Note: System snapshots should exclude personal documents in @home to prevent document rollbacks during OS restores. Store personal data on separate backup volumes.

Restoring System State from CLI or GRUB

If a software update corrupts graphic drivers or system packages:

  1. List available local snapshots:
    sudo timeshift --list
  2. Restore a known working snapshot by specifying its timestamp tag:
    sudo timeshift --restore --snapshot "2026-10-21_02-00-00" --target /dev/nvme0n1p2
  3. If the system fails to boot into the graphical environment entirely, reboot into an Ubuntu Live USB, open a terminal, and run sudo timeshift --restore to swap subvolumes back to functional states.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.