[wplug] dd

Jonathan S. Billings billings at negate.org
Tue Feb 15 10:55:39 EST 2005


On Feb 15, 2005, at 12:38 AM, Brandon Kuczenski wrote:
>
>  - 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?

This should work as long as you have it continue with error.   However, 
the drives are made from two different manufacturers, the geometry will 
be different and so the resulting new disk will probably look strange 
to any partition editors, if you later try to change it.  Don't be 
surprised if you see these errors.

In your situation, I'd probably use 'fdisk' to create the partitions on 
the new disk, use mkfs to create the filesystems, and dump and restore 
to copy the contents of the filesystems to the new disk.  If anything, 
it'll probably be faster, since dd copies every block on the disk, 
regardless of whether there's any data allocated to that block.  Also, 
the dump/restore would not bring over any bad filesystem problems.  You 
might lose data where the filesystem was damaged, but you can be fairly 
certain that the problem won't be carried over.

--

Jonathan S. Billings <billings at negate.org>



More information about the wplug mailing list