[linux-lvm] Enterprise Backup Software with good support for LVM

David Brown lvm at davidb.org
Tue Nov 29 19:19:06 UTC 2005


On Tue, Nov 29, 2005 at 01:43:17PM -0500, Steffen Plotner wrote:

> I would like to add that creating backups of LVM snapshots is sensible,
> as the data is in a crash-consistent state. Today's operating systems
> can definitely handle this type of state. I have developed scripts that
> effectively netcat contents from LVM snapshots to a remote machine
> (either into another logical volume or simply a file). 

One other thing to point out.  Any backup utility that is based on
timestamps, as opposed to a file database, is going to occasionally miss
changes made between the creation of the snapshot and the invocation of the
backup.

For example.  I perform the following.

   - Make snapshot of /foo.
   - Create file /foo/bar.
   - Backup the /foo snapshot.

At this point, the backup of /foo won't contain the file 'bar', since it
was created after the snapshot was made.

However, if the backup software uses the time that the backup was created,
rather than the time the snapshot was created, it will think that /foo/bar
would have been included in the backup, and won't catch it for future
incrementals.

If the backup software knows about LVM (creating the snapshots itself, for
example), then it _should_ know to use the correct timestamp.  My personal
experience is that it is very rare to find backup software that will
restore to the same filesystem at the time of backup.  Even the very
expensive ones don't always do the right thing.

As an example, GNU tar can be coerced into doing the right thing with LVM
snapshots.  Something like this.

  # touch /tmp/snapstamp
  # lvcreate -s ...
  # mount ...
  # tar ... -g $lfile ...

  Then fix up the timestamp on the backup.
  # stat -c %Y /tmp/snapstamp > $lfile.bak
  # tail -n +2 $lfile >> $lfile.bak
  # mv $lfile.bak $lfile

Star accepts a 'dumpdate=/tmp/snapstamp' option to use instead of current
time.

Dave




More information about the linux-lvm mailing list