BACK UP LIKE CLOCKWORK!
Linux Format|October 2020
BACK UP LIKE CLOCKWORK!
Jonni Bidwell has a plan – several plans, in fact – to keep his ever-growing repository of data ticking over nicely.
Jonni Bidwell

There are two types of people in this world: those who back up their files and those who have never experienced data loss. In a world that’s becoming increasingly cloudy, backing up files might seem like an old-fashioned sort of a habit. Much like wearing a watch or writing cheques (…that your body can’t cash? – Ed).

If your Android phone dies (and you  opted in to connecting everything to your  Google Account) then you can restore  your contacts, messages and apps  effortlessly on a new device. If you work   in a corporate environment, then your IT  team can (with a little more work)  probably do a similar thing if your work  machine dies. You might lose a few hours’  work (depending on when and where you  last saved) or some tiny configuration  details, but starting from a base image  applications can be re-installed and your  user account connected in a matter of  minutes, not days. But if your home PC  fails, or even if you accidentally delete  some files, recovery can prove much   more complicated.

Unless, that is, you have a solid backup regime, which hopefully this feature  will inspire. Through automated,  incremental backups we’ll aim to make  backups less chore-like. We’ll cover  snapshots so that your OS can be  restored in a few clicks. We’ll look at using  multiple drives (RAID) to protect against  hardware failure, paving the way for ill-considered jokes about redundancy. We’ll  look at the excellent Duplicati tool, which  can integrate with cloud storage services  as well as a VPS, or indeed a real server,  under your control. If you prefer to do  things manually, then we’ll also look at the  command line program Duplicity, which  uses Rsync to send encrypted tar archives  to the clouds. And because we like choice  (and alliteration) we’ll look at making this  easy with the Déjà Dup frontend.

Pre-backup considerations

A quick look at the why, what and where of a strong back-up plan.

Over the second quarter of 2019, a survey by cloud storage firm Backblaze recorded a 1.8 per cent annualised failure rate over 108,461 hard drives in its service. So extrapolating wildly, we might say, in lay speak, that there’s a 1.8 per cent chance that an ‘average’ disk will fail within a year. Those are enterprise-class drives as well, so the odds are only going to be worse for consumer hardware.

A significant obstacle to having a watertight back-up regime is how disorganised we are with our files in the first place. One upside to the Gnome desktop abolishing the right to store files on the desktop is that it obviates the terrible habit of covering your lovely desktop wallpaper with so many icons and partial file names. It belongs to the same organisational scheme as putting everything on the floor so you known where everything is. If, on the other hand, you keep all your photos (including those from your phone) in one folder, important documents in another, large dataset that can’t be easily replaced on their own drive, and so on, then it’s much easier to put together an efficient backup strategy.

It’s also useful to segregate system and user file backups. In many cases, backing up your operating system is less important than your own data. You can reinstall Linux in five minutes, so it really depends how much manual configuration you’ve done.

Data stored on Dropbox, iCloud, Google Drive or Amazon S3 (or any other cloud storage service you’d care to name) is unlikely to just vanish in the way that data stored locally would if your hard drive goes kaput (as long as you keep paying your bills, of course). Yet these services suffer hard drive (or solid state, tape or Blu-ray) failures all the time. They have their own advanced back-up and replication methods to cope with this (as well as preemptively retiring old hardware). The actual disk you’re accessing could fail as you download a file, yet you might not even notice the delay as a backup volume is transparently spun up.

From an end-user point of view, these services offer an invincible hold for their data. Invincible that is, until someone hacks your account or until you accidently delete those files. Then, unless you had your own replication strategy, it’s game over, man.

YOUR $HOME AWAY FROM HOME

Off-site backups are an excellent idea,  since they mitigate not only against  hardware failure, but also against  combustion and burglarisation. A10drive raid array with triple redundancy  will be duly decommissioned by fire or  flood, or will be an attractive target for a  thief with a penchant for storage.  Unfortunately, the cost of cloud  storage (or renting/running your own  off-site storage) , as well as physical  bandwidth, means you probably don’t  want to store everything remotely. 

Putting a monthly cost on your data is  tricky. The likes of Google and Dropbox  have free storage tiers, but you may not  wish to support them. There are other  offerings: Box (https://box.com) gives  you 10GB for free (or unlimited for £12/ month), but finding a solution that will  integrate with your Linux desktop isn’t  straightforward. At the end of our  feature we’ll look at Duplicati, which can  connect to all kinds of offerings.

If you trust a hosting service, then you  can rent your own VPS (20GB offerings  are around $5/month and the likes of  Digital Ocean will even throw in daily  backups for an extra $1/month). This  way you get your very own Linux box in  the cloud, which you can do anything  (anything?–Ed) you like with. 

Just using it as a back-up target isn’t  the best value for money, but having a  VPS affords one many options. Since  this is data you probably want kept  private, we can use a solution like  Duplicity to encrypt everything before  sending it cloudward.

Fragile data

Data is precarious. We must protect it from all kinds of things, including fat fingers and cosmic rays.

We believe it’s useful to consider the scope of things we’d like our backups to enable us to recover from. Hardware failure is probably what comes to mind, but the scope of this is quite wide. An external hard drive is convenient for casual backups, but if it’s subject to being moved around a lot then this will expedite its demise. If you back up to an another drive inside your PC, and you also use that PC for high-octane gaming or crypto mining (does anyone still do this? – Ed), then all that heat might end up cooking both copies of your precious data. So if possible we strongly recommend backing up to a separate machine.

We should consider not just the drives themselves failing, but also failure of the rest of the machine they’re connected to. It’s unlikely, but a PSU failure could take out pretty much every component of your PC. As could a power surge. With modern filesystems and drives, data at rest (files that you aren’t doing anything with) will be safe during a power outage, but if this happened while a backup was in progress then the results could be pretty devastating. Surge-protected power strips are probably worth the extra few coins, but they’re not invincible. Uninterruptible power supplies (UPSes) are a harder sell, but they’ll guarantee you the precious minutes to shut down your back-up machine cleanly in the event of a power outage.

Backing up to optical media

Back in the day, it was popular to back up on to optical discs (CDs, DVDs, Blu-rays). These use a layer of dye on to which is ‘engraved’ by a laser inside the drive. CD-Rs and DVD-Rs use an organic dye, which over time becomes unstable. Since people have been using these media for the best part of three decades, there’s anecdotal evidence that suggests this degradation can happen within a couple of years. Current science on this, assuming discs are stored ideally (out of direct sunlight, not subject to wild temperatures or scratching) estimates they might last anywhere between five years and a century. And for precious data it’s not worth the risk. So your first step to healthy backups is to move any data you have stored on optical media to something that hopefully will stand better the test of time.

Easier said than done, it turns out. As we saw earlier, modern hard drives aren’t infallible, and we’d caution against using an older drive for back-up purposes. There are all sorts of premium hard drive options, such as for NAS or home security purposes, but if you’re not going to be writing tens of gigabytes a day you can get away with something more budget-friendly. If you do plan on using your back-up drives to store anything else consider doing so with a separate partition, so at least if something goes wrong there, damage may be localised.

articleRead

You can read up to 3 premium stories before you subscribe to Magzter GOLD

Log in, if you are already a subscriber

GoldLogo

Get unlimited access to thousands of curated premium stories, newspapers and 5,000+ magazines

READ THE ENTIRE ISSUE

October 2020