How to make a block-level incremental backup using LVM?

Alan Cox alan at lxorguk.ukuu.org.uk
Fri Dec 14 13:56:52 UTC 2012


> backups using dump, dd, and some LVM or ext utility? Maybe using 
> inotify? Why no open source backup tool seems to be doing this?

Because it turns out to be a dumb way of trying to do it. It's also near
impossible to get a consistent image. Plus it's becoming clear that
"block device" as a concept is on the way out. Current SSDs provide one
for compatibility.

> Would any option allow me to restore an individual file? (I guess we can 
> live with restoring entire file systems, it's just a matter of 
> segregating a few file trees instead of having everything on the same 
> logical volume.)

A block dump doesn't even guarantee you can restore the volume unless its
an atomic snapshot of everything involved, including journals if they are
on another device.

A block dump may also be useless if you get fs corruption as your copy
will have the same corruption if it's not caught early and is gradually
spreading through the fs.

> And maybe there is some open source solution or help to implement file 
> archiving (moving old/unused files to a different volume so I can't 
> forget about then on the daily backup).

For file based work find and rsync can be used to shuffle stuff off. To
do block level backups the usual approach is to use drbd or a local
mirrored disk set, add a volume to the mirror, sync the mirror, split the
volume back off and then back it up. LVM snapshots can be used for the
same stuff.

Another important thing to say here. Don't buy or deploy a backup system
until your setup includes the ability to verify your backups worked and
a regular verification process. A lot of people overlook this and two
years later when the manure hits the fan discover their solution doesn't
work or their crypto keys for the restore are not backed up where they
can be obtained to allow the restore (or the license key etc)

There is an awful lot to be said for rsync based backup (or with larger
volumes an inotify based setup doing the same thing).

Anyway IMHO there is a good reason why block based backup is not
generally provided by the Linux backup solutions - it's not a good model.
Even the big bucks ones are not really block based so much as logging.

I've not dealt directly with the high end appliance stuff but the
"cheap" (relatively speaking) software commercial backup on Linux I've
touched has been uniformly dismal and not something I'd trust with my
data.

The other path to go although it's a little new in upstream is to learn
about Ceph (www.ceph.com). I don't go much for XYZ is the future of ...
but in the Ceph case they may actually be right. Ceph basically does to
storage what some of the cloud stuff did to service deployment.

Alan


More information about the users mailing list