Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Jul 2013 00:53:13 -0600
From:      Will Andrews <will@firepipe.net>
To:        Kevin Day <toasty@dragondata.com>
Cc:        freebsd-fs <freebsd-fs@freebsd.org>
Subject:   Re: EBS snapshot backups from a FreeBSD zfs file system: zpool freeze?
Message-ID:  <CADBaqmihCB5JP01hLwXTWHoZiJJ5-jkT-Ro=oDwOcKZT_zvEKA@mail.gmail.com>
In-Reply-To: <6488DECC-2455-4E92-B432-C39490D18484@dragondata.com>
References:  <87li5o5tz2.wl%berend@pobox.com> <CA%2BtpaK1jQuKneQsxkVfxJGzXdPdLZfqBM1QWQ0e19nK5t71t1Q@mail.gmail.com> <87ehbg5raq.wl%berend@pobox.com> <20130703055047.GA54853@icarus.home.lan> <6488DECC-2455-4E92-B432-C39490D18484@dragondata.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, July 3, 2013, Kevin Day wrote:

> The closest thing we can do in FreeBSD is to unmount the filesystem, take
> the snapshot, and remount. This has the side effect of closing all open
> files, so it's not really an alternative.
>
> The other option is to not freeze the filesystem before taking the
> snapshot, but again you risk leaving things in an inconsistent state,
> and/or the last few writes you think you made didn't actually get committ=
ed
> to disk yet. For automated systems that create then clone filesystems for
> new VMs, this can be a big problem. At best, you're going to get a warnin=
g
> that the filesystem wasn't cleanly unmounted.
>

Actually, sync(2)/sync(8) will do the job on ZFS. It won't stop/pause I/O
running in other contexts, but it does guarantee that any commands you ran
and completed prior to calling sync will make it to disk in ZFS.

This is because sync in ZFS is implemented as a ZIL commit, so transactions
that haven't yet made it to disk via the normal syncing context will at
least be committed via their ZIL blocks. Which can then be replayed when
the pool is imported later, in this case from the EBS snapshots.

And since the entire tree from the =C3=BCberblock down in ZFS is COW, you c=
an't
get an inconsistent pool simply by doing a virtual disk snapshot,
regardless of how that is implemented.

--Will.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADBaqmihCB5JP01hLwXTWHoZiJJ5-jkT-Ro=oDwOcKZT_zvEKA>