LMV Snapshots
Ben Scott
dragonhawk at gmail.com
Fri Nov 17 07:59:28 EST 2006
On 11/17/06, klussier at comcast.net <klussier at comcast.net> wrote:
>> The bigger worry is that some data file somewhere
>> is in an inconsistent state, and no good for data recovery purposes.
>
> That I'm not overly concened about. This is a mail server, and just prior to the the
> snapshot, I suspend writing to the mail store and sync the disks.
Well, then, assuming that is working as advertised, you should be in
very good shape.
> And, for complete disaster recovery, it's a RAID 10 system ;-)
Heh, "complete disaster" can include something like "pipe burst over
server room and flooded it", but I presume you are taking your
snapshot backups to someplace else. :)
> In a truely ideal world, LVM would prevent writes to the FS when it is doing a snapshot.
> That would avoid needing every piece of software out there to be "snapshot aware".
LVM does prevent writes "during" a snapshot. An LVM snapshot is,
from the standpoint of the filesystem, instantaneous. The problem is
that file I/O is *not* instantaneous.
Now, a filesystem-level snapshot, which I understand NetApp does
(I've never actually admin'ed one, but I've been a user), can do
things like accumulate writes to a file and save those out as part of
the snapshot. In other words, if the mail server is writing a 20 KB
spool file, and the snapshot is taken at 10 KB, the filesystem can
accumulate the other 10 KB and make sure the complete file is in the
snapshot.
But there are practical limits on how long you can wait and how much
you can accumulate. What if you're writing a 4 GB movie file over the
course of an hour? Are you willing to defer the completion of the
snapshot until that file is closed?
It also doesn't help for something like a database, where there
might be just one giant file that's constantly getting updated. It's
not a simple append, and the file never closes, so having the system
prevent writes won't work. Simply "caching" the writes which occur
during the snapshot (which LVM does, just at the device level) will
still appear, to the database, as if the machine crashed at the
instant of the snapshot.
-- Ben
More information about the gnhlug-discuss
mailing list