Backup and Restore Ubuntu / Debian / Linux Mint using Timeshift

0
15

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.

Install Timeshift on Ubuntu / Debian / Linux Mint

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 the official OS repositories.

sudo apt update
sudo apt install -y timeshift

Create System Snapshots 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
sdb      8:16   0    10G  0 disk 

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

$ sudo parted /dev/sdX  mklabel gpt
$ sudo parted /dev/sdX  mkpart primary 0% 100%
$ sudo mkfs.ext4  /dev/sdX1 
 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.

install timeshift backup ubuntu debian mint 01

Provide sudo password when prompted.

install timeshift backup ubuntu debian mint 02

Select Snapshot type.

install timeshift backup ubuntu debian mint 03

Select location where snapshots should be saved.

install timeshift backup ubuntu debian mint 04

Select Snapshot Levels

install timeshift backup ubuntu debian mint 05

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.

install timeshift backup ubuntu debian mint 07

Restoring System 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.

install timeshift backup ubuntu debian mint 08

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

install timeshift backup ubuntu debian mint 09

Timeshift will Perform Dry run before doing the actual restore.

install timeshift backup ubuntu debian mint 10

Confirm Actions to initiate Snapshot restore process.

install timeshift backup ubuntu debian mint 11

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

install timeshift backup ubuntu debian mint 12

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: