Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Feb 2002 07:56:53 -0600
From:      jacks@sage-american.com
To:        Giorgos Keramidas <keramida@FreeBSD.ORG>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Using dd to clone HD
Message-ID:  <3.0.5.32.20020210075653.0195ca18@mail.sage-american.com>
In-Reply-To: <20020210063555.U16121-100000@hades>
References:  <3.0.5.32.20020209110118.0195ca18@mail.sage-american.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks for the reply. I went ahead and tried the 'dd' approach using two
identical 10GB HDs on an experimental box where I wasn't concerned about
the result just to see what would happen. After more than two hours of
copying, I decided to abort the process because 10GB is a pretty small HD
and it would be a very long process to use on the bigger HDs.

Of course the abort trashed the 2nd HD but fixed it with FDISK. Back to the
drawing board, perhaps with some of your other suggestions. I already use
tar....

At 06:42 AM 2.10.2002 +0200, Giorgos Keramidas wrote:
>jacks@sage-american.com wrote:
>
>> On a FBSD box (4.5-stable) with two identical HDs and in the abscence of a
>> good IDE HD mirror solution in pursuit of making an exact clone of HD0 to
>> HD1, I thought I would give "dd" a try. I've seen several postings about
>> the syntax to use and I'm not completely clear about the "bs=0000"
>> parameter to use, if one is used at all. I seen:
>>
>> dd bs=4096k if=/dev/ad0 of=/dev/ad1
>> or...
>> dd if=/dev/ad0 of=/dev/ad1 bs=8192
>>
>> or... that the bs should be set to 2048 for "faster" copy.
>>
>> Questions:
>> 1) Will the above make an exact clone of identical HD0 to HD1..??
>
>Yes.  All of the above will create an identical copy of disk ad0 to ad1,
>copying disk sectors one by one.
>
>> 2) Should the the "bs" be used..??
>
>Changing the bs= parameter makes dd(1) use different 'block size', or
>'buffer' if you prefer this term.  Larger buffers will probably give you
>better throughput and copy the entire disk a bit faster.
>
>> 3) If "bs" should be use, how do I determine which one: 2048, 4096,
8192...??
>
>This I can not answer.  Perhaps some more knowledgable hackers will fill my
>gaps here.
>
>> 4) should bs be used as in #1 or #2 or both okay..??
>>
>> I suspect this can screw up the HD if not careful.... so any expert tips
>> appreciated.
>
>Well, yes and no.  Copying from the wrong disk TO the wrong disk will
>certainly get you in trouble.  Other than that dd(1) can do what you want.
>
>I would try to avoid dd though, since it can cause problems if the disks
>are not identical.  Think about copying the data of a 10 Gb disk to the
>empty area of a 20 Gb disk.  Since dd(1) knows nothing about disk
>geometries and such funky stuff, it will promptly overwrite the MBR of the
>destination disk with the geometry information of the source disk :(
>
>You'll probably find it easier to backup/restore with dump(8) and
>restore(8), or even use pax/cpio/tar to copy the data to the destination
>disk after partitioning, labelling and formatting it properly.
>
>
>Giorgos Keramidas                           FreeBSD Documentation Project
>keramida@{freebsd.org,ceid.upatras.gr}      http://www.FreeBSD.org/docproj/
>
>
>To Unsubscribe: send mail to majordomo@FreeBSD.org
>with "unsubscribe freebsd-questions" in the body of the message
>
>

Best regards,
Jack L. Stone,
Server Admin

===================================================
Sage-American 
http://www.sage-american.com
jacks@sage-american.com

"My center is giving way, my right is in retreat;
....situation excellent! ....I shall attack!"
===================================================

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.5.32.20020210075653.0195ca18>