Remote Installation Process | ||||||||||
|
Phase I. Booting the new image on a Debian machine using a mini Linux. The first step in overwriting all the old partitions with the new OS partitions is to utilize the swap partition by turning off swapping and dd'ing a mini linux image onto the old swap partition. Once the image is in place, boot to the swap partition and use the mini linux to grab the new images from a fileserver. The partition sizes of the imitation Surveyor node (in that it runs Debian as opposed to BSDI) were a very close approximation to those of a real Surveyor machine. In retrospect, the old partitions could have been overwritten and then the new partitions could be an arbitrary size (to some extent--the old /dev/hda1 was only 14 MB and /dev/hda2 is the swap so fitting anything into /dev/hda1 is nearly impossible in our setup), but at the time, the different groups worked with this limitation. The first miniature linux I attempted to use was tomsrtbt-2.0.103. After several attempts at getting it to boot off the hard drive, I went back to the FAQ pages to find that using tomsrtbt on a hard drive is not recommended. (However, after having used it to some extent, I give it my thumbs up!) The second mini linux was Small Linux. There is a very good website listing the steps that should be taken for a installation on the hard drive (http://www.houseofcraig.net/sm_linux_howto.html). I followed the preparation section exactly and I've copied installation section, making modifications where needed. The major change made was to use the swap region as installation for the small linux rather than the root : Step 1. Installing Small Linux on the swap partition with disks:
Step 2.v1 Installing Small Linux on the swap partition without disks:
Step 2.v3 Installing Small Linux on the swap partition without disks: 1. Same as above. 2. 'mkfs.ext2 /dev/hda2' 3-9. Same as above. Step 2.v4 Installing Small Linux on the swap partition without disks: 1. Same as above. 2. 'mke2fs /dev/hda2' 3-9. Same as above. Step 2.v5 Installing Small Linux on the swap partition without disks: 1. Same as above. 2. Tried copying the mkfs.ext2 from the disk, replacing /sbin/mkfs.ext2, but it complained. So performed steps 1-5 from our initial trail. This version of mkfs.ext2 is 'mke2fs 1.10, 24-Apr 97 for EXT2 FS 0.5b, 95/08/09' 3-9. Same as above. Since these Small Linux and tomsrtbt did not work out so well a third option was explored: running a minimal install of debian. This option is viable since the swap partition is approximately 130 MB. Step 1v2. Installing Debian on the swap partition with disks:
Step 2.v1 Installing "Small" Debian on the swap partition without disks: On the imitation Surveyor machine:     % swapoff -a     % mkfs.ext2 /dev/hda2 From the fileserver:     % dd if=/path_to_the_image /smalldebian.gz | gunzip | ssh ip/name_of_imitation_machine dd of=/dev/hda2 Back on the imitation Surveyor machine:     % mount /dev/hda2 /smallDebian Run e2fsck to get rid of the error otherwise you won't be able to boot SmallDebian. Update lilo on the original install: #comment out the original root line #I also like to increase the delay just in case I'm not paying attention for 2 seconds (ie, the default setting) image=/vmlinuz          root=/dev/hda1 # you want root lines here          name=Linux          read-only image=/smalldebian/vmlinuz          root=/dev/hda2 # and here          name=SmallDebian          read-only run lilo reboot boot SmallDebian This last attempt of using a minimal installation of Debian worked. The first attempts at installing the Debian partition did not go well. As I understand it, the attempt at dd'ing the image from the fileserver on to the Debian machine with partition sizes similar to Surveyor nodes did not work since the initial root partition of the real image from the group working on the new image was much larger than the Surveyor nodes. What was attempted was writing (dd'ing) a root partition over 200 MB to a partition approximately 14 MB. Not only did it fill up /dev/hda1, but it started overwriting SmallDebian on /dev/hda2 so that SmallDebian would not boot either. fsck's on SmallDebian's bootup sequence did not resurrect it. So I did a reinstall of Debian for a setup similar to the Surveyor node and then put the SmallDebian image back on the swap partition. The initial suggestion was problems with /proc being too large so that's what I started investigating. First off, 200+ MB is not a good size for dd'ing images (smaller is better, right?). The second issue to deal with is the differences in partitioning measurements between Debian and BSDI. So I spent a considerable amount of time reinstalling Debian trying to get the smallest size partition possible (/usr and /var partitions were also created in order to minimize the amount of data written in /). While the final image may be as little as 14+MB (12+MB if the security patches aren't installed), Debian will give bootstrap errors or say there it is not able to install the necessary packages (and stop the install after 5 attempts). This being the case, the smallest partition I was able to use was 32+ (4 cylinders). Since SmallDebian is our "LEM" (using Apollo 13 lingo) and after booting to it, I deleted /dev/hda1 and tried to make it larger. Two unsuccessful attempts later (and yet more complete reinstalls) I've determined playing with /dev/hda1 is not a good idea. It messes with /dev/hda2, which houses SmallDebian. Looking at the sizes of the partitions on the Surveyor nodes, I believe it would be possible to cut our losses on using /dev/hda1 and repartition one of the larger partitions. I created a new primary partition on /dev/hda4 of debian (32 MB) and dd'd the new root partition I just installed on the build machine which was the replacement root partition for the new image. I mounted the new root on SmallDebian, dd'd and mounted the other partitions on to their respective mount points of the new Debian image. After updating lilo on SmallDebian, and fstab on the new Debian image, I rebooted and the new image came up!!! Command line directions: fdisk, erasing a large partition and making a primary partition out of /dev/hda4, and putting the old partition back (slightly downsized) mkfs.ext2 /dev/hda4 mkfs.ext2 all the other partitions too (if this were BSDI) From diwali: dd if=/data/compressed/newRoot.gz | gunzip | ssh 10.2.23.136 dd of=/dev/hda4 Back on SmallDebian: mount /dev/hda4 /newRoot mount /dev/hda5 /newRoot/usr mount /dev/hda6 /newRoot/var mount /dev/hda7 /newRoot/local mount /dev/hda8 /newRoot/data sftp to diwali and get the tar.gz files and place them in their respective partitions, unzipping them afterwards Update lilo on SmallDebian: image=/vmlinuz          root=/dev/hda2          name=SmallDebian          read-only image=/newRoot/vmlinuz          root=/dev/hda4          name=Surveyor          read-only Run lilo. Update /newRoot/etc/fstab so that the correct partitions are mounted on bootup. Restart and you should get a lovely screen that asks you to log in to your new image! |