From owner-freebsd-questions@FreeBSD.ORG Thu Nov 30 16:25:04 2006 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 EAC9916A494 for ; Thu, 30 Nov 2006 16:25:03 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (gizmo.acns.msu.edu [35.8.1.43]) by mx1.FreeBSD.org (Postfix) with ESMTP id 536D243E84 for ; Thu, 30 Nov 2006 16:10:23 +0000 (GMT) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (localhost [127.0.0.1]) by gizmo.acns.msu.edu (8.13.6/8.13.6) with ESMTP id kAUG8OeW004927; Thu, 30 Nov 2006 11:08:24 -0500 (EST) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id kAUG8NlX004926; Thu, 30 Nov 2006 11:08:23 -0500 (EST) (envelope-from jerrymc) Date: Thu, 30 Nov 2006 11:08:23 -0500 From: Jerry McAllister To: Rachel Florentine Message-ID: <20061130160823.GB4725@gizmo.acns.msu.edu> References: <20061130112939.12787.qmail@web57808.mail.re3.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061130112939.12787.qmail@web57808.mail.re3.yahoo.com> User-Agent: Mutt/1.4.2.2i Cc: freebsd-questions@freebsd.org Subject: Re: Data Recovery 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: Thu, 30 Nov 2006 16:25:04 -0000 On Thu, Nov 30, 2006 at 03:29:39AM -0800, Rachel Florentine wrote: > Hi; > Is there a data recovery utility anywhere available? Not one that loads > into Windoze, but straight into FBSD. I tried the following command to > back up my working HD to my new 1/2 teraflop HD: > > cp -R /* /ad2 > > and I managed to crash the system (recovered easily) and fry some important > files on ad2. That won't really get what you want anyway. It doesn't handle hard links the way you want and I don't really think it will get other file systems mounted in root (/), though I haven't tried that. Also, I think you would need a trailing '/' on ad2 in your command to come even close. How about using dump(8) and restore(8). They handle everything correctly. You can either leave everything in the dump file[s] on your big disk just in case you need it [them] in the event of a failure on you main working disk or build file systems on the big disk and restore everything in to them so the file systems are mountable from the big disk. The first choice probably makes most sense as a backup/recovery method. This is not a ghost type sector-by-sector backup (which is mostly useless) but a file-by-file backup (including all directory structures and links). So, you need to run dump for each filesystem you want to back up. First, create one large slice on ad2 using fdisk. Then create at least one partition in that slice using bsdlabel. Then create filesystems in the partitions using newfs. Then you can write to that disk with regular commands such as cp, tar or dump. Then, presuming one slice (1) and one partition (a), mount that big partition as something - lets say '/stash' eg mkdir /stash mount /dev/ad2s1a /stash Now use dump dump 0af /stash/rootdump / dump 0af /stash/usrdump /usr etc If you create separate file systems to make mountable images of each file system, then mount them as something sensible - say /bakroot and /bakusr Then to use dump/restore, do: cd /bakroot dump 0af - / | restore -r - cd /bakusr dump 0af - /usr | restore -r - This will get you working copies of those two file systems including links - which will still point to the real locations, not the copies, of course. Anyway, regardless of what you do, you must fully create at least one file system on the big disk and them mount it to write to it. You cannot write directly to the unprepared device as ad2. Of course, you could create that partition as above doing fdisk, bsdlabel and newfs and then create a mount point called /ad2 and mount it as such. But, I would shy away from that, just because it can create confusion. I would recommend using mount point names that represent what is to be written there as I have done above. ////jerry > TIA, > Rachel > > __________________________________________________________________________ > Yahoo! Music Unlimited > Access over 1 million songs. > http://music.yahoo.com/unlimited > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >