From owner-freebsd-questions@FreeBSD.ORG Mon Sep 14 14:33:57 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 107911065670 for ; Mon, 14 Sep 2009 14:33:57 +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 C039E8FC12 for ; Mon, 14 Sep 2009 14:33:56 +0000 (UTC) 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 n8EESo5T047153; Mon, 14 Sep 2009 10:28:50 -0400 (EDT) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id n8EESnwF047152; Mon, 14 Sep 2009 10:28:49 -0400 (EDT) (envelope-from jerrymc) Date: Mon, 14 Sep 2009 10:28:49 -0400 From: Jerry McAllister To: Chris Maness Message-ID: <20090914142849.GA47054@gizmo.acns.msu.edu> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i Cc: freebsd-questions@freebsd.org Subject: Re: Dump/Restore? 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: Mon, 14 Sep 2009 14:33:57 -0000 On Sun, Sep 13, 2009 at 06:15:55PM -0700, Chris Maness wrote: > I level 0 dump of my server. I lost a file that I need back. Is it > possible to use restore like tar and explode it into a directory > instead of a pristine partition/mount? Or even better, is it possible > to just extract a single file without exploding the whole tape dump? Yes, it is easily done. Just use the 'interactive' option. First, be clear where you want the restores file[s] to go. The official way to do the interactive option is to cd in to the bottom level of the filesystem it is in and do it from there. Restore will then put the files in the directories where they were when the dump was made. So, if the file[s] were in /home/joes/files/ cd to /home and do the restore. It will take care of knowing about the joes and files subdirectories and build them if they are not there. But, really the general recommended way (and the way I do it) to do an interactive restore is to create a designated directory for it and cd in to that. It can be anywhere there is room for the files. So, for example, on some systems I have a large amount of extra space in a filesystem I mount as /work. Within that I create a directory I can recover (for lack of any more imaginative name). I cd to the /work/recover directory and do the interactive restore. eg do: cd /work/recover restore -if dump_device/file Then fish around amongst the directories. When you find the one[s] you need to restore, just do add filename You can keep going and add several files and directories. When you have all that you want/need, then type extract It will ask you what tape to start with. If the dump is a file or of there is only one tape or other device, type 1 If there are more than one tape, type in the number of the last tape. It will search backward through the list of tapes/devices until it finds the files. eg. if there are 7 tapes in the level 0 dump set, start with 7, then give it 6 and then 5, etc. It will quit asking when it finds the files. Finally, it will ask if you want to set ownership of . Say no unless you have a good reason for doing otherwise. Now, if you have used a separate directory as I suggest above, tell restore to quit and then look at the file[s] to make sure they are all right and then manually move then to whichever directory you want. You can then delete them from /work/recover but leave that directory around for when you need it again. This is good for any circumstance when you want to pull just one of a few files out of a dump (or a tar file). I do a similar thing when I untar stuff I have moved over. I make a /work/unroll directory and untar stuff in there and move whay I want to where I want it. This may seem to be an extra unnecessary step, but it cuts down on errors, in my handling directories and file locations. ////jerry > > Sorry if the question seems stupid. > > Chris KQ6UP > _______________________________________________ > 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"