From owner-freebsd-questions@FreeBSD.ORG Wed Oct 14 22:07:42 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 73B45106568F for ; Wed, 14 Oct 2009 22:07:42 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 1B5658FC27 for ; Wed, 14 Oct 2009 22:07:41 +0000 (UTC) Received: from r55.edvax.de (port-92-195-71-245.dynamic.qsc.de [92.195.71.245]) by mx01.qsc.de (Postfix) with ESMTP id 6562F3CB61; Thu, 15 Oct 2009 00:07:40 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id n9EM7eI5001659; Thu, 15 Oct 2009 00:07:40 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Thu, 15 Oct 2009 00:07:40 +0200 From: Polytropon To: PJ Message-Id: <20091015000740.53ccdd0a.freebsd@edvax.de> In-Reply-To: <4AD640F5.20303@videotron.ca> References: <4AD640F5.20303@videotron.ca> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Manolis Kiagias , freebsd-questions@freebsd.org Subject: Re: clone-dump-restore X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2009 22:07:42 -0000 On Wed, 14 Oct 2009 17:21:57 -0400, PJ wrote: > It has taken me some time to prepare for a cloning of an existing 7.2 sytem. > Now that I have everything running smoothly with all the proggies & > configurations the way I want them, I tried (notice - tried) to clone > the system. > Here's the setup: > FBSD 7.2 on ad4 and same on ad12. I do assume that the system on ad6 is your source system, and ad12 should then be the same by the means of cloning? In later lines, you're dumping to a da device (not ad). Do you already have two FreeBSD source systems set up? > First, running on ad4, I tried to dump & restore each partition directly: > ad12s1a to da0s1a (usb sata disk). No go. It would be good to see the command that you issued to do so, including the currend working directory. > I had set it up originally > with livefs, minimal; then redid it all with fdisk, bsdlabel and nwfs; There's no need to do the slicing and partitioning twice. > then > dump -0af - /dev/ad12s1a | restore -rf - /dev/da0s1a The command does not look okay. Keep in mind that a) ad0s1a is mounted, b) you need to be in the mounted / of da0 and c) ad1s2a is mounted ro. You can forget about c) if you're dumping | restoring from a live file CD or DVD. In this case, ad12s1a isn't mounted, which is good. You should end up with a setting like this: # mount /dev/da0s1a /mnt # cd /mnt # dump -0 -f - /dev/ad12s1a | restore -r -f - See the difference? The restore command does NOT require a device name, because the point where to restore is the current working directory, as indicated by the previous cd command. > --- got error messages about not being a tape device. Great. Looks like incorrect command... see above. > Next, I tried with another usb/sata disk on da0... dumped to files (dump > went w/out problems) ... mounted da0 partitions 1 x 1 to /mnt, cd'd to > /mnt and did > restore -rf file. > Only the ad12s1f(usr) restore gave long list of "unable to create file> or link > or something like that". Again, the complete command (including pwd) would have been helpful, so I can only guess. I assume you dumped /usr into a file on a usb disk (da). In order to restore this file to a partition you created on another disk, let's say ad6 (ATTENTION, EXAMPLE!), the command to do so would be: # mount /dev/da0 /mnt # mkdir /mnt2 # mount /dev/ad6s1e /mnt2 # cd /mnt2 # restore -r -f /mnt/usr.dump Keep in mind that (in difference to my previous example) /mnt now refers to the /usr partition, not to /. This of course assumes that you've already sliced and partitioned ad6. It includes formatting (newfs), obviously. > When I then installed the restored disk to another computer (identical > except for CPU (3gb instead of 2.4gb), booted from the restored disk and > saw that it was trying to boot from ad12s1a which doesn't exist on the > new machine. uh...oh... The boot loader tries to boot the first ATA disk. This has been discussed in the questions@ list few days ago. > Somehow I think I may not have understood something. I'm sure about this. Re-read the examples above and you'll notice easily how the dump and especially the restore command have to be invoked for proper operations. > Perhaps I should install the disk directly in the dump/restore machine > and try again. This is possible, but as long as you're using an USB transfer disk which gets its content as data files (.dump files) from the ATA disk (source disk), and which are then restored to another ATA disk (target disk), there shouldn't be a problem. Because I'm a lazy guy, I mostly use a live file system (FreeBSD live fs is completely okay, but FreeSBIE is good, too) in order to run the sysinstall program which I use to slice, partition and format the target disk as intended. I then use a USB stick or a USB disk to make the dump files available (previous example) and restore them to the target disk. Note that things like the boot loader are now independent of my dumps as they get written by sysinstall. > Oh, yes, another sign from the gods... when restoring to a partition > just newfsed there is a warning that .snap is already installed... now > what on earth or moon is that? The .snap directory is used for file system snapshot. As far as I remember, newfs creates this directory, or maybe it's fsck at its first run? Don't mind, it's not important (until you need it for data recovery). > I will try again... and try to document more clearly... :-( Yes, please. Good luck! -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...