From owner-freebsd-current@FreeBSD.ORG Tue Jan 13 12:42:45 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1915616A4E0 for ; Tue, 13 Jan 2004 12:42:45 -0800 (PST) Received: from mail2.speakeasy.net (mail2.speakeasy.net [216.254.0.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 10A6C43D5C for ; Tue, 13 Jan 2004 12:42:35 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 22308 invoked from network); 13 Jan 2004 20:42:34 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 13 Jan 2004 20:42:34 -0000 Received: from 10.50.40.206 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.10/8.12.10) with ESMTP id i0DKgTM0070836; Tue, 13 Jan 2004 15:42:30 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Dan Nelson , Kevin Oberman Date: Tue, 13 Jan 2004 15:04:14 -0500 User-Agent: KMail/1.5.4 References: <20040113001114.A72825D07@ptavv.es.net> <20040113001959.GC92646@dan.emsphone.com> In-Reply-To: <20040113001959.GC92646@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200401131504.15194.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: current@freebsd.org Subject: Re: Serious dd breakage in current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2004 20:42:45 -0000 On Monday 12 January 2004 07:19 pm, Dan Nelson wrote: > In the last episode (Jan 12), Kevin Oberman said: > > Today I bit the bullet and re-sized some partitions on my laptop's > > disk. One think I planned to do was copy the unchanged partitions from > > my backup disk to the primary with dd(1). This was a BAD idea and I > > suspect GEOM changes are at the root of it. > > > > I used fdisk to create new slices and then bsdlabel to make new > > partitions in ad0s2. Everything seemed to be fine. > > > > Then I ran dd to copy the root partition over: dd bs=32k if=/dev/ad2s3a > > of=/dev/ad0s2a For some reason it labeled the disk with the first > > partition starting at almost the end of the physical partition, over 30 > > million blocks into the slice. bsdlabel generated a stream of errors > > including that every partition extended past the physical partition. > > You can't dd disklabel partitions, as they use absolute offsets from > the start of the disk, not the start of the slice. The disklabel > command compensates for this so you see relative offsets. You can work > around the problem by dumping your partition info to a text file and > updating the new disk with disklabel after the dd command. dump / restore is a better method though anyways. It doesn't bother with copying unused blocks for one thing. It will also allow things like dirhash to more efficiently lay out your files on the new file system. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org