From owner-freebsd-fs@FreeBSD.ORG Mon Feb 16 09:32:19 2015 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27B4DE23 for ; Mon, 16 Feb 2015 09:32:19 +0000 (UTC) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "ca.infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C1C8BAD6 for ; Mon, 16 Feb 2015 09:32:18 +0000 (UTC) Received: from ox-dell39.ox.adestra.com (no-reverse-dns.metronet-uk.com [85.199.232.226] (may be forged)) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.15.1/8.15.1) with ESMTPSA id t1G9VwmT068557 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Mon, 16 Feb 2015 09:32:13 GMT (envelope-from matthew@freebsd.org) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none header.from=freebsd.org DKIM-Filter: OpenDKIM Filter v2.9.2 smtp.infracaninophile.co.uk t1G9VwmT068557 Authentication-Results: smtp.infracaninophile.co.uk/t1G9VwmT068557; dkim=none reason="no signature"; dkim-adsp=none; dkim-atps=neutral X-Authentication-Warning: lucid-nonsense.infracaninophile.co.uk: Host no-reverse-dns.metronet-uk.com [85.199.232.226] (may be forged) claimed to be ox-dell39.ox.adestra.com Message-ID: <54E1B90E.8050101@freebsd.org> Date: Mon, 16 Feb 2015 09:31:58 +0000 From: Matthew Seaman User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: freebsd-fs@freebsd.org Subject: Re: About Filesystem freeze/thaw in freebsd References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="aACxa3nfAX3n4xcEClw7HhAUUJ7LiAVkc" X-Virus-Scanned: clamav-milter 0.98.6 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lucid-nonsense.infracaninophile.co.uk X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Feb 2015 09:32:19 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --aACxa3nfAX3n4xcEClw7HhAUUJ7LiAVkc Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/16/15 09:07, zx zx wrote: > Hi, I am experimenting to do a live backup of FreeBSD > VM. Question is do we have freeze/thaw interfaces in FreeBSD? I > searched a lot in web and freebsd source code, just could not find > the right interface. As I know that in linux:VxFS > provides ioctl interfaces to application programs to freeze and thaw > VxFS file systems. The interfaces are VX_FREEZE, VX_FREEZE_ALL, and > VX_THAW.About Freeze and thaw Freezing a file system temporarily > blocks all I/O operations to a file system and then performs a sync > on the file system. Current operations are completed and the file > system is synchronized to disk. Freezing a file system is a necessary > step for obtaining a stable and consistent image of the file system > at the volume level. Consistent volume-level file system images can > be obtained and used with a file system snapshot tool. The freeze > operation flushes all buffers and pages in the file system cache that > contain dirty metadata and user data. The operation then suspends any > new activity on the file system until the file system is thawed. > Any help would be appreciated, thanks a lot! Andy Zhang What you want is snapshotting. You can create a snapshot of UFS or ZFS filesystems, mount the snapshot and then back it up without needing to worry about the filesystem changing while you're trying to back it up. See mksnap_ffs(8) and the 'snapshot' entry in zfs(8) The snapshot is mounted separately from the actual filesystem which can carry on with normal activities in the mean time. Snapshotting functionality is built into dump(8) for UFS filesystems (See the -L flag in that man page) or you can use zfs send / recv to dump filesystems to tape, which implies use of snapshots. Cheers, Matthew --aACxa3nfAX3n4xcEClw7HhAUUJ7LiAVkc Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJU4bkOXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxOUYxNTRFQ0JGMTEyRTUwNTQ0RTNGMzAw MDUxM0YxMEUwQTlFNEU3AAoJEABRPxDgqeTnnlYP/jHvdmSD/ddTW5OiwY191rKw knTidCezM7HvN+k68CkJ8Zi3Hspt0OWH+2+LCFTENDSgYVn+YsLWd5Sqimu7YJSP 5yyzYWBd8ubPb3cb1NClmwWrojTJtPKhY5xgOofZmjsMPqPcZVXZ8rlVk7kOgq5B O2XizNMp4fT4O0mOU7AFmKmTug05b4XM73nYSDpho9NIuFk0IM44GpcFwojhPSn9 9LVVwA//flwjd56O7sd2cWpuNJkWmX6YX/8Jzp4hyfd4YqyCQ7J6qAJqRE/ZKF32 pWTcrl6xiGNJlrwzc/Ija4iq43yS9xwlVR5SXHZBCn4kgGJ3my6ceISoZa1l+pvr W2QV9SQyiv7OQlSf6eHGsT6zDqmerjq6PwTnSLU4wcl5qpM4/wTp8zQJ2BWMkVr7 FrMf93piy7TVaQHg9tpi5LRyOMEbVN6NpH/YSLR6ThYGe1APDDafrQkgGeQZDD+F 3LerLYQ/prvhi/ApeuYtgG/raOsPajTHSV2qb3EFEIE0vlpFYF5gWNUcRrwjFvfw OiQbVKT6lbRPaW/h/jVjcaWzFOwfsDIos/15L3f4berpt81HpnXNumPAVVqRgaJa 5ismFrvS3F6muI+mDGkiE9GCdHbyAlHm/hY08w/mTX76HpFo+XRPCJbHDqHQlWFH pj2w7zXrEY9F10Msxtdl =11OF -----END PGP SIGNATURE----- --aACxa3nfAX3n4xcEClw7HhAUUJ7LiAVkc--