On Mon, 3 Jan 2005 15:30:34 -0600, Shawn Fertch <sfertch at gmail.com> wrote:
> I have a server that I need to replace the OS drive in.  My thoughts
> were to do the following to replace it:
> 
> -Connect replacement drive to system.
> -Boot to a live cd such as Knoppix
> -Use dd to moves files from old drive to new using syntax similar to:
> 
> dd if=/dev/hda of=/dev/hdb
> 
> Seems fairly straightforward.  However, the questions I have are:
> 
> -Will dd copy over the partition information as well, or should I
> create the partions by hand and then use dd on each partition such as:
>  dd if=/dev/hda1 of=/dev/hdb1

As specified, yes, it will copy partition information over, including
the read-only / partition. I would do as you state here, partition by
partition, and create/format partitions on the new drive first.

I might even take it a step further and just use cp (with appropriate
flags to preserve attributes, permissions, f/m/atimes, etc.) . It
wouldn't take that much longer.

> -Do I need to specify any block sizes or error correcting?

I've never had to specify block sizes for it to work. I usually will
say 2k or 512b though, as I usually use dd to pull backup/forensic
images of drives, and there's a bit of funkiness with how dd deals
with a drive where the selected bs is not a divisor (evenly divides)
of the drive capacity

> The cause for replacing the drive is that the root ( / ) partition has
> marked itself as read-only.  Doing fsck's and rebooting is no longer
> correcting the issue.  In doing a dd from one drive to the other, is
> there a chance that whatever is marking the partition read-only will
> be brought over as well?

I think dd would carry that over for sure. Of course, that depends on
how/why it's being marked read-only. Not that stating the obvious
helps out at all...

> Anything else that I seem to be overlooking?

Seems logical to me...

Good luck.

_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
Help beta test TCLUG's potential new home: http://plone.mn-linux.org
Got pictures for TCLUG? Beta test http://plone.mn-linux.org/gallery
tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list