(Last Updated On: January 30, 2019)

Questions: How can I backup and restore Ubuntu?, How to backup and restore Debian?, How to backup and restore Linux Mint using Timeshift?. Are you looking for a way to create system snapshots on Ubuntu, Debian, and Linux Mint Linux distribution?. Snapshots allow you to restore your entire operating system to a point in time state. This comes in handy whene you experience system failure or sluggish behavior.

In this blog post, I’ll show you how you can easily create system snapshots on Ubuntu, Linux Mint and Debian Linux system using Timeshift.

What is Timeshift?

Timeshift is an open source tool for creating filesystem snapshots using rsync+hardlinks or BTRFS snapshots. It has support for scheduled snapshots, multiple backup levels, and exclude filters. Once you have a snapshot taken, it can be restored while the system is in a running state or from Live CD/USB.

How to Install Timeshift on Ubuntu / Debian

Now that you have some basics about Timeshift, let’s change gear to the installation bit. We’re going to install Timeshift on Ubuntu / Debian from a PPA repository.

Add the repository to your system by running the command below in your terminal.

sudo apt-add-repository -y ppa:teejee2008/ppa

After adding the repo, update your system and install

sudo apt-get update
sudo apt-get install -y timeshift

Create System Snapshots on Ubuntu and Debian using Timeshift

You’ll need to save your snapshots in a separate partition. So before I can start Timeshift application, I’ll configure disk and partition used for saving Snapshots. I have a secondary disk /dev/sdb on my machine.

# lsblk  | grep sdb
sdb      8:16   0    10G  0 disk 

I’ll create a partition table and filesystem on this block device.

$ sudo parted /dev/sdb  mklabel gpt
$ sudo parted /dev/sdb mkpart primary 0% 100%
$ sudo mkfs.ext4 /dev/sdb1
mke2fs 1.44.1 (24-Mar-2018)
Creating filesystem with 2620928 4k blocks and 655360 inodes
Filesystem UUID: 56a691be-3476-4bab-be9f-13fcdf5458bb
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

Once done, Launch Timeshift from terminal or Applications search menu.

Provide sudo password when prompted.

Select Snapshot type.

Select location where snapshots should be saved.

Select Snapshot Levels

You can choose to use your desired backup options that you see fit for your use case.

eate the first Snapshot manually by clicking on the “Create” button at the top menu.

How to Restore Ubuntu, Debian & Linux Mint from Snapshot using Timeshift

To revert your system to Snapshot state, select the Snapshot you want to restore to and click the “Restore” tab on the top menu.

This will ask you to “Select target device” and options for /boot and /home.

Timeshift will Perform Dry run before doing the actual restore.

Confirm Actions to initiate Snapshot restore process.

Timeshift will start to sync Snapshot files to the root filesystem.

The system should reboot after the process is completed.

Wrapping up

Timeshift brings the System Restore feature in Windows or the Time Machine tool in macOS to Linux. It is the existence of such tools that propel Linux adoption in Desktop world to the next level. Follow us and subscribe to our newsletter to receive latest updates.

Other Backup guides:

Backup MySQL databases to Amazon S3

How to Backup and Restore RabbitMQ Data & Configurations

How to Install Nakivo VMware Backup & Replication tool on Linux