[CentOS] Mirroring Hard Drive

Les Mikesell lesmikesell at gmail.com
Sun Dec 7 22:04:16 UTC 2008

William L. Maltby wrote:
> On Sun, 2008-12-07 at 12:36 -0800, John R Pierce wrote:
>> Matt wrote:
>>>>> I have a 500GB Sata drive about 15% used I would like to make an exact
>>>>> copy of too another Sata 500GB drive as a spare.  That way if
>>>>> <snip>
>> no, as dd is a raw block copy of the storage device.   i dont actually 
>> recommend usinig DD on file systems at all
>> instead, assuming the raid is freshly formatted, and temporarily mounted 
>> as /mnt I would use something like...
>>     dump 0vf - /dev/sda1 | (cd /mnt; restore -rf - )
>> if there's more than one file system on the source, repeat this for each 
>> one.   note that the source file systems must be unmounted when you do 
>> this, hence you would need to do this from a CD boot if its the system 
>> drive.
> I've always wondered why so many folks use the above construct when a
> _fast_ less "expensive" solution STM to be something like
> cd <your source mount point> ; find . <other params you desire> \
>    | cpio -p<other params you want> /mnt
> Am I missing something? Just old fashioned? Cpio has all the params you
> want and can be _very_ fast with the righ parameters. Similar to the
> above dump/restore set I've seen many use tar/untar equivalents.

Or, on everything that has gnu cp (which would be at least every linux 
distro), 'cp -a . /mnt' should work.   However, I usually use rsync 
since you can stop and restart keeping the completed work or repeat to 
get updates, and it works the same over ssh if the drive in question is 
on a different machine.

   Les Mikesell
    lesmikesell at gmail.com

More information about the CentOS mailing list