LTSP-HDboot

From eLinux.org

Jump to: navigation, search

Booting LTSP workstations from a hard drive Explanation

Many schools are deploying Linux Terminal Server (aka LTSP) as a way to cut expenses. They are typically using donated workstations that are too old and slow (such as Pentium 200) for today's software, but which work fine in a terminal server environment.

The usual way of booting LTS workstations is either from a boot ROM located on the network card, or from a floppy. There are problems with both of these scenarios.

Boot ROMs cost a small amount of money, which precludes their use in a lot of places these days.

Floppies have their own set of problems. First of all, the boot image on a floppy must conform to the particular NIC in the system, and it is unusual to get a set of donated workstations that all have the same make & model of NIC. So if a couple of boot floppies accidentally get swapped, neither machine will boot. Secondly, floppies wear out and are easily lost or destroyed, meaning that personnel costs will be incurred to make new ones.

Almost every donated workstation that arrives at a school already has a hard drive installed, and putting the boot image on a workstation's hard drive is an ideal solution to the above problems. Unfortunately, no document exists to tell the LTSP installer how to accomplish that. Until now. Items needed

  • One formatted floppy with at least 64k of free space
  • One Tom's Root Boot disk. For instructions on getting and making a Tom's Root Boot disk, see the footnotes at the end of this page.
  • Internet connection
  • Knowledge of how to use the linux fdisk program. If you're not already familiar with it, you might want to have a printed man page handy.

Step one: download the correct boot image for your network card

You will need to know the make and model of your NIC's chipset. You probably already know this, since discovering this information is part of every LTSP install.

  1. Go to http://www.rom-o-matic.net and choose the latest production release. At this writing, that is 5.0.11.
  2. Find your NIC in the "Choose NIC/ROM Type" listbox.
  3. In the "Choose ROM output format" listbox, choose "LILO Bootable ROM (.lzlilo Image)"
  4. Then press the "get ROM" button.
  5. After it is downloaded, copy it to a floppy and take the floppy to the workstation in question.

Step two: fdisk the workstation's hard drive

  1. Boot the workstation with a Tom's Root Boot floppy. When it tells you to remove the floppy, leave it in. You will need it later. Log in as root, just like it tells you to do on the screen.
  2. Run fdisk... fdisk /dev/hda
  3. use fdisk to clear all partitions from the hard drive and put one linux partition in their place. It doesn't matter how big or small this partition is; you'll only be using a tiny amount (less than one cylinder) of it anyway.


Fdisk tips:

  • Type "m" to see a menu
  • "p" will show you all of the partitions that are currently on the drive
  • Then you can use "d" to get rid of them. Get rid of the last partitions first, working your way up to the first one.
  • Use "p" again to make sure all partitions are gone.
  • Then use "n" to create a new partition. Make it the first partition and accept the defaults for anything you don't understand.
  • There are two ways to quit fdisk. One of them leaves the partition table unchanged. Make sure you use the option that SAVES and exits

Step three: put a filesystem on the hard drive and mount it

  1. Make a filesystem on the new partition: mke2fs /dev/hda1
  2. Make a /boot directory in your RAMdisk: mkdir /boot
  3. Mount the hard drive into it: mount /dev/hda1 /boot
  4. Mount the Tom's Root Boot floppy into /mnt: mount /dev/fd0 /mnt

Step four: Copy the needed LILO files to the hard drive

  1. Copy LILO's "boot.b" file to the hard drive: cp /mnt/boot.b /boot
  2. Copy LILO's "map" folder to the hard drive: cp /mnt/boot.b /boot (changed by Ricardo Pinto)
  3. Unmount the Tom's Root Boot floppy: umount /dev/fd0
  4. Take out Tom's Root Boot and put in the floppy with the boot image on it
  5. Mount it: mount /dev/fd0 /mnt
  6. List the files on it: ls /mnt
  7. Copy the boot image file to the hard drive (you will have to supply the actual text for what is represented in italics): cp /mnt/NAME_OF_IMAGE_FILE /boot

Step five: Create the hard drive's boot sector

This is a lengthy command and you must be sure you type all of it in without making any mistakes. Pay close attention to the placement of the spaces and dashes; every one of them is important. You will have to supply the actual text for what is represented in italics:

echo image=/boot/NAME_OF_IMAGE_FILE label=LTSP | /usr/bin/lilo \ -C - -b /dev/hda -i /boot/boot.b -c -m /boot/map

You should get a short message from LILO. At this point you can reboot and the workstation should "just work."

If it doesn't boot, you might try zero-filling the first megabyte or so of the hard disk. Boot with Tom's Root Boot and type in the following command:

dd if=/dev/zero of=/dev/hda count=1000000

and then go back to step two and do everything over. Footnote

To download Tom's Root Boot, go to his web site ( http://www.toms.net ) and pick a mirror. You'll be dropped into an ftp session on the mirror. Some mirrors put the Tom's Root Boot files in a directory with a bunch of other utilities and it can be daunting to figure out which one you want.

You want the one that starts with 'tomsrtbt' and ends with '.tar.gz'. Download it, untar it, and cd into the directory it creates. Then insert a known-good floppy (doesn't have to be formatted, but you might want to format it first just to make sure it's good) and run the shell script

./install.s

and it will create the floppy.

this information is duplicated from the original post by Ken Barber at http://www.peak.org/~mountainman/misc/LTSP-boot.html

Personal tools