Using dd to Make a Clone of a Drive

Giorgos Keramidas keramida at ceid.upatras.gr
Tue Feb 14 06:06:52 PST 2006


On 2006-02-14 07:47, Kevin Kinsey <kdk at daleco.biz> wrote:
>Kevin Kinsey wrote:
>>Giorgos Keramidas wrote:
>>> Bah!  That's too slow for my taste.  I would usually go for a newfs,
>>> dump, and restore option.  For instance, to create a copy of /usr on a
>>> second disk:
>>>
>>>    newfs -U /dev/ad1s1a
>>>    mount /dev/ad1s1a /mnt
>>>    dump -0 -a -L /usr | ( cd /mnt ; restore ruvf - )
>>>
>>> Copying with dd(1) is not as fast :)
>>
>> Sorry to butt in --- but I'm needing to start cloning too.  Looks
>> like a winner to me ... wouldn't this have the added advantage
>> of making "same size and geometry" (cf. Erik Trulsson, 4 hours ago,
>> this thread) less relevant?
>>
>> As long as the "new" slice had enough space, geometry shouldn't
>> matter to dump|restore ....  <?>
>
> Just for the archives:
>
> Giorgios' solution is very nice, but needs the "-f" option and another
> "-" to work properly AFAICT, both from experience and from reading
> dump(8):
>
>          dump -0 -a -L -f - /usr | (cd /mnt ; restore ruvf - )
>
> If you don't include "-f" (for "file") and "-" (for "stdout"), then your
> command will fail with:
>
>          DUMP: Cannot open output "/dev/sa0"

Oops!  Yes, good catch :)



More information about the freebsd-questions mailing list