How To Backup And Restore Linux With Timeshift

 

Be it a beginner or an advanced coder, A Linux user will, at some point find the need for a backup solution. All it takes is just one sudo command to go wrong and you’ll be sent back to the stone age. Linux shows you no mercy when you don’t have a solid a backup.

 

There are lots of impressive backup software available for Linux. Almost all distros come with an easy to use backup tool too. They back up and keep your docs, music and other important stuff safe.

But, it’s reinstalling all the software, drivers and configuring the system that turns out to be a nightmare. Although there are software like Aptik which do backup all your installed packages, They still don’t just cut it.

Easily backup and restore Linux desktop with Timeshift

Well, when you are trying to get Nvidia drivers to work on your Linux installation or getting that new Gnome to work on your system, there is a good chance that your system won’t log into a graphical environment at all depending on your distro and the instructions you followed.

Maybe you skipped a step and you realized it a little too late. In any case, your next action would be to scavenge the web for repair instructions which can be real frustrating. Maybe you are just having some regression in the system after you installed something and want it to run smoothly like before.

Bought a new computer and want to shift your entire OS with all its settings and customizations to the new PC?

Timeshift is your answer.

What does Timeshift do?

See Timeshift doesn’t just backup your home folder. It just doesn’t backup your apps. It has the capability to capture your ENTIRE OS with all the contents in your home folder into a single snapshot. This snapshot also includes all the configurations and customizations you made to your system.

Installing Timeshift in Linux

For Ubuntu and Linux Mint

Open the terminal (ctrl+alt+T) and execute the below commands one by one

sudo apt-add-repository -y ppa:teejee2008/ppa
sudo apt-get update
sudo apt-get install timeshift

For Arch Linux, Antergos, Apricity and Manjaro

The latest version of Timeshift backup solution in available in the Arch User Repository. Enable AUR and get Timeshift with the following command.

yaourt timeshift

For all other distros

32 bit download here.
64 bit download here.
Download the appropriate file and open the terminal in the download location

Timeshift for 32-bit Linux

su

(type in your password when prompted)

chmod +x timeshift-latest-i386.run
sh ./timeshift-latest-i386.run

Timeshift for 64-bit Linux

su

(type in your password when prompted)

chmod +x timeshift-latest-amd64.run
sh ./timeshift-latest-amd64.run

How to use Timeshift to backup and restore a Linux system

Making a backup of your Linux system

Well, there’s no command line hassle here. Launch Timeshift from the menu. Put in your sudo password when asked. Click on create. Quickly watch this video while Timeshift does its thing. Done.

unnamed-file-742-7997900
You may choose to alter the parameters of backup such as backup location from the menu.

unnamed-file-743-6872006
You may even schedule daily or weekly backups. Automated backups so that if shit goes south, you got a recent rollback ready every time.

Restoring your Linux system

1. From the same OS.

When you can still log onto to your OS and want to go back to a previous state of your PC, just launch Timeshift from Menu or Dash and select a Restore Image and hit restore. That’s all.

unnamed-file-744-7982669

2. Restoring when you can’t log into your Linux system

This section is for systems which can’t log into a Graphical Environment, are completely formatted or damaged beyond repair.

You’ll need a Live USB. I very highly recommend you to always keep either a Ubuntu Live USB or an Ubuntu DVD with you as this can be a lifesaver. There is no excuse for not having this.

Anyway, boot into a live session and download and install Timeshift using the same above install instructions (yes, you can install applications in live sessions).

After installation, launch the application and browse to your backup location and select restore (yes, you can access your hard drive using a live session).

I recommend you let timeshift install the bootloader again.

Wrapping up

Can backup and restore Linux system get any easier? This program gives you the ability to tinker around, mess up, try new stuff without any fear or regret. This tool is invaluable for new Linux converts who might break stuff. But the thing about Linux users, they never stop tinkering. I mean never. So you still must get it even if you are an expert in handling the Penguin.

What is your view on the amazing Timeshift? How do you backup Linux system?

Also, do tell us situations where you messed up real bad and timeshift could have been or has been useful. Don’t forget to share. You might save a Linux life :D

Source