Everyone has important data – data that needs to be kept safe. Most of the time this can be accomplished by just creating a DropBox or Google Drive account and uploading important files to it.
Sometimes, however, you need to back up an entire hard drive. Here are four ways that you can back up the entire contents of a hard drive on Linux. With each list item there are different ways to back up. Which way is the best?
1. Gnome Disk Utility
Perhaps the most user-friendly way to back up a hard drive on Linux is to use the Gnome Disk Utility. It’s a tool that comes with most Linux distributions that take advantage of Gnome’s desktop and software offering. Backing up with the Disk Utility is very self-explanatory: select what hard drive you wish to back up (in the form of a raw .IMG file), select where to save the backup and sit back.
All and all, if you’re looking to make a complete backup of your hard drive on Linux and you’re not interested in fussing with live disks, command-line programs or anything like that, look no further. There’s a full tutorial on how to do this here.
A popular way to back up hard drives on Linux is by using Clonezilla. It’s a live disk utility that can be burned to a USB drive or optical media that you can boot from. Once booted, Clonezilla can clone entire disks or even just partitions. It can clone one drive directly to another. Or, if you prefer, Clonezilla can clone to raw .IMG files.
If you’re looking for a great hard drive backup solution similar to Gnome Disk Utility but with more options and settings for advanced users, check out this program. There’s a full tutorial for Clonezila here.
Chances are if you’ve ever used Linux, you’ve run into the
dd command at one point or another. The tool is incredibly easy to use. Here’s how to use the DD tool to make a backup of your Linux hard drive.
You’ll need to open a terminal window.
Once you’re in the terminal, find out what hard drive you want to back up with the
lsblk command. In this tutorial “/dev/sda” will be the drive getting backed up.
With “/dev/sda” taken care of, it’s time to figure out where the DD tool will place the backup. Use lsblk to figure out what the system calls the drive that will hold your backup. In this tutorial the backup will be placed on “/dev/sdb” (another hard drive).
To run the backup, just enter the following command and wait patiently.
sudo dd if=/dev/sda of=/dev/sdb
It is also possible to just back up one partition instead of an entire drive.
sudo dd if=/dev/sda1 of=/dev/sdb1
If you wish to restore the backed up drive, just run these commands again, but in reverse order.
To restore the backup, just enter the following command and wait patiently.
sudo dd if=/dev/sdb of=/dev/sda
To restore a partition backup:
sudo dd if=/dev/sdb1 of=/dev/sda1
Another way you can back up your hard drive on Linux is with TAR. Tar is a bit different from other backup solutions on this list. Unlike Gnome Disk Utility, DD or Clonezilla, you won’t be making an exact copy of your drive. Instead, you’ll be compressing an exact copy of your entire Linux file system into a TAR archive.
This can be accomplished with just two commands. Open a terminal and enter the following:
cd command puts us in the / directory (or root). This is the home to all files on your Linux installation. After that just run the backup command and sit back.
sudo tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --one-file-system /
Once the command above has finished its run, look for the backup.tar.gz file inside the / folder and save it to an external file system. If ever you lose some files that need to be restored, just run the following command to restore them:
sudo tar -xvpzf /path/to/backup.tar.gz -C /restore/location --numeric-owner
Keeping a backup is important when using an operating system. You never know what’s going to happen with your data. There are many, many backup tools for Linux. This list covers the most popular. There is no doubt there are others out there that can back up drives just as well.
How do you back up your drives on Linux? Tell us below!
Our latest tutorials delivered straight to your inbox