in

The easiest way to protect your Linux PC from disaster – no backup needed

Elyse Betters Picaro / ZDNET

Follow ZDNET: Add us as a preferred source on Google.


ZDNET key takeaways

  • Snapshots are a crucial part of keeping your system running.
  • You’ll want to install the free Timeshift app on your distribution.
  • Make sure to save your snapshots to an external drive.

When you want to ensure you always have a running Linux system, snapshots are a necessity. Snapshots are a saved “moment in time” state of your system that is created (either manually or automatically) and can be used to roll back a system.

The difference between snapshots and backups

This is an important distinction you must know about. First off, a snapshot is a point-in-time copy of data that captures a system’s current state, whereas a backup is a complete duplicate of specific data that is stored separately for recovery. As far as the purpose of each, a snapshot is for quick recovery, testing, and virtual environments, whereas a backup is for long-term data protection and disaster recovery.

Also: The most versatile Linux distributions you can install right now – and I’ve tried them all

For the most reliable recovery system, it is important that you have both snapshots and backups, each of which is handled differently.

We’re going to talk about snapshots on Linux.

Also: 8 things you can do with Linux that you can’t do with MacOS or Windows

Before we do, there’s one very important thing you need to know. There are two primary paths for creating snapshots in Linux: Btrfs and rsync. When using a Linux distribution with Btrfs (such as openSUSE), snapshots take up considerably less space and are much faster. If your distribution doesn’t use the Btrfs file system, you’ll be limited to the slower, more space-consuming rsync. 

Either way you go, you’ll still wind up with snapshots that can be used to roll back the system.

How to install Timeshift

What you’ll need: The only things you’ll need are a Linux distribution and a user with sudo privileges. 

Also: The only antivirus I trust on Linux – and it’s free to use

Again, your best bet is a Linux distro that uses the Btrfs file system. You’ll also want an external drive to which you will save your snapshots. If you save them to the local file system, you’ll have trouble accessing them should things go wrong. Because I’m demonstrating this on a virtual machine, I will go ahead and save the snapshot to the local drive, so make sure not to do that.

Instead of installing Timeshift via the command line, let’s install it via your distribution’s app store. For example, on openSUSE (with the KDE Plasma desktop), open Discover and then search for Timeshift.

Show more

<!–> KDE Discover.

Installing Timeshift on openSUSE.

Jack Wallen/ZDNET

–>

Once you see the Timeshift entry, click Install. You’ll be prompted for your user password. Once you successfully authenticate, the app will install.

Show more

Setting up your snapshot

It’s now time to set up your snapshot. Before you do, make sure you plug in your external drive. With that taken care of, it’s time to configure.

Also: I’m a command-line pro, and this is the best terminal app I’ve ever used, thanks to AI

1. Open Timeshift

Open your desktop menu and search for Timeshift. When you find the app icon, click on it to launch the tool.

2. Select your type

In the first window of the Timeshift setup wizard, you’ll be asked to either select Btrfs or rsync. If your distribution uses Btrfs, select it; otherwise, select rsync. If your distribution doesn’t run on the Btrfs file system, Btrfs will be grayed out. Click Next to continue.

<!–> Timeshift app.

If your system doesn’t use Btrfs, it will be grayed out.

Jack Wallen/ZDNET

3. Select the snapshot destination

In the next window, select the drive that will house your snapshots, and click Next.

–>

Make sure to select an external drive to house your snapshots.

Jack Wallen/ZDNET

4. Select your snapshot levels

In the resulting window, you can configure how often you want the snapshots to be taken and how many of them you want to save. I highly recommend you save at least five. If you only save one and things go wrong after a snapshot is taken, you won’t be able to roll back to a working state.

<!–> The Timeshift app.

Make sure to configure the snapshot levels wisely.

Jack Wallen/ZDNET

You can select multiple snapshot levels. For instance, you could run a daily snapshot and save five levels, and then add a monthly snapshot and only keep two.

Also: Want to save your aging computer? Try these 5 Linux distributions

Once you’ve taken care of this, click Next.

5. Do not include home directories

My advice to you is not to include your home directories in the snapshot. Instead, you should do a backup of those directories. Leave the “Include @home subvolume in backups” option unchecked, and click Next.

–>

You should back up your home directories instead of taking a snapshot of them.

Jack Wallen/ZDNET

You can then click Finish, and you’re done. Timeshift will start automatically saving your snapshots.

How to use your snapshots

To roll back a system to a working state, you have to do the following:

  1. Download the ISO for the distribution you are using.
  2. Burn the ISO to a USB drive.
  3. Shut down your computer.
  4. Insert the USB drive.
  5. Start the computer.
  6. When the live instance opens, install Timeshift.
  7. Open Timeshift.
  8. Click Restore.
  9. Select the snapshot you want to use.
  10. Restore.

Also: Déjà Dup is as simple a backup tool as you’ll find on Linux

And there you go — you have a snapshot system set up. Just remember to also set up a backup of your home directory (and whatever other directory houses critical data).

Get the morning’s top stories in your inbox each day with our Tech Today newsletter.

–>


Source: Information Technologies - zdnet.com