4

What's the best backup solution for Linux that can completely restore the entire filesystem to a blank harddrive (including partitioning) after an old harddrive dies?

I'm currently running a few Ubuntu machines, some with RAID-1 and others without RAID (mostly laptops). I'd like to implement a backup solution that can take incremental snapshots of the entire filesystem, so that if I were to replace all the harddrives in a machine, I could use the backup to restore a perfect copy of the previous filesystem.

Unfortunately, nearly all the backup solutions I've found seem to be glorified rsync scripts, which only backup some files, and have no easy way to restore once the entire filesystem is gone. Some of the more complicated solutions, like Bacula, might do what I need, but require a complicated server/client setup and are notoriously difficult to maintain.

I've heard that Apple's TimeMachine utility has this ability, and I've had similar success taking differential disk images with Acronis True Image on Windows, but of course neither of these work on Linux. Is there anything comparable for Ubuntu?

6 Answers 6

5

First the caveat, I don't think this will meet your incremental requirement, and I'm not sure about the RAID compatibility. But I have played with Clonezilla a little and as a guided solution with plenty of documentation I think it is at least worth checking on.

4

The simplest solution is the dd command.

dd if=/dev/DEVICE_TO_BACKUP of=/mnt/DEVICE/filename

For example if you have a Laptop with an hidden rescue partition a system partition and a another partition it would probably look like this:

/dev/sda0
/dev/sda1
/dev/sda2

To backup one partition you would write dd if=/dev/sdaX of=/mnt/DEVICE/filename where X is the number of the partition. If you want to backup the whole drive with everything on it the command would be dd if=/dev/sda of=/mnt/DEVICE/filename this will backup really everything. To restore the system you would simply change the input file (if=) and output file (of=) of the command. But backup file will of course be huge.

The problem is, it is not incremental. Therefore you might use to backup the home folders and the /etc/ folder, as this are the parts of the linux changing fastest. If you have a clean install of linux in a lot of cases it is sufficient to again apt-get the packets you need (for debian based systems) and copy your old /etc/ folder into the new system. This works on Desktop machines pretty well.

A fast and maybe dirty solution of installing a new linux could be to simply install an Distribution from scratch with adding all the additional software packets. Afterwards create the needed users. Then inserting the backupped /etc/ folder and the /home/ folder(s). You may have to run chown and chmod on the folders, if they came from an fat partition though. But that won't be too much trouble. I have used this to install my Ubuntu after an failed dist-upgrade.

The most important thing is to write down which additional software is installed. So you should document which additional packets should be installed and are installed.

2
  • 1
    Could you please expand on this a little? Would you restore by simply flipping the if and of values, or would that corrupt the current filesystem?
    – Cerin
    Commented Feb 22, 2011 at 15:35
  • @Chris S It works as simple as that. But you will have to use another backup solution for incremental backups. I think the thing you want is just to use dd for an first backup. Afterwards you could write a shell script to backup the files that have changed. I think that is cheapest solution. You could even try to make clean install for all Laptops with the same software and use one dd image for all, as linux has most drivers in the kernel. YOu could be lucky with setting up one laptop and copying the system to the other laptops as long as the drive has the same size or is bigger.
    – Darokthar
    Commented Feb 22, 2011 at 15:49
3

I strongly suggest you take a look at partimage way before using dd, dd will also copy the unused space so the backup image will end up as big as the source partition. Partimage only copy the used space.

Ideally, install a minimal linux distro on a second partition large enough to hold the recovery image, tweak the initscript to include a menu asking you if you want to Restore or make a new recovery, then it runs partimage accordingly.

1
  • 1
    Partimage looks nice. Unfortunately, Ubuntu's default filesystem is ext4, which Partimage doesn't support.
    – Cerin
    Commented Jun 21, 2011 at 14:22
2

How about PING (partimage is not ghost). I have used it to restore XP systems. It is Linux based and does the backup as well as the restore from a CD. I think it will work on Linux systems.

1

We have used Backup Exec Linux Edition for a bare metal restore as well as for individual files/folders. Works very well. Handles hardware changes without issues. Free trial and more info here. backup Exec System Recover for Linux

1

What about Storix? It does bare metal restores, can be automated, can have a serer/client environment and is fairly simple to setup and use.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .