The purpose of this tutorial is to show how to install Timeshift on Ubuntu 22.04 Jammy Jellyfish and use the program to perform a backup of the system, and subsequently restore the system from that backup.
Most Linux users love to customize their Linux system to their liking. If your system becomes unusable, all of this work put into customizing your system will be lost, because you have to reinstall Ubuntu and start over.
Timeshift is an application that will backup your system settings and files. It does NOT backup personal files. Taking a snapshot with Timeshift will allow you to browse that snapshot any time, like you would a normal directory of files. If your system gets corrupted or goes through some undesirable change, it is easy to restore your system as it was by using Timeshift.
Let’s see how to install Timeshift on Ubuntu 22.04 Jammy Jellyfish and make a backup of our system files.
In this tutorial you will learn:
- How to install Timeshift on Ubuntu 22.04
- How to use Timeshift to create a backup snapshot
- How to restore a Timeshift snapshot backup
- How to use Timeshift from the command line
|Category||Requirements, Conventions or Software Version Used|
|System||Ubuntu 22.04 Jammy Jellyfish|
|Other||Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
Ubuntu 22.04 System Backup and Restore step by step instructions
Using the following steps we will first create system backup of the Ubuntu 22.04 system using the Timeshift graphical user interface. Later we will restore from the previously created system backup snapshot. Let’s get started.
$ sudo apt update $ sudo apt install timeshift
Create Backup by using the Timeshift GUI
Create system backup
- Open the
timeshiftapplication via top left
Activitiesmenu. Upon opening the
timeshiftapplication you will be greeted with a wizard to help you schedule your backups. Here you have two options. First is to use the
rsyncprotocol as a main backup tool or take an advantage of an inherent BRTFS built-in file system features. In this example we will use
RSYNCand hit the
The rsync method will use hard links to make sure that repeat files from multiple backups do not take up extra space. So do not worry about each backup taking up a lot of space. The first backup will be by far the biggest one.
- Select backup destination.
timeshiftwill search your system for available file system partitions and provide you with an option on where to create backup file.
- Select how often you wish to perform the system backup and how many backup snapshots you wish to retrain before the first backup is overwritten.
- As the screenshot indicates the home directories are excluded by default. Depending on your work environment select whether you wish to include home directories into the backup.
- This will conclude your initial backup schedule setup. Hit the
- The backup has not been created yet. You can either wait until the
timeshiftautomatically triggers the backup or simply hit the
Createbutton to perform the previously predefined backup now.
- Wait for the backup to complete. This could take a few minutes.
- If all went well you should now see your first backup snapshot listed.
Restore from backup
At this point we will restore the system from the previously created system backup snapshot. Select a backup snapshot from which you wish to restore and click on the
- Timeshift give you an option on how to restore from your backup. Unless you know what you are doing simply hit the
Nextbutton to go with the default.
- The Timeshit application will provide you with a list of changes it will take to restore from the backup just to make sure no data is lost in the process.
- Once you hit the
Nextbutton the system will be restored and restarted. All done.
Create and restore backup by using the Timeshift’s command line
- Create a first backup simply by executing the below command:
$ sudo timeshift --create
The above command will also create a new configuration file located at the following location:
The output will look something like this:
First run mode (config file not found) Selected default snapshot type: RSYNC Mounted /dev/sda2 at /media/root/359151f5-efb9-483d-a738-894d57e2d8c8. Selected default snapshot device: /dev/sda2 ------------------------------------------------------------------------------ Estimating system size... Creating new snapshot...(RSYNC) Saving to device: /dev/sda2, mounted at path: /media/root/359151f5-efb9-483d-a738-894d57e2d8c8 Synching files with rsync... Created control file: /media/root/359151f5-efb9-483d-a738-894d57e2d8c8/timeshift/snapshots/2020-02-19_18-32-36/info.json RSYNC Snapshot saved successfully (39s) Tagged snapshot '2022-02-23_18-32-36': ondemand
- List all your currently created system backup screenshots:
$ sudo timeshift --list
Device : /dev/sda2 UUID : 359151f5-efb9-483d-a738-894d57e2d8c8 Path : /media/root/359151f5-efb9-483d-a738-894d57e2d8c8 Mode : RSYNC Device is OK 1 snapshots, 197.7 GB free Num Name Tags Description ------------------------------------------------------------------------------ 0 > 2022-02-23_18-32-36 O
- Restore from the backup snapshot:
$ sudo timeshift --restore --snapshot "2022-02-23_18-32-36"
- Delete selected backup snapshot:
$ sudo timeshift --delete --snapshot '2022-02-23_18-32-36'
In this tutorial, we learned how to install the Timeshift application on Ubuntu 22.04 Jammy Jellyfish Linux and use the program to create a backup snapshot of our system files. We then saw how to restore the snapshot that we created. Timeshift is a great way to save the countless customization that you make to your Ubuntu 22.04 system in order to get it exactly the way you want. It provides peace of mind knowing that you can restore a previous snapshot any time that something goes awry.