[wplug] dd

Eric C. Cooper ecc at cmu.edu
Tue Feb 15 08:42:58 EST 2005


On Tue, Feb 15, 2005 at 12:38:53AM -0500, Brandon Kuczenski wrote:
> I bought another 80 GB drive to replace it, but it's not exactly the same 
> model (a Seagate "U-series" 80gb, 5400 rpm hard disc is being replaced by 
> a Seagate "Barracuda" 80gb, 7200 rpm hard disc).  I would like to:
> 
>  - boot into single-user mode with both drives installed
>  - not mount the drives in question
>  - not format or label the new, replacement drive
>  - run 'dd id=/dev/hdb od=/dev/hdc -possibly -other -arguments'
>  - switch the drives and reboot into happiness.
> 
>  (1) Does this seem like a proper and successful use of 'dd'?  And (2) is 
> the answer to that question OS-dependent (neglecting the device names and 
> arguments), or only POSIX dependent?

The only times I've needed dd are when copying things like boot blocks
to and from floppies or CD images.   For disks with UNIX filesystems
on them, it's almost never necessary or desirable.

Instead, partition your new disk as needed, and use mkfs to create the
desired filesystems.  Then copy just the files.  I usually use "cp
-a".  Others recommend tar or cpio.  All of these copy the files, not
the filesystem data structures -- it's usually faster (since you're
not copying all the stuff that refers to unallocated blocks), and
you'll probably end up with a more efficient layout on your new disk.

BTW, this kind of thing is a good use for a Live/Rescue CD, so you can
access both source and destination disks without worrying about
activity on them.

-- 
Eric C. Cooper          e c c @ c m u . e d u


More information about the wplug mailing list