From owner-freebsd-questions@FreeBSD.ORG Sun May 27 09:56:38 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3EF3516A400 for ; Sun, 27 May 2007 09:56:38 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr1.xs4all.nl (smtp-vbr1.xs4all.nl [194.109.24.21]) by mx1.freebsd.org (Postfix) with ESMTP id E34CF13C455 for ; Sun, 27 May 2007 09:56:37 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr1.xs4all.nl (8.13.8/8.13.8) with ESMTP id l4R9uaOt052904; Sun, 27 May 2007 11:56:36 +0200 (CEST) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id CF5E3B826; Sun, 27 May 2007 11:56:35 +0200 (CEST) Date: Sun, 27 May 2007 11:56:35 +0200 From: Roland Smith To: Maxim Khitrov Message-ID: <20070527095635.GB57943@slackbox.xs4all.nl> Mail-Followup-To: Maxim Khitrov , freebsd-questions@freebsd.org References: <465864F4.7060500@lvor.halvorsen.cc> <20070526180336.GB34660@slackbox.xs4all.nl> <465884E3.5000500@lvor.halvorsen.cc> <20070526194342.GA37130@slackbox.xs4all.nl> <465898D5.7080607@lvor.halvorsen.cc> <20070526211201.GA40139@slackbox.xs4all.nl> <4658ADB1.3050807@lvor.halvorsen.cc> <20070526223143.GA42141@slackbox.xs4all.nl> <26ddd1750705261608k68b2318ckca20be5889bc71fd@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EuxKj2iCbKjpUGkD" Content-Disposition: inline In-Reply-To: <26ddd1750705261608k68b2318ckca20be5889bc71fd@mail.gmail.com> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.15 (2007-04-06) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: freebsd-questions@freebsd.org Subject: Re: Restore UFS snapshot X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 May 2007 09:56:38 -0000 --EuxKj2iCbKjpUGkD Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 26, 2007 at 07:08:31PM -0400, Maxim Khitrov wrote: > I don't think he is talking about that. From what I understand about > the snapshot system (correct me if I'm wrong) is that a snapshot > creates it's own file system by remembering, for example, what the > superblock was at the time of the snapshot. After that, the live file > system continues on its way keeping track of the snapshot, but > modifying its own blocks to account for the changes afterwards. More or less. You should read =A78.7 of McKusick's book, or the paper he wrote about it; http://www.usenix.org/publications/library/proceedings/usenix99/mckusick.ht= ml=20 For instance, every time you change a block on a filesystem that has a snapshot, the filesystem checks wether that block is in the snapshot already. If not it writes the old contents of that block to the snapshot before writing the new contents to the filesystem block. > I think what Svein wants to do is essentially overwrite a few blocks > on the live file system, loosing all references to the changes that > have been made and in effect returning the file system to the state it > was in when the snapshot was taken.=20 It's not just a question of references. You'll have to copy all the changed blocks back, and change the inodes, et cetera. > This is different from simply > copying the contents of the snapshot back to the disk via an md > device.=20 If you are using something like rsync it's not very much different. The point is that you're using established and debugged methods and code to change the filesystem, instead of writing new tools to do the same.=20 > This way he would restore the snapshot and lose it at the same > time, but the operation should be O(1) in theory (time and space), as > opposed to O(n) which any normal back-up/restore is. You don't lose the snapshot untill you delete it. And even then there are situations where not all the used space can be reclaimed. If a subsequent snapshot was taken, for instance. The process of undoing the snapshot can't be O(1). Because the time needed to create the shapshot isn't either. Roland --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --EuxKj2iCbKjpUGkD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (FreeBSD) iD8DBQFGWVXTEnfvsMMhpyURAmo3AJ9bJHI4sxQ21Ce/Q8iYzet/ljflBwCfZL2m PpjYvooEo9UQlfbHwoQVMeE= =aoVR -----END PGP SIGNATURE----- --EuxKj2iCbKjpUGkD--