From owner-freebsd-questions@FreeBSD.ORG Sat May 26 20:31:27 2007 Return-Path: X-Original-To: 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 7262416A400 for ; Sat, 26 May 2007 20:31:27 +0000 (UTC) (envelope-from svein.h@lvor.halvorsen.cc) Received: from merke.itea.ntnu.no (merke.itea.ntnu.no [129.241.7.61]) by mx1.freebsd.org (Postfix) with ESMTP id F361013C44B for ; Sat, 26 May 2007 20:31:26 +0000 (UTC) (envelope-from svein.h@lvor.halvorsen.cc) Received: from localhost (localhost [127.0.0.1]) by merke.itea.ntnu.no (Postfix) with ESMTP id BF40213C4A9 for ; Sat, 26 May 2007 22:31:25 +0200 (CEST) Received: from maren.thelosingend.net (maren.math.ntnu.no [129.241.211.48]) by merke.itea.ntnu.no (Postfix) with SMTP for ; Sat, 26 May 2007 22:31:25 +0200 (CEST) Received: (qmail 82199 invoked by uid 88); 26 May 2007 22:31:25 +0200 Received: from maren.math.ntnu.no (HELO weld.ej2.thelosingend.net) (129.241.211.48) by maren.thelosingend.net (qpsmtpd/0.31.1) with ESMTP; Sat, 26 May 2007 22:31:10 +0200 Message-ID: <465898D5.7080607@lvor.halvorsen.cc> Date: Sat, 26 May 2007 22:30:13 +0200 From: Svein Halvor Halvorsen User-Agent: Thunderbird 2.0.0.0 (X11/20070523) MIME-Version: 1.0 To: Roland Smith References: <465864F4.7060500@lvor.halvorsen.cc> <20070526180336.GB34660@slackbox.xs4all.nl> <465884E3.5000500@lvor.halvorsen.cc> <20070526194342.GA37130@slackbox.xs4all.nl> In-Reply-To: <20070526194342.GA37130@slackbox.xs4all.nl> X-Enigmail-Version: 0.95.0 OpenPGP: id=9198BB40; url=mailto:pgpkey@svein.halvorsen.cc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Content-Scanned: with sophos and spamassassin at mailgw.ntnu.no. Cc: 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: Sat, 26 May 2007 20:31:27 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Roland Smith wrote: >>> You can mount the snapshot, and then copy the files back to the original fs. >>> Note that cp can preserve flags, but not ACLs AFAIK. >> Yes, I know that this is possible. However, it's a lot of work. > > Huh? > > Suppose you did 'mksnap_ffs /usr /usr/.snap/20070526' > > Then all you have to is something like: > > # mdconfig -a -t vnode -f /usr/.snap/20070526 -u 0 > # mount /dev/md0 /mnt/snapshot > # cd /usr > # tar cf - /mnt/snapshot/* |tar xpf - > # umount /mnt/snapshot > # mdconfig -d -u 0 > > How much easier could it be? You could easily create a script for this > as well. Let me clarify: It is a lot of work for the computer, for the hdd. >> There should be some straightforward way of rolling back to a >> snapshot, since the files and all the file system structure are >> already there. Also, there might not be room on the disk for it. > > Snapshots take up room as well. But the snapshot is already made. Again, let me clarify: At some point in time, my file system is filled with random* bits. I then make a snapshot. - From now on, all bits** that I flip will be take up an extra bit of space. Then, after changing lots of bits, I decide I wanted the old data back, as the file system was before I started to flip bits. Now, I could either: (a) Flip alot more bits, by making copies of the snapshotted bits over some free area of the disk, or (b) Undo all the bit flipping I have done, since I made the snapshot. In (a) I will have two copies of all the bits that has changed since the original snapshot, while in (b) I am back to where i were before the snapshot. Does this make any sense? Have I not understood this correctly? Best regards, Svein Halvor *) well, not random, but they might just as well be for the sake of the argument **) actually not bits either, but blocks or whatever. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) Comment: mailto:pgpkey@svein.halvorsen.cc to get my PGP-key iD8DBQFGWJjUhQg3vZGYu0ARAofgAJ9QS1pPyYEmeQ8TkgYR7HbptZ014QCgqmkR 1dr8wcQV0qhR9KH7VlG/4Q0= =ssrQ -----END PGP SIGNATURE-----