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

Re: quickly partition disk, copy an image, install grub

On Tue, Sep 20, 2005 at 09:20:33AM -0400, Matt Price wrote:
> Hi,
> I have to install ubuntu or something similar on about 20 aging
> workstations without cd drives.  THese are donated boxes with small hard
> drives (as small as 2.1 gig, but not all identical) all wiped clean.

Have you looked at System Installation Suite?

apt-cache search systemimager

Basic idea:

* Make a golden master
* Make an install CD that gets clones minimally booted and networked
* Image the machine from the master

Takes care of hostname tweaks etc.

The instructions provide enought detail to make it look complicated, but
when you get down to it, it's really easy.

dd is also an option, be careful about bad sectors etc.  Also presumes
identical disks.

Otherwise, do something like:

* create master.  make note of it's ip/network hostname
* boot clone w/ knoppix cd
* get shell, and 'sudo -s' to be root
* ssh root@master 'sfdisk -d /dev/hda' | sfdisk /dev/hda
* maybe do 'fdisk /dev/hda' and a write (type 'w') to make sure you call ioctl so
  kernel re-reads partition table
* mke2fs as req'd
* mkswap as req'd
* mount /hda/<root partition>
* mount /hda/<other partitions>

so you end up with something like

Then rsync data over:

* rsync -avz --hard-links root@master:/ /mnt/newroot

Then edit /mnt/newroot/etc/ files that make specific mention of hostname
or ip address as req'd.

This is from memory, so I'm sure I skipped or mistyped some crucial step
that will drive you mad.

Oh, like the mbr...

Maybe something like this to copy the boot record:

* ssh root@master 'dd if=/dev/hda bs=512k count=1' | dd of=/dev/hda

Ron Peterson
Network & Systems Manager
Mount Holyoke College

Reply to: