Timeshift

I have been using Linux Mint for quite a while now, and Linux Mint has had Timeshift since Mint 19, which is about two years by now. But I haven’t noticed it until recently, and it is actually pretty nifty.

An example: I was consolidating services on my network, and as VLANs were involved, it meant reconfiguring the network of one server. And at one point, I had tried so many ways of doing that, that I really wanted to see exactly how my setup was shortly before I started messing around. Timeshift to the rescue!

My server runs with Linux Mint and thus is based on Ubuntu and thus uses netplan (and VLANs and netplan is worthly a post on its own!). So it was as easy as:

diff /etc/netplan/1-network-manager-all.yaml /media/media/timeshift/snapshots-daily/2020-07-17_20-00-01/localhost/etc/netplan/1-network-manager-all.yaml

(you’re not afraid of long commandlines, are you?)

So let’s talk about Timeshift. Timeshift is made for scenarios exactly like this; when you are tinkering with the setup of your systems and really wish you could go back in time to a point, where it still worked. It can restore all files to that point, or you can look at individual files just as I did.

This is also why Timeshift by design and by default excludes your home folder. If you want to restore your system to the way it was like, say, a month ago, you would very likely not want any of your files in your home folder to revert back too when doing so.

It’s is also not version control. If I wanted to see the entire history of changes, I would need another tool.

And it is also not really a backup. To save space, Timeshift links files that are unchanged between shapshots, which is pretty nifty. It is like having a copy in each snapshot, but you really only have one file, and you can delete a snapshot without affecting any of the others – the file stays until you delete the last reference. But this also means that if a files fails on the backup for some reason, it fails in all instances.

What Timeshift does, and does well, is to allow you to revert your system to a known good previous state.

One last word about Timeshift:

It will back up to a folder in the root of a filesystem called /timeshift, and by default the root filesystem. I usually configure my systems with a fairly small root filesystem and then mount in the space-consuming parts as separate filesystems. It is much more manageable that way (see my previous post about upgrading Mint for an example).

This also means, that I really do not want Timeshift to be in the root filesystem, and for my personal system the filesystem mounted as /home would be ideal. But I use an encrypted home folder, and how will that work out?

Turns out it works just fine. Without going into too much details, it is the individual home folders of each user that are encrypted and not the entire filesystem. So pointing Timeshift at the filesystem mounted as /home will make it place its snapshots unencrypted alongside the files holding the encrypted home folders (and then it will be accessible as /home/timeshift).