cloning a boot partition

Rick Stevens rstevens at vitalstream.com
Thu Jun 16 19:54:05 UTC 2005


Mark Knecht wrote:
> Hi,
>    What tools do people find most simple/fast/fool-proof for cloning a
> drive, and expecially cloning a boot partition? I've got a small
> system with an 8GB drive but only about 2.5GB on the system. There is
> a boot partition, swap and root. I'd like to clone this drive three
> times to larger 80GB drives.

Do you mean make three copies on the 80GB drive?  That could suck up a
lot of your partitions.

>    I can boot the system with a LiveCD or the FC2 CD in resuce mode
> which should make the existing drive just storage and copyable. It
> would be perfect if the clone did NOT use the additional drive space
> since I'd like to make this a new partition on the new machines.

If you're doing the three copies on one drive, I'd set it up with one
boot partition (make it a primary, e.g. hda1), one swap (could be in an
extended partition, e.g. hda5) and three root partitions (also could be 
in the extended partition, e.g. hda6, hda7 and hda8).  Use fdisk to set
those up, then use "cp -a" to copy the root stuff over to the three new
root partitions.  You can't use "dd" as that would do a block-for-block
copy and your geometries aren't even close to the same.  You'd then need
to edit the /boot/grub/grub.conf file to set the "root=" bits on the
kernel lines to point at the right places.

NOTE:  DO NOT RELY ON FILESYSTEM LABELS in grub.conf or any of the
/etc/fstab files--use the device names.  Failure to do so will probably
cause you much grief and may lead to suicidal feelings.  :-D
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-   Whoever said "Money can't buy friends" obviously never brought   -
-                        donuts to the office.                       -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list