Creating System Restore Points on Linux with Timeshift and Why It's Essential

Creating System Restore Points on Linux with Timeshift and Why It's Essential

Have you ever faced an issue with your operating system that you accidentally caused yourself? Perhaps you tweaked a setting or altered a configuration file in /etc, leading to a series of problems with your services or applications.

In such instances, you might not even recall what changes you made that resulted in the issue. But what if you could effortlessly return your Linux distribution to its previous functional state?

This is where Timeshift comes in. Timeshift is an application designed to create restore points, enabling you to revert your system to a working state. It's crucial to understand that Timeshift is not a backup tool but rather a solution to recover from self-induced errors.

How to Install Timeshift

Requirements: The prerequisites for installing Timeshift are a functioning Linux system and user access with sudo privileges.

1. Open a Terminal Window

To get started, log into your Linux desktop and open a terminal window.

2. Install Timeshift

Thankfully, Timeshift is accessible from most standard repositories. For Arch Linux, it can be found in the AUR (Arch User Repository). The installation commands vary based on the distribution:

  • For Ubuntu-based distributions - sudo apt-get install timeshift -y
  • For Fedora-based distributions - sudo dnf install timeshift -y
  • For Arch-based distributions - yay -S timeshift

With Timeshift installed, let's explore its functionality.

How to Use Timeshift

The process of using Timeshift can vary depending on whether your system employs the btrfs file system. For illustration, we'll use the rsync method as it applies to several distributions, including Pop!_OS.

1. Open Timeshift

Launch Timeshift from your desktop menu, where you'll be asked to enter your sudo password. Upon opening, choose between Rsync or Btrfs. Here, select Rsync and click Next.

2. Select a Destination for the Snapshot

Timeshift will gauge your system's size before allowing you to choose a location for your snapshot. It's advisable to save this to an external drive rather than the drive that holds your operating system.

3. Configure Your Snapshot Level and Retention

Next, determine how frequently snapshots should be taken (e.g., boot, hourly, daily, weekly, monthly) and the number of snapshots to retain. Proceed by clicking Next.

4. Choose a User Home Directory (Optional)

By default, user directories are not included in snapshots. If you have many app and bash configurations, you might include your home directory, selecting only Hidden files, otherwise, stick with the defaults and click Finish to complete the setup.

Upon clicking Finish, you will see the Timeshift main window indicating no snapshots have been created yet. You can either wait for automatic snapshots or manually create one by clicking Create.

In case of any system issues, open Timeshift, select a desired snapshot, and click Restore to revert your system to its last known working state.

For those who fear accidentally misconfiguring their Linux system, installing and utilizing Timeshift is highly encouraged to enable easy restoration to a functional state.

Read more