Network booting linux

For my project I decided from the very start I was not going to install a hard drive.

So, I needed some other way to boot the machine.

Options were:

  1. Network.

  2. USB stick.

  3. Compact Flash card (via a USB card reader).

  4. Compact Flash card (via a IDE based card reader).

I already own the kit to do 2 and 3, and needed to buy a wireless network card that could do 1 (or so I thought) so I discounted 4 on the basis that I didn’t want to spend money needlessly (haha, I wish).

I then discounted option 3 as I needed my card reader for getting photos off my camera.

I finally discounted option 2 as my USB stick is USB 1 and is slooooow.

So, network booting it is.

As previously documented, the wireless network card didn’t support network boot, so I eventually bought a “wireless bridge” that is completely transparent and allows the onboard network card to boot.

Initially I had thought it would be a complete pain to do network booting as I was unable to find instructions that completely matched what I was trying to do (most involved NFS in some way).

Fortunately though, a friend pointed me to instructions on his site that I was able to follow, and combined with instructions on booting Linux from compact flash I was able to muddle through it all.

I initially built my disk image by roughly following the compact flash instructions.

I did this by putting a spare hard disk into the box and installing a stripped down Slackware 10 on it.

This involved a fair level of faffing around as I tried to find a balance between disk space and convenience (could I live without having vim installed, that sort of thing).

I then roughly followed the network booting instructions to get my PC to network boot with my new disk image.

The main difference from the compact flash instructions was to set the final boot system as /dev/ram as the entire OS would run in RAM once it was booted.

The big mistake I managed to make was to set the root image to be so big that it wouldn’t boot (presumably as there was not enough free RAM) – the only symptom was that the OS hung at the point it said “RAMDISK: Compressed image found at block 0”.

It took me a while to figure out that it was too large.

I did some more trimming and ended up with a 274MB disk image that compressed to 78MB.

274MB might seem a lot but it had to include Java and all the libraries for music playback.

After all this faffing I finally had a machine that would boot from the network and run entirely in RAM.

It was worth it in the end.

Leave a Reply

Your email address will not be published. Required fields are marked *