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 ...
    • What is Boot Process in Linux OS.

      Boot Process in Linux OS. Have you ever wondered what happens behind the scenes from the time you press the power button until the Linux login prompt appears? Press the power button on your system, and after few moments you see the Linux login ...
    • Set up RAID 0 using mdadm

      Steps to configure RAID 0 in Centos7. Code lsblk yum install -y mdadm mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sdb /dev/sdc mkfs.ext4 /dev/md0 mkdir /mnt/raid0-drive mount /dev/md0 /mnt/raid0-drive df -h Code Summary LSBLK: - ...
    • Troubleshooting Memory/GPU Not Detected - No Error Codes or Warnings

      Memory or GPU errors without error codes occur when the CPU is not properly installed, pins are damaged, or thermal grease pollutes the CPU socket pin. Applying thermal grease to CPUs Many coolers these days, particularly all-in-one (AIO) liquid ...