Upgrading system packages, installing proprietary GPU drivers, or modifying kernel modules on Ubuntu Desktop can occasionally lead to unbootable black screens or login loops. While traditional filesystem backups using rsync require copying gigabytes of files across drives, using Timeshift paired with a Btrfs filesystem enables atomic, sub-second snapshot creation at the block layer. If an update destabilizes the operating system, users can roll back the entire root partition to a known working state directly from the GRUB bootloader or a live USB session.
Understanding Btrfs Subvolume Layout for Timeshift
Timeshift’s Btrfs mode requires the root and home filesystems to reside on standard Ubuntu subvolumes named @ (root directory) and @home (user home directories). This subvolume isolation ensures that rolling back the operating system reverts system binaries, kernels, and configurations without touching your personal documents, downloads, or browser databases in /home.
| Subvolume | Mount Point | Rollback Scope | Preservation Behavior |
|---|---|---|---|
@ |
/ (Root) |
Kernels, APT packages, systemd configs, libraries. | Replaced completely upon system rollback. |
@home |
/home |
User files, desktop documents, local application configs. | Preserved untouched across system restorations. |
Installing Timeshift on Ubuntu
Timeshift is available directly in the official Ubuntu repositories:
sudo apt update
sudo apt install timeshift -y
You can verify whether your root filesystem is formatted with Btrfs by running:
findmnt / -o FSTYPE
If the output returns btrfs, Timeshift can leverage native copy-on-write snapshots. If it returns ext4, Timeshift defaults to RSYNC mode, which copies files to an external disk.
Configuring Automated Snapshot Schedules
Launch Timeshift from your application menu or configure it via the command-line interface:
# Check Timeshift status and target devices
sudo timeshift --check
# Create an immediate manual system snapshot
sudo timeshift --create --comments "Baseline working configuration" --tags D
In the graphical configuration wizard:
- Select BTRFS as the snapshot type and click Next.
- Select your system drive containing the root Btrfs partition.
- Under Schedule, enable Daily snapshots with a retention limit of 5, and Boot snapshots with a retention limit of 3.
- Under Users, ensure
@homeis excluded from system snapshots so personal files remain safe. - Click Finish. Timeshift registers a systemd timer daemon to automate snapshot creation in the background.
Rolling Back the System from Terminal or Live Media
If a graphics driver crash or broken configuration leaves the desktop unstable:
# List available snapshot restore points
sudo timeshift --list
# Restore the system to a chosen snapshot
sudo timeshift --restore
The interactive CLI displays available snapshots tagged with their timestamps and descriptions. Select the index of your target snapshot, confirm the target subvolume mapping (@ mapped to /dev/sdX), and press Enter.
Integrating Snapshots into GRUB for Emergency Recovery
For ultimate protection against kernel panics that prevent booting into a terminal, install grub-btrfs:
sudo apt install git make -y
git clone https://github.com/Antynea/grub-btrfs.git
cd grub-btrfs
sudo make install
This generates dynamic snapshot entries inside the GRUB boot menu. If the current kernel fails to boot, reboot your computer, hold Shift or Esc to access GRUB, select Timeshift Snapshots, and choose a prior working state to boot directly into a working desktop.