From owner-freebsd-current@FreeBSD.ORG Wed Jan 14 10:38:27 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 E629216A4CE; Wed, 14 Jan 2004 10:38:27 -0800 (PST) Received: from postal3.es.net (proxy.es.net [198.128.3.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id 62BC543D64; Wed, 14 Jan 2004 10:37:39 -0800 (PST) (envelope-from oberman@es.net) Received: from ptavv.es.net ([198.128.4.29]) by postal3.es.net (Postal Node 3) with ESMTP (SSL) id IBA74465; Wed, 14 Jan 2004 10:37:38 -0800 Received: from ptavv (localhost [127.0.0.1]) by ptavv.es.net (Tachyon Server) with ESMTP id 6C0105D08; Wed, 14 Jan 2004 10:37:37 -0800 (PST) To: John Baldwin In-Reply-To: Message from John Baldwin of "Tue, 13 Jan 2004 15:04:14 EST." <200401131504.15194.jhb@FreeBSD.org> Date: Wed, 14 Jan 2004 10:37:37 -0800 From: "Kevin Oberman" Message-Id: <20040114183737.6C0105D08@ptavv.es.net> cc: Dan Nelson 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: Wed, 14 Jan 2004 18:38:28 -0000 > From: John Baldwin > Date: Tue, 13 Jan 2004 15:04:14 -0500 > > 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 > Thanks to both John and Dan. I clearly did not correctly understand how dd operated. Guess it's time to read the sources a bit. I understand why dump|restore is a better choice than dd in may ways, but, if a partition is large and full, dd is MUCH faster. That's why I use it to backup my system disk. I can copy 40 GB in about 40 minutes on my laptop and dumping takes just a bit longer. Non the less, now that I see the problem with dd on a partition, I have used dump and my system is now properly re-partitioned. It's nice to see both /var and /usr under 98%! Thanks again for taking the time to explain this. -- R. Kevin Oberman, Network Engineer Energy Sciences Network (ESnet) Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab) E-mail: oberman@es.net Phone: +1 510 486-8634