[GLLUG] Suggestions on hardware migration?

STeve Andre' andres at msu.edu
Tue Jul 12 15:19:24 EDT 2005


On Tuesday 12 July 2005 13:39, Matt Graham wrote:
> On Tuesday 12 July 2005 12:51, after a long battle with technology,
>
> Lachniet, Mark wrote:
> > I need to upgrade my linux box to faster hardware, and I'm going from
> > one box to a totally different one.  I don't want to reinstall
> > because it takes too much time for the post install tweaks.
> >
> > So what I was thinking is to just do a dd copy (e.g. 'dd if=/dev/hda
> > of=/dev/hdc bs=512') to just move the whole thing over intact
>
> Nope.  For one thing, you never use bs=512 for moving large amounts of
> data.  For another thing, dd is the worst backup method in existence.
> You should hook both disks up to the same machine, cfdisk the new disk,
> mke2fs (or mkreiserfs) the partitions on the new disk, then cp -a each
> filesystem.  That'll take a lot less time than dd will.  Or you can go
> read the Hard-Disk-Upgrade HOWTO on http://tldp.org/ , which covers
> this topic in extreme detail.

Um, dd is the fastest possible way to clone disks, but there are significant
restrictions with it.  In the case of moving an entire system complete with
boot blocks, changing hardware, I would agree that dd isn't the easist way.
But dd can take raw devices and scoop up large quantities of disk, which
really is the fastest way to *clone* a disk.   bs stands for block size, which
should probably be about 32k; not sure what the best bs is for Linux disks,
but bs=512 guarantees slow slow performance.

Doing a 'cp -a' won't keep permissions, unless -a implies something
different on Linux than BSD systems.  I'd at least use  cp -pr  for that.
(Hmm: can't find -a at all on OpenBSD, so perhaps -a implies 'all' ? )

When I want to move all the files from one partition to another I use
tar:

   first cd to the root of the original partition
   then

      tar cf - . | (cd /newdisk ; tar xfp -)

this runs tar from . (current dir) and shovels output to stdout, which is
caught by the second tar, which was first CD'd onto the new disk).  I
do this just infrequently enough that I'm likely forgetting some params
here; sym links and sparse files come to mind as things that likely won't
copy well.

dd on the other hand is the best possible tool to clone two exactly similar
disks.  For that purpose nothing can be faster.

[snip]

STeve Andre'


More information about the linux-user mailing list