Backup, Snapshot, and Restore Linux installations using Timeshift

Backup, Snapshot, and Restore Linux installations using Timeshift

If you mess up (or are going to mess up) some config files or drivers, it is always good to have a fallback point. The de-facto standard for doing this on Linux is Timeshift

Timeshift for Linux is an application that provides functionality similar to the System Restore feature in Windows and the Time Machine tool in Mac OS. Timeshift protects your system by taking incremental snapshots of the file system at regular intervals. These snapshots can be restored at a later date to undo all changes to the system.

Install

The package, timeshift, is available on all flavors of linux. Follow your distributions instructions to install a program.

For Debian/Ubuntu based systems:
$ sudo apt install timeshift

Create a Backup

While going through the initial setup, make sure to:
  1. Select RSYNC as the snapshot type
         This will allow you to have your backups stored on a different drive/partition. BTRFS should be selected only if you are on a btrfs system and are making backups and snapshots in the same drive.
  2. If you have multiple drives or a network share, you can choose the desired location for backups and snapshots.
  3. Enable backups for home directory
You can also set-up automatic backups as shown below:

Create a Snapshot

Before making a significant change to the system you can manually create a snapshot as a fallback in case you break something:

Restore

You can simply open Timeshift and click on the desired snapshot and restore it. The system will reboot during the restore process.
 
To restore a backup if the GUI doesn’t work or if you can’t boot: 
  1. Boot into a Live Linux environment, say Ubuntu 
  2. Install Timeshift in the Live Environment
  3. Open Timeshift, it should show snapshots that are in the main drive
  4. Select the desired snapshot and click on restore 
  5. If needed, you can also restore the bootloader (GRUB2 Only)

    • Related Articles

    • How to Partition, Format, and Mount Secondary Drives in Linux - Manual Drive Configuration (MDC)

      Introduction This guide provides detailed instructions on how to manually configure secondary drives in a Linux system, including partitioning, formatting, and mounting the drives. Warning Performing these steps on an existing primary drive or a ...
    • Installing NVIDIA Drivers on Ubuntu

      Ubuntu doesn't come with NVIDIA drivers installed by default as they are proprietary and closed-source. This means that you'll have issues like poor performance, displays not working, artifacts etc... while using the FOSS nouveau drivers. Graphical ...
    • Setup FTP access to rocky linux 9.5 server using vsftpd

      Install vsftpd sudo dnf install vsftpd -y Enable and Start the vsftpd Service sudo systemctl enable vsftpd --now Verify the status: sudo systemctl status vsftpd Adjust Firewall Rules By default, the Rocky Linux firewall blocks FTP traffic. Allow it: ...
    • Permanent Mount Devices/File System in Linux

      How to mount Devices/File System in Linux This guide only covers NTFS partitions, for other file systems you will need to change the commands or types as needed. Mounting makes file systems, files, directories, devices, and special files available ...
    • Linux Software RAID Failure Alert - Troubleshooting Guide

      Purpose This document provides a standardized approach for handling and troubleshooting the Linux Software RAID Failure alert, enabling L1 and L2 engineers to respond quickly, minimize risk, and maintain system stability. Alert Name Linux Software ...