From owner-freebsd-questions@FreeBSD.ORG Mon Aug 1 22:20:17 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6FDAE16A41F for ; Mon, 1 Aug 2005 22:20:17 +0000 (GMT) (envelope-from garys@opusnet.com) Received: from opusnet.com (mail.opusnet.com [209.210.200.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2140E43D46 for ; Mon, 1 Aug 2005 22:20:17 +0000 (GMT) (envelope-from garys@opusnet.com) Received: from localhost.localhost [70.98.246.232] by opusnet.com with ESMTP (SMTPD32-8.05) id A01D654800E2; Mon, 01 Aug 2005 15:20:13 -0700 Received: from localhost.localhost (localhost.localhost [127.0.0.1]) by localhost.localhost (8.13.3/8.13.3) with ESMTP id j71MLdDe002599; Mon, 1 Aug 2005 15:21:39 -0700 (PDT) (envelope-from garys@opusnet.com) Received: (from jojo@localhost) by localhost.localhost (8.13.3/8.13.3/Submit) id j71MLYHV002598; Mon, 1 Aug 2005 15:21:34 -0700 (PDT) (envelope-from garys@opusnet.com) To: "Alexandre D." References: From: garys@opusnet.com (Gary W. Swearingen) Date: Mon, 01 Aug 2005 15:21:34 -0700 In-Reply-To: (Alexandre D.'s message of "Mon, 1 Aug 2005 18:59:27 +0200") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-questions@freebsd.org Subject: Re: Migrate primary disk (duplicate) 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, 01 Aug 2005 22:20:17 -0000 "Alexandre D." writes: > Here is the complete process I follow: > > sysctl kern.geom.debugflags=16 > dd if=/dev/zero of=/dev/${disk} bs=1k count=1 Shouldn't be needed, but if you're concerned, write enough sectors to zero the start of {disk} and the start of {disk}s1 -- something like 63+16; bs=100k maybe. > fdisk -BI ${disk} Again, -B and -I don't sound like a good combo. > disklabel -B -w -r ${disk}s1 auto You said you were running 5.4. AFAIK, there's no "-w", "-r", and no "auto". Other than that it looks fine. :) (But knowing the way some developers think, they might have been removed from the manpage only. Grrrr.) > disklabel -R ${disk}s1 generique.disklabel > newfs /dev/${disk}s1a > newfs /dev/${disk}s1d > mount /dev/${disk}s1a ./mnt > cd ./mnt > dump 0uafL - / | restore xf - Looks like you're dumping to a file named "./mnt/L". Does ./mnt really have anything else in it after that restore? > -----generique.disklabel file------- > a: 41943040 0 4.2BSD > b: 2097152 * swap > d: * * 4.2BSD Could be. Have it print out the resulting disklabel and see if looks OK. > If I do the same with /stand/sysinstall in stead of > dd if=/dev/zero of=/dev/${disk} bs=1k count=1 > fdisk -BI ${disk} > disklabel -B -w -r ${disk}s1 auto > It works well. Could it be because it uses "boot0cfg" and you use "fdisk"? (You haven't said whether you're telling sysinstall to install a standard MBR or a FreeBSD MBR or none.) If you're curious, you can dump the two main boot sectors a readable file and compare the sysinstall version with the fdisk version and /boot/mbr and /boot/boot0. dd if=/dev/ad0 count=1 | hd >/tmp/ad0 dd if=/dev/ad0s1 count=1 | hd >/tmp/ad0s1