Urgent: Copy hda to hdb with dd?

der.hans plug-discuss@lists.plug.phoenix.az.us
Sat, 23 Mar 2002 15:52:13 -0700 (MST)


Am 23. Mar, 2002 schwätzte alandd@mindspring.com so:

> I have a master IDE drive all setup how I want.  I want to copy the image
> of this drive, hda, to the slave drive, hdb.  In the end, I want both
> drives to be exactly the same, boot record and all.
>
> If I boot from the CD drive with LNX-BBC (Linux bootable business card)
> can I just issue the command
>
> dd if=/dev/hda of=/dev/hdb
>
> and accomplish this?

Not sure that would work.

Use sfdisk to list the partitions on the master and then write those same
partitions to the clone. After that you could dd each of the partitions.

Not sure that'll work either, but I would think it should.

If they don't have to be 'exactly' the same, but have the same content,
then, part with sfdisk and then use tar or cpio to copy stuff. tar with
'--atime-preserve' on the expand will keep time/date stamps on directories
as well as files.

For the boot sector look at lilo's stuff about remapping hda to hdb. -b? I
think it was something else I was using. The other option would be to use dd
to grab the first 512 bytes of the master and copy them onto the slave.

Also search freshmeat. There are several utils that others have written for
ghosting/copying drives.

Anybody know if you can checksum a partition and get useful results? e.g. 'sum -r /dev/hda1'

ciao,

der.hans
-- 
#  http://home.pages.de/~lufthans/   http://www.<ThisSpaceAvailable>.com/
#  I chose to use the kernel sources as my documentation.  ;-)
#  -- Kevin Buettner