Using "dd" copy copy disk partitions
Alan's Home for Wayward Notes File.
alan at shodha.enet.dec.com
Sat May 18 09:36:45 AEST 1991
In article <8410 at jhunix.HCF.JHU.EDU>, barrett at jhunix.HCF.JHU.EDU (Dan Barrett) writes:
>
> I have used "dd" to copy one disk partition to another over
> ethernet (dd if=/dev/foo | rsh another dd of=/dev/bar). Unfortunately,
> this causes the destination partition to believe it is the SAME SIZE
> as the original partition, despite how it was created by newfs.
Yep, no surprise yet.
>
> I'd like to know if there is a way to convince my destination
> partition of its correct size. I tried "chpt -d" but that didn't do it. A
> newfs did it, but of course my data doesn't like that. :-)
Simple; don't use dd(1). dd(1) reads blocks from one place
and copies them to another. It doesn't care what the blocks
contain. You're trying to use dd(1) for something it wasn't
designed to do.
In your case it sound like you're copying the partition table
along with everything else. Even if you could enlarge the
partition, the file system still thinks it was built on a
smaller disk.
>
> BTW, I know that using dump/restore instead of "dd" would avoid this
> problem. I'd prefer an after-the-fact fix, not a new method. Thanks!
You could use tar(1), but that might pick up other files
you don't want.
>
> | Dan Barrett, Department of Computer Science Johns Hopkins University |
--
Alan Rollow alan at nabeth.cxn.dec.com
More information about the Comp.unix.ultrix
mailing list