[CentOS] Replacing a hard drive

Wed Mar 14 22:29:25 UTC 2007
John R Pierce <pierce at hogranch.com>

John Summerfield wrote:
> John R Pierce wrote:
>>    dump 0f - /mnt/src | (cd /mnt/dst; restore rf - )
>> ...
> And presumably, fairly quickly. I've never used dump/restore, but if 
> it does the obvious and decides which blocks top copy, sorts the list 
> then copies, it should be quickest of all, regardless of the data 
> content.

dump/restore is an exact file by file copy of a filesystem, it 
replicates the directory entries quite exactly including all supported 
attributes..   I probably got in the habit of using it from Solaris, 
which has the rather similar ufsdump/ufsrestore.

another method is

    cd /source; tar clf - . | (cd /dest; tar xvf -)

but not all versions of tar have the -l (--one-file-system) option (gnu 
tar in CentOS does, however).

oh yeah, dump will dump an unmounted filesytem too, so in fact, that 
could have been...

    mount /dev/hda1 /mnt/dst
    cd /mnt/dst
    dump 0f - /dev/hdb1 | restore rf -