One of the most useful tools to avoid problems that we can find in Windows are restore points. With them we can create “copies” of the system in the current state so that, if something goes wrong, we can recover the system as it was at the time of the point. In macOS we have a similar tool, Time Machine, which is responsible for creating complete copies of the system and our data to restore them if something goes wrong. But what can we do if we use Linux? The answer is very simple: install TimeShift .
TimeShift is a free tool for Linux operating systems designed to allow us to easily make all kinds of backups. Thanks to it, we will be able to protect our entire system through incremental backups so that, if we have a problem, we can return to the previous state very easily, in seconds.
This program is more inspired by Windows Restore Points than by macOS Time Machine. This is because it only makes a copy of system files, not personal ones. Our photos, documents and other files that are not part of Linux will not be copied. The system is only backed up to help us troubleshoot without having to reinstall the entire OS. Unless, of course, we change this. But we must make sure that we always have enough space to store everything.
When to backup in Linux
The ideal is to configure and make periodic backup copies of our system. We never know when anything is going to fail and our distro will be rendered useless. If we have a more or less recent copy we can restore with the least possible impact on the system. In case the copy is old too, but we may have lost updates and packages and have problems, for example, with a program.
If we do not want to make automatic backup copies of the PC, then at least we must do them before making certain configurations or certain changes in the system. For example, before installing a program that has too many dependencies and that may cause compatibility problems with others, before installing Ubuntu updates and, above all, before installing a new version of the distribution.
How to create a restore point in Ubuntu with TimeShif
Before starting with the program, we are going to explain the two types of backup that TimeShift offers us:
- RSYNC : This is the standard backup type of the program. As its name suggests, it uses the rsync tool to do incremental backups. The first copy takes a long time, but the others are much faster. We can save these copies on an external hard drive, or any other drive, as long as it has a Linux-compatible file system.
- BTRFS : only available if we have Linux installed on a BTFS partition. It takes advantage of the functions of the file system itself (similar to NTFS versioning) to save a bit-by-bit copy of files. The first backup takes up nothing and is instantaneous. But the size increases as the system files are modified. Being bit by bit copies it is possible to restore any file to any of the states it has been in.
What option do I have to choose? Most likely the first, RSYNC. Of course, although this option gives us more freedom to make backup copies, we must bear in mind that it does not work on drives with a Windows file system (such as FAT or NTFS), nor on network drives.
Install TimeShift to backup Linux
Some distributions, such as Linux Mint, have this tool installed as standard so that we do not have to install anything else. If not, then we will have to install it ourselves. As it is a common program, it is usually included in the main Linux repositories, so to install it we will simply have to execute the following command:
sudo apt install timeshift
When the process is finished, we will have this software installed and ready to start making our system backups.
Configure a restore point in Linux
When we open the program, the first thing we will see will be a wizard that will guide us through the backup creation process. The first step that we will have to take is to choose if we want the backup to be done through RSYNC or through BTRFS. As we have said, unless we use the second file system, the most common is that we have to choose RSYNC .
We continue with the wizard and Ubuntu will calculate the space that our backup will occupy and the free space on the hard drives. With a clean system we will need at least 8.5 GB of free disk space, or else we will not be able to continue (since it would give an error).
After choosing the backup destination drive, the next thing to do is to schedule automatic backups. If we use BTRFS we can configure the copy levels we want. Since our copy is RSYNC, then we will have to manually configure scheduled snapshots.
The next step of the wizard is important. What it will allow us is to choose the additional directories that we want to include in the copy. By default, TimeShift is set to ignore the root and home folders. But, if we want to make backup copies of these folders as well, we can do it by marking that we want to do so.
And with this, we are done setting up our backup. We can see a series of tips to make and restore our backups. Click on ” Finish ” and that’s it. Of course, before closing the program we cannot forget to create our first backup. We can do this by clicking on the « Create » button and waiting for the process to finish.
View and Restore Ubuntu Backups with TimeShift
If something starts to go wrong, for whatever reason, it is time to restore the system to a previous state. To do this, what we must do is open TimeShift and, instead of the wizard, we can see a list with all the Linux restore points that have been created.
In the program interface we can also see the backup mode that we are using and the space available on the hard disk to create the copies.
To restore the system to a previous state, what we must do is select that state and click on the “Restore” button . We can see a wizard that will ask us where we want to restore the copy of each of the mount points. We can choose where to restore the root, the boot loaders and the home of our Linux.
By default the original units will be selected. If we want, we can modify any of these points (if we know what we really do), and, if not, we will leave it by default. Next, the program will analyze the backup copy and compare it with the current state of our PC.
We will be able to see all the files that are going to be restored from the copy, and which ones are going to be eliminated from our PC (because, for example, they did not exist at the time of the backup).
If everything is correct, we will see a last summary window.
We check it and, if we agree with the changes to be made, we begin the restoration process.
Depending on the number of files that have been modified and need to be restored, this copy will take more or less time. While this window is there we will not be able to do anything. When the restore process is complete, the PC will restart automatically . And it will boot in the same, identical state as when we did the backup.