[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cloning machine

On Thu, 23 Dec 1999, Harley Pebley wrote:

> I have a Debian based machine I need to clone; actually I have 32 so I don't
> want go through the install that many times for identical configurations.
> I figured it should be pretty easy using dd but I'm running into some
> problems I need help with.
> I put a blank IDE drive as primary slave in the machine to clone and did:
>     dd if=hda of=hdb
> After about 90 minutes of disk activity it finally finished. I could mount
> hdb2 and browse around. Everything looked OK. So I put the just copied disk
> in the new machine as primary master. The BIOS saw the disk but gave some
> hex numbers and refused to boot. LILO never seemed to start; I assume the
> numbers are from the BIOS. I removed the jumper to make the disk primary
> slave and tried booting. This time Linux started to boot but gave a kernel
> panic trying to mount /. Apparently the boot sequence expects hda (which
> makes sense) but configured as slave the disk is hdb and so the partition
> wasn't found. I  can use the emergency boot disk to boot and it finds and
> mounts the partitions just fine when setup as master. I've tried /sbin/lilo
> when booted from the floppy but that doesn't help.

There are two issues here.  The kernel, and lilo.  Lilo recognises disks
via their BIOS identification codes. The kernel 'counts disks' in a
predictable order.  If you want a perfect image to boot properly, then the
'role' that your source disk plays (i.e. which IDE channel, master/slave,
which linux hd? code) must be identical to the role that the destination
disk will play when it is installed in the new machine.  How the
destination disk shows up on the source machine shouldn't matter.

Even if it doesn't work, making sure lilo.config and fstab are correct and
re-running lilo whilst booted from floppy should certainly work.  Don't
know what went wrong there.

> Any ideas on:
> 1) how to make the copy I have now work?

Boot from floppy, check lilo.conf and fstab, rerun lilo, reboot.  Oh, and
make ure the BIOS is set right.  Many BIOSes can only boot from masters on
IDE channels.

> 2) a process other than dd that may be faster?

If your disk is more or less full, then dd should be the fastest.  To
improve speed, use a dual-channel IDE machine for mstering the disks, and
plug source and destination onto different channels.

Of course, the dd approach probably only works if you have *identical*
disks on all machines.  If you're willing to play with fire, then it would
be enough to only have at least one identically sized partition (and be
careful not to hex the partition map when you dd).

One other approach is to build a custom boot-floppies which does the
install *you* want.  Typically this would involve hardwiring some NFS
paths, creating yourself a (large) custom base_2.2.tgz with exactly the
files you want on, possibly completely disabling dbootstrap (the installer
program) and changing 'unconfigured.sh' (the last-minute configurer run on
first boot) to do whatever is appropriate to you (which probably won't be
running dselect, which is what it normally does).

Finally, there's the Fully Automatic Installation package, announced on
this list a few days ago.  I haven't investigated it, but it sounded neat.


|  Jelibean aka  | jules@jellybean.co.uk         |  6 Evelyn Rd	       |
|  Jules aka     | jules@debian.org              |  Richmond, Surrey   |
|  Julian Bean   | jmlb2@hermes.cam.ac.uk        |  TW9 2TF *UK*       |
|  War doesn't demonstrate who's right... just who's left.             |
|  When privacy is outlawed... only the outlaws have privacy.          |

Reply to: