Serious dd breakage in current

Dan Nelson dnelson at
Mon Jan 12 16:20:23 PST 2004

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.

	Dan Nelson
	dnelson at

More information about the freebsd-current mailing list