From owner-freebsd-fs@FreeBSD.ORG Wed Jul 3 06:53:21 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0D7E4382 for ; Wed, 3 Jul 2013 06:53:21 +0000 (UTC) (envelope-from will@firepipe.net) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx1.freebsd.org (Postfix) with ESMTP id C3985107A for ; Wed, 3 Jul 2013 06:53:20 +0000 (UTC) Received: by mail-vb0-f44.google.com with SMTP id e15so5398919vbg.3 for ; Tue, 02 Jul 2013 23:53:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=kt48liOr/uwK6n4zwT1gmKu62zgiWyPgAQdOlUfb2M8=; b=TbGLAEuSOHQ3SviyJL8D7DM26NLjNZchTCZXT8IRNUsOKcaOhXYePvp7awbpBv88og s4Yhu7QPIIu/HClyD+fD1glsgWGf2nHyqPJtGPIJS+HKWxtMxexPivBCjfyFOXUxpCHw seT/NZBNA/WcM0t+0wMYhpWWlXHbxiWZqTng4+1+5pzfIvSPHUjsTaYljWxoF9Vwm5zY P0owaPt/PMZRoK37CN9jXSoxMv+DIABOYINW6QRSwNK3eLTpBYHI4GbUomkcKv6KiDIT bbyhQye/1bl2MJNMAVQ1EQupwUM9izqxVG/B3wOERyJIvW9DjBjyyb82nfkVeHEOnscl //AQ== MIME-Version: 1.0 X-Received: by 10.220.143.140 with SMTP id v12mr12507568vcu.95.1372834393814; Tue, 02 Jul 2013 23:53:13 -0700 (PDT) Received: by 10.58.226.66 with HTTP; Tue, 2 Jul 2013 23:53:13 -0700 (PDT) In-Reply-To: <6488DECC-2455-4E92-B432-C39490D18484@dragondata.com> References: <87li5o5tz2.wl%berend@pobox.com> <87ehbg5raq.wl%berend@pobox.com> <20130703055047.GA54853@icarus.home.lan> <6488DECC-2455-4E92-B432-C39490D18484@dragondata.com> Date: Wed, 3 Jul 2013 00:53:13 -0600 Message-ID: Subject: Re: EBS snapshot backups from a FreeBSD zfs file system: zpool freeze? From: Will Andrews To: Kevin Day X-Gm-Message-State: ALoCoQkl84tR1UzzOu4V5d0CT2ORoZ4P7PZayBIzetl4B/rd5AcLLK2StxD18M1Fj32B9Z28AtEr Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-fs X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 06:53:21 -0000 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.