I'm copying a Linux system from one hard drive to another; this is a limited
demo run of mass-produced systems. (For real production we are using
hardware duplication and it's someone else's problem). I'd like some
comments on my procedure, because there are some real weird things
I start with a known-good bootable hard drive containing my Linux install
configured as I like it. I put it in a PC on the secondary controller, and
put in a different bootable Linux drive on the primary controller. I mount
the source drive with "mount /dev/hdc1 /mnt".
I tar the contents of the drive to be cloned with "cd /mnt ; tar cvf
I take out the source drive, I move the "other" drive (that contains the
tarfile) to the secondary controller and I put in a blank drive on the
I then boot off a floppy with the commandline "linux single root=/dev/hdc1".
I use fdisk to create partitions and mke2fs to format them.
I mount the new drive's root partition and extract the tar archive ("mount
/dev/hda1 /mnt ; tar xvf /newdrive.tar").
I reboot from the floppy again, this time with "linux single
I run lilo to put the bootloader in the MBR of the target drive.
First odd thing:
When I am untarring my file, as soon as tar reaches usr/bin/sendmail (or
something in usr anyway) the system goes weird; init restarts runlevel 3
(seems like it just runs rc3.d again). There is a message from pam_unix but
I can't see it; it's too quick. This same error sometimes appears when I'm
trying to create the tar file, too. Always somewhere in the /usr directory.
This one is really bizarre.
Second odd thing:
The commands "mount -n -o remount,rw /dev/hda1 /" and "mount -f /" in
rc.sysinit fail on the cloned drive ("mount: no such partition defined"). If
I add "/dev/hda1 " before the "/" then they work OK. It's like the label in
/etc/fstab is no longer recognized. Why is it so???
Third odd thing:
I have two identical drives - IBM DLGA-23080. Both of them are detected in
BIOS with their "real" geometry of 5968,16,63. But one of them is reported
by fdisk as having the translation 746,128,63 whereas the other comes up
with its "real" geometry.
=== Lewin A.R.W. Edwards
Responsibly disposing of dangerous liqueur chocolates
and surplus peppermints since 1974.