From owner-freebsd-questions@FreeBSD.ORG Sat May 26 19:59:11 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 31EBB16A469 for ; Sat, 26 May 2007 19:59:11 +0000 (UTC) (envelope-from nomadlogic@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.183]) by mx1.freebsd.org (Postfix) with ESMTP id 5460A13C45A for ; Sat, 26 May 2007 19:59:10 +0000 (UTC) (envelope-from nomadlogic@gmail.com) Received: by py-out-1112.google.com with SMTP id a29so2079362pyi for ; Sat, 26 May 2007 12:59:09 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=cjLaQ5xDExmtT7w8T2zT2NCtAgP/+i6SVcsHfuazGtFLt1jKm0gcQ8AJKecTvLqaXUkJqg7A5rC8wzqJ/A97euMKneG7rXb60Gy2ankcMiTpZg95rxwdx5iPz6Sf7jIqNkAFwPl1X134Vneya9yJXALoxFd4aP2/iAxyTPy5DnE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=nov5x0ErFcgLZnsquSmkmx2Mh6clI7ysC2R5oH7vChE5odjG1T9ljke2BmLPPx2Pevw7RF6yVk+cJBo9HAL26p5qdjCstgAfQLDr5o40KEfARIKJdRpdW+5PaBb/Q3YZAfx2t5kZ/WC7Wac0WEoNgNVk1z1bLyTAUZ/zpMbQzNM= Received: by 10.65.38.5 with SMTP id q5mr8039526qbj.1180207842333; Sat, 26 May 2007 12:30:42 -0700 (PDT) Received: by 10.65.147.14 with HTTP; Sat, 26 May 2007 12:30:42 -0700 (PDT) Message-ID: <57d710000705261230q74830a87j8228f951119e4b22@mail.gmail.com> Date: Sat, 26 May 2007 12:30:42 -0700 From: "pete wright" To: "Svein Halvor Halvorsen" In-Reply-To: <465884E3.5000500@lvor.halvorsen.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <465864F4.7060500@lvor.halvorsen.cc> <20070526180336.GB34660@slackbox.xs4all.nl> <465884E3.5000500@lvor.halvorsen.cc> Cc: Roland Smith , 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 19:59:11 -0000 On 5/26/07, Svein Halvor Halvorsen wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Roland Smith wrote: > >> Is it possible to rollback a file system snapshot, i.e. restore the > >> file system to the state it was in at the time a mksnap_ffs command > >> was issued? > > > > 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. > 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. > > well, if you are using snapshot's you already have most likely calculated the overhead that the snapshot(s) will take - so i'm a little confused at to the lack of room available for the snapshot. it's not uncommon to have hourly, daily, weekly snapshot's of given volumes. > >> User scenario: > >> > >> Before a major upgrade (eg. releng->current, portupgrade -a, etc), > >> it would be nice to mksnap_ffs, and then after the upgrade be able > >> to either delete the snapshot if all went well, or rollback to the > >> snapshot. > > > > You should use dump(8) in this case. Create level 0 dumps of your > > filesystems and store them somewhere. You can dump live filesystems with > > dump's -L flag. > > > > If you botch the upgrade, you can use restore(8) to revert your > > filesystems to the situation before the upgrade. > > > > Note that you should really make regular dumps of your filesystems as > > backups anyway! > > This is also beyond the point, although I appreciate that you > suggest alternative ways to meet my objectives. dump/restore would > also require additional disk space. > > I do actually backup my data on a regular basis, but not all of my > computers really need external backup, as I could stand some > downtime. However, if I could easily make a snapshot, and then > either roll back or delete it afterwards, it would be a nice > compromise between security and effort. And also: it seems it should > be possible to do this. If not, I might want to make a tool for it. > > they handbook has a pretty decent example of how to use dump along side mksnap_ffs - and it seems pretty robust to me. when dealing with whole filesystems and important data i think dump(8) is really the way to go as much work has been put into ensuring that you end up with a consistent image on disk. having said that - i see no reason why one couldn't write a wrapper around dump(8) and mksnap_ffs. -p -- ~~o0OO0o~~ Pete Wright www.nycbug.org NYC's *BSD User Group