[linux-lvm] snapshots and filesystem freezing

Dan Kegel dank at kegel.com
Fri Feb 8 12:28:04 UTC 2008

On Feb 8, 2008 4:04 AM, Tomasz Chmielewski <mangoo at wpkg.org> wrote:
> Some filesystems, like xfs, have a "freeze" feature. There was a
> discussion on lkml about implementing it in ext3, too.
> What is the relationship between a filesystem freeze and LVM snapshots?
> As far as I understand, snapshotting a filesystem in any random
> timepoint can mean that the snapshotted fs will be inconsistent (i.e.,
> may need fsck).
> "Freezing" the filesystem will flush all writes to the media, and a
> snapshotted fs should be consistent then (in theory; without an
> interface between filesystem freeze and LVM snapshot it does not
> guarantee that the operation is "atomic").

Historically, executing sync() does most of what freeze does,
though there's a risk that some pesky process will go and do
a write (or some in-flight write will land) after the sync and before
you finish the snapshot.
XFS decided to be different; I think they wanted to shout out to the
world that the old sync() idea was racy, so they refused to implement
it properly, and introduced the theoretically safer freeze/thaw idea.
They may yet drag the rest of us kicking and screaming into the modern world.

Comments in
http://www.paragon-cs.com/wordpress/?p=67 mention that
one used to have to do the xfs freeze manually, but lvm2 now does it for you.
(It also mentions that you really want to manually quiesce your apps, too.)
- Dan

More information about the linux-lvm mailing list