How to backup and restore Ubuntu with TimeShift

Timeshift is a free-to-use tool that lets you take backup system settings and files. By protecting these important files, you can always restore them if something goes wrong. However, the tool is not there to protect your files, including pictures, music, and documents.

That’s one of the basic rules of using any operating system or internet in general. If you are using any modern devices, the chances are that they can break or become unusable. Linux is no different.

There can be an instance where you installed a package that made your Linux installation go haywire. In short, things can go wrong, and so you should always do backups.

Like Windows, Ubuntu also comes equipped with a backup feature called TimeShift. Its working is similar to that of System Restore in Windows or TimeMachine on macOS.

Timeshift is a free-to-use tool that lets you take backup system settings and files. By protecting these critical files, you can always restore them if something goes wrong. However, the tool is not there to protect your files, including pictures, music, and documents.

Installing Timeshift

The first step that we are going to take is to install Timeshift. Installing it is very easy. All you need to do is download it through the Debian and Ubuntu repositories.

To add the repository, type the command in the terminal.

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

adding-repository
Adding repository

Next, run the apt update to update the system packages.

sudo apt update

Once everything is done, it is now time to install Timeshift.

sudo apt install timeshift

installing-timeshift
Installing Timeshift

Learning about Timeshift

Timeshift offers two modes when it comes to creating incremental filesystem snapshots — rysnc+hardlinks and BTRFS snapshots.

The main difference between the two backup modes is how they create and store the backup. For instance, BTRFS Mode, it utilizes the inbuilt features of the BTRFS filesystem. If BTRFS mode is used, then the created snapshots should only be supported on systems with the Ubuntu-type subvolume layout.

The RSYNC mode creates backups with the help of hard-links and rysnc. In this case, each of the snapshots is full backups. These backups can easily be browsed using file managers as well. Also, if you create multiple RSYNC mode, then the backups save disk space by skipping the same files.

When you open Timeshift, you should be asked to select the snapshot type. There is also a help section where the setup wizard tells you about each snapshot type.

opening-timeshift-for-first-time
Opening Timeshift for the first time — setup wizard

It then asks you to select the snapshot location. You can also cancel the wizard and do all of these things later.

Creating a backup

To create a backup, you need to click on create, as shown below.

create-timeshift
Creating a snapshot using Timeshift

Next, it asks you about the snapshot levels. These levels are used to determine how often the system should take snapshots.

slecting-snapshot-levels
Selecting-snapshot-levels

Now click on Finish to start the process. Once done, it should begin to create a snapshot. And, it should get listed under the snapshot window.

Restoring a snapshot

Restoring a snapshot is as simple as creating it. To get started, you need to select the snapshot from the list of snapshots and then click “restore.”

Once done, the restore snapshot window should open where it should ask you where you want the files to be restored. Once the location is set, click on next to start the dry run. In the dry run, Timeshift compares data with rysnc and verifies the files and directory.

Next, it should ask you to confirm the actions. Finally, it shows the disclaimer, and as soon as you click the “next” button, the restoration process should start.

It should take some time for it to get completed. Please be patient.

Conclusion

It is imperative to back up your files often. By using Timeshift, you get the peace of mind that you have the restore option when the disaster strikes on your Linux system. Using TimeShift is an easy way to create snapshots and restore them when needed.

Divya Kiran Kumar
I'm Editor of FOSS Linux. I worked as a Software Engineer, before taking up blogging as my full-time job. I enjoy using Linux, and can't imagine anything else for my PC. Apart from writing for FOSS Linux, I enjoy reading non-fictional books. Sapiens was my favorite last read. Hope you enjoy reading and using this blog to enhance your Linux experience! Have a great day ahead!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

23,874FansLike
265FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

How to create a GParted live USB drive in Ubuntu, Linux Mint

GParted Live USB Flash Drive
GParted Partition Editor is one of the best programs to create, resize, and manage hard disk partitions. The greatness of free and opensource program is it can be used to work on Linux, Windows, or Mac OS X.
Linux file system type
Any Operating system in the market whether its Windows, Linux, Unix, macOS, and any other, must be able to access and manage files and data on storage devices.
best laptops for linux
Apart from your programming skills, there are a few other things that can also influence the way you code, and one of them is your computer system for sure. Even though it isn't like you can't code on a regular PC or laptop, speaking from personal experience, you can make the most out of your programming skillset by going for a computer with high specs and one that's been specially designed for such tasks.