How to duplicate a HD using dd

Willem Riede wrrhdev at riede.org
Sat Oct 11 23:24:09 UTC 2003


On 2003.10.11 18:44, Thiago Vinhas de Moraes wrote:
> Em Sáb, 2003-10-11 às 19:16, jdow escreveu:
> > From: "Thiago Vinhas de Moraes" <tvinhas at techbyte.com.br>
> > 
> > > Sory for the OT, but does anyone the best way to duplicate a HD in
> > > Fedora, just like Norton Ghost does in Winblows? 
> > > 
> > > I tried to use dd if=/dev/hda of=/dev/hdb, but the proccess has never
> > > stoped, after a few hours. 
> > > Both are 40Gb hard drives, but from different manufacters. One is a
> > > Maxtor, and the other one is a Samsung.
> > 
> > If the drives are basically the same size with the destination drive
> > being the larger drive if you elect to waste some drive, then the
> > dd approach is the fastest. However it is best to add a suitable
> > "bs=8225280" or if you don't wish to be so profligate with memory
> > "bs=131072" should be nearly as fast.
> > 
> > "dd if=/dev/hda of=/dev/hdb bs=131072", for example
> 
> What's the difference between "bs=8225280" and "bs=131072" ?
> 
> I tried without the "bs" and when booted with the copied drive, got
> infinite fsck problems that I don't have with the original hd. Do you
> know why?

Even though the two drives are about the same size, they probably have 
different geometries (number of cylinders, etc.). That means that the
partition table that you copied with 'dd' is not going to work.

You may be able to set up partitions manually on your new hd that are 
no smaller that those on your old drive that have data you need to copy 
(swap is an example of one you don't want to copy), and then do 'dd' 
partition by partition (hda1 to hdb1, etc.).

The bs= parameter determines how much gets read from drive one before
switching over to drive 2 and writing. Too small a size makes 'dd' 
inefficient. If this is all that you are doing on your PC, you can use
a good bit of memory, such as 8M (I like powers of 2 -- this is not
exactly the same size as suggested above, but close).

Success, Willem Riede.





More information about the fedora-test-list mailing list