From owner-freebsd-questions@FreeBSD.ORG Fri May 29 17:58:07 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 E508F1065673 for ; Fri, 29 May 2009 17:58:07 +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 B62918FC15 for ; Fri, 29 May 2009 17:58:07 +0000 (UTC) (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 n4THu8cM064484; Fri, 29 May 2009 13:56:08 -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 n4THu8wZ064483; Fri, 29 May 2009 13:56:08 -0400 (EDT) (envelope-from jerrymc) Date: Fri, 29 May 2009 13:56:08 -0400 From: Jerry McAllister To: Martin McCormick Message-ID: <20090529175608.GB64291@gizmo.acns.msu.edu> References: <200905291717.n4THHXGA036429@dc.cis.okstate.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200905291717.n4THHXGA036429@dc.cis.okstate.edu> User-Agent: Mutt/1.4.2.2i Cc: freebsd-questions@freebsd.org Subject: Re: Producing Bad Dumps 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: Fri, 29 May 2009 17:58:08 -0000 On Fri, May 29, 2009 at 12:17:33PM -0500, Martin McCormick wrote: > Jerry McAllister writes: > > Probably you did not want the -x or -u, but instead wanted to do > > cd /MOUNTED_EMPTY_PARTITION > > restore -rf DUMPFILENAME > > That would be the ideal command. Per haps there is a > better approach so I am all ears as the saying goes. > > I am trying to set up a procedure so that we can take > another server, if necessary, format the drive with FreeBSD and > then restore the contents of a dead server to this drive and > have it ready to run. Yes, you would want to use restore -r for that. > > Of course, dd is great if both drives are the same size > but usually, the only thing both servers have in common is they > are both i86 systems and the goal is to try to get a platform > with a melted hard drive or mother board back on line. The holy > grail is a clone operation that can be documented so that a > worker of reasonable knowledge can do it successfully. You don't really want to use dd for that, partly for the reason that you give and partly because it doesn't allow the [new] system to do things such as assign inodes and space efficiently. > So, you need all the files, but they probably will not > occupy a disk that looks like the original one. In that respect, > tar does well but trashes special files like /dev > > > But, I am not sure because it is hard to understand why you chose -xu. > > The thought was that -u unlinks existing files so one > could write the restore right over the minimal system that was > there. -x was to extract / in order to get the entire root file > system. Well, you don't really want to create a minimal system on the device if you don't have to. You just want to slice (fdisk), partition(bsdlabel) and newfs it (using either sysinstall or manually fdisk, bsdlabel and newfs from a fixit) and then use a fixit CD to write the dump to the device with restore -r. That might be a problem if you are trying to read the dump from a remote storage. I don't know if the fixit has enough stuff to do that - it might. In that case, you might be better off having a spare drive you can plug in and build that minimal system on and then use it to build the full system and repopulate it from the remote dump file with restore -r. Actually, I think if you use restore -r it will behave OK writing over existing files. All the warning about it needing to be a clean file system is mostly so you won't overwrite something you do not want to. But, it leaves the possible problem that some vestigial stuff will be left around from the minimal install you overwrite with files you really don't want to be left around - eg files it has that are not duplicated in the dump so it ignores them and leaves them there. Try it out that way. Just use restore -rf and see how it handles it. > > Again, the idea is to recover a FreeBSD system as > quickly as possible and get it back to the patch level and > general operating conditions it was originally in before the > hardware that supported it died. If you made your own 'spare' disk that could be plugged in, you could script rebuilding the new disk and restoring the dump. You might have to tinker a bit. We used to have a complete setup that built the disk and then restored from a backup that we distributed. It did the disk slicing, then asked if it was a new install or if a restore from backup was desired and did it. That took a lot of writing in C and it needs to be rewritten since FreeBSD 4. But, it is readily doable. Have fun, ////jerry > > Again, many thanks. > _______________________________________________ > 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"