How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24

11

Timeshift is a backup and system restoration utility for Linux operating systems similar to the System Restore feature in Windows operating system. This tool protects the system by taking incremental snapshots of a filesystem at regular intervals.

It uses RSYNC and BTRFS mode for taking the snapshots. These snapshots can be restored at a later point of time to revert the changes made to the system or to recover the unbootable operating system.

Timeshift is designed to protect only system files and settings, not user documents. However, you can enable the backup of the user documents if needed.

Install Timeshift

Timeshift packages are available in Launchpad PPA for
Ubuntu &
Linux Mint.

Set up the PPA with the below command.

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

Update the repository index.

sudo apt update

Install Timeshift with the below command.

sudo apt install -y timeshift

Take System Backup with Timeshift

Open the Timeshift from the respective graphical interface.

Ubuntu: Activities » Search for Timeshift.

Linux Mint: Menu » Administration » Timeshift.

Enter your password if you get an authentication window.

Follow the backup wizard to configure Timeshift.

Snapshot Type

Select the Snapshot Type based on your system. RSYNC supports all the file system types and BTRFS supports only the backup of BTRFS filesystems.

In RCYNC mode, snapshots are taken by copying files using rsync and hard-linking unchanged files from the previous snapshots to save disk space. Each snapshot is a full system backup. Snapshots can be saved any disk formatted with a Linux file system. Saving snapshots on non-root disk or on the external disk which allows the system to be restored even if the operating system is not booting.

In BTRFS mode, snapshots are taken using the built-in features of the BTRFS file system. Snapshots are created and restored instantly without burdening the system. Snapshots are stored in on the same disk from which they are created (system disk). If the system disk fails then your snapshots will be lost.

Choose RSYNC and click Next.

Snapshot Type

Backup Location

Timeshift supports storing snapshots only on Linux file systems. Windows file systems, remote and network storages are not supported.

Snapshots are stored in /timeshift of the selected partition. If /backup partition is selected for storing the snapshots then snapshots will be in /backup/timeshift.

During the initial setup, Timeshift will calculate the required space for storing snapshots and may show you a warning if the selected partition is short of the required space.

Choosing external storage for storing snapshots would be recommended as you can able to restore your system in case of system disk corruption or the system is not bootable.

Here, I am using a USB stick for storing snapshots.

USB Drive How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830381 531 How To Backup and Restore Ubuntu Linux Mint With
USB Drive

NOTE: You need to format the USB stick with ext4 or other Linux file system type.

sudo umount /dev/sdb1

sudo mkfs.ext4 -f /dev/sdb1

Choose the partition and click Next.

Snapshot Location How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830381 213 How To Backup and Restore Ubuntu Linux Mint With
Snapshot Location

Scheduled Snapshots

You can schedule automated snapshots at a standard interval – Hourly, Daily, Weekly, Monthly, or at the system boot with a delay of 10 mins.

You can choose to retain a number of snapshots for a selected schedule.

Schedule Snapshots How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830381 673 How To Backup and Restore Ubuntu Linux Mint With
Schedule Snapshots

Include Home Directories

Timeshift is designed to protect only system files and settings, not user documents. However, you can enable the backup of /home directory (disabled by default) if needed.

If the home directories included in system backup, the data will be overwritten when you restore the snapshot.

Home Directories How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830382 359 How To Backup and Restore Ubuntu Linux Mint With
Home Directories

Click Finish.

Take First Backup

Click the Create button to start your first system snapshot.

Timeshift Window How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830382 664 How To Backup and Restore Ubuntu Linux Mint With
Timeshift Window

The snapshot creation would take time and it depends on the size of system data.

Snapshot In Progress How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830382 790 How To Backup and Restore Ubuntu Linux Mint With
Snapshot In Progress

Once the snapshot is taken, you would see it in the snapshot list.

Snapshots How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830382 672 How To Backup and Restore Ubuntu Linux Mint With
Snapshots

Restore System With Timeshift

Running System

For testing the system restoration, I am deleting the /var/log directory and will restore the directory with the Timeshift.

Delete Directory How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830382 473 How To Backup and Restore Ubuntu Linux Mint With
Delete Directory

Snapshots can be restored by selecting a snapshot from the main window and clicking the Restore button on the toolbar.

Save your work and close any open applications before you begin restoring the system from snapshot as Timeshift will reboot the system during the restoration.

Restore Snapshot How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830382 563 How To Backup and Restore Ubuntu Linux Mint With
Restore Snapshot
  • Click Next on Select Target Device
  • Review the Files that will be restored
  • Click Next on the Warning page

System restore is in progress and the system will be rebooted automatically.

System Restore In Progress How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830382 948 How To Backup and Restore Ubuntu Linux Mint With
System Restore In Progress

Upon system reboot, validate if the /var/log directory has been restored.

Validate Restoration How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830382 249 How To Backup and Restore Ubuntu Linux Mint With
Validate Restoration

Non-Bootable System

For testing the system restoration, I am deleting the / to make the system non-bootable and will restore the directory with the Timeshift.

Try this on your own RISK as deleting root filesystem make system non-bootable.

You would get a screen similar to below when you delete / directory.

System After Deletion Of Root How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830382 742 How To Backup and Restore Ubuntu Linux Mint With
System After Deletion Of Root

Boot your system with Ubuntu/Linux Mint live cd and install the Timeshift.

### Ubuntu 20.04 ###

sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ focal universe"

sudo apt install -y timeshift

### Other Ubuntu Versions & Ubuntu Derivatives ###

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

sudo apt update

sudo apt install -y timeshift

Linux Mint live cd already has Timeshift installed. If Linux Mint live cd doesn’t have Timeshift installed, follow the above Ubuntu derivatives steps to install Timeshift.

Open the Timeshift and choose RSYNC and then click Next.

Select the partition where the snapshots are stored and then click Next.

Select Snapshot Partition How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830383 906 How To Backup and Restore Ubuntu Linux Mint With
Select Snapshot Partition

Now, Timeshift will list the available snapshots to restore.

Available Snapshots How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830383 737 How To Backup and Restore Ubuntu Linux Mint With
Available Snapshots

Select the snapshot you want to restore and then click Restore.

Restore Snapshot How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830383 486 How To Backup and Restore Ubuntu Linux Mint With
Restore Snapshot
  • Review the Files that will be restored
  • Click Next on the Warning page

System restore is in progress.

Restoring Snapshot How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830383 165 How To Backup and Restore Ubuntu Linux Mint With
Restoring Snapshot

Upon completion of the system restore, reboot your system.

Restore Completed How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830383 989 How To Backup and Restore Ubuntu Linux Mint With
Restore Completed

Your system should boot fine like earlier.

System After Restore How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 How To Backup and Restore Ubuntu & Linux Mint With Timeshift | Holhol24 1605830383 115 How To Backup and Restore Ubuntu Linux Mint With
System After Restore

Conclusion

That’s All. I hope you have learned how to backup and restore the
Ubuntu &
Linux Mint systems with Timeshift. Please share your feedback in the comments section.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More