Re: Serious dd breakage in current

From: John Baldwin <jhb_at_FreeBSD.org>
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 <jhb_at_FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
Received on Tue Jan 13 2004 - 11:42:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:37 UTC