Jan 292012
 

SystemRescueCD is very useful to have on hand for those issues that come up at the worst times. Instead of having to dig for that USB key or CD that SystemRescueCD is on, I’ve setup my PXE server with SystemRescueCD to save time on having to find where I’ve put the CD. It also means that when SystemRescueCD is updated, all I need to do is update the files on my PXE server instead of having to burn a new CD or install it again on a USB key which means less clutter for me which is always good.

The only downside to booting over the network is the time it takes to boot if you’re still on good ol’ 100 megabit “Fast” Ethernet as SystemRescueCD weights in at just over 300 megabytes, which also means the system that you’re network booting on must have at least 512 megabytes of ram in order to network boot SystemRescueCD as all the data is stored in RAM when you networkboot.

Anyways, onto the nitty grittys.


Step 1 – Getting the SystemRescueCD files

We need the ISO file that contains the files we will need to PXE boot SystemRescueCD which can be downloaded from here.
Once we have the ISO file, we need 4 files off the ISO file, which are –

  • initram.igz – this is the initial ramdisk that SystemRescueCD uses to boot
  • rescuecd – This is the kernel that SystemRescueCD uses, however there are other options that can be used.
  • sysrcd.dat – This contains the squash file system that becomes the root filesystem for SystemRescueCD
  • sysrcd.md5 – This is the signature file for SystemRescueCD, and isn’t actually needed, but good idea to have.

Once we have these 4 files, we need to place them onto our PXE server. I have used the directory /tftpboot/srcd for my files on the server.

Step 2 – Configuring the PXE Server

We will need to edit the file that contains the configuration for the PXE server. If you have been following my PXE Server guide then the file is called default in the pxelinux.cfg directory.
Using your favourite text editor, add the following lines to the configuration file –

LABEL SRCD
MENU LABEL SystemRescueCD 2.4.1
kernel srcd/rescuecd
append initrd=srcd/initram.igz netboot=tftp://10.1.1.1/srcd/sysrcd.dat

The last two lines will need customisation to your setup if you use a different kernel, or the IP address of your PXE server is different, as will the path for the kernel, initram and netboot parameters.

Once the configuration file is updated, you should now be able to boot SystemRescueCD over the network with little difficulty, however if the network has some issues you may find it will take a little while as the TFTP protocol sends data over UDP which does not support resending corrupted data.

Share
Jun 132011
 

Hi All,

I’ve recently been playing around with some small distributions so I can setup a tiny webcam server – no luck there yet, but I thought I’d post up how to boot Puppy over PXE as I tried that out while messing around.

Step 1 – Getting Puppy

So first thing we need to do, is to get Puppy Linux from here

wget http://distro.ibiblio.org/pub/linux/distributions/puppylinux/puppy-5.2.5/lupu-525.iso

Wget is my weapon of choice here, so the above command will download the ISO file into the current directory. I am logged in as root to set everything up so it has downloaded the iso to /root/.

After we get the ISO file, we need to extract a few files from the ISO so we can use them to boot over PXE.

mount -o loop lupu-525.iso /mnt

With the above command, we mount the ISO from the current directory onto /mnt so we can copy the files off the ISO.
Once it is mounted, we will need 3 files off the ISO:
initrd.gz
vmlinuz
lupu_525.sfs

mkdir /tftpboot/puppy/
cp /mnt/initrd.gz /tftpboot/puppy/
cp /mnt/vmlinuz /tftpboot/puppy/
cp /mnt/lupu_525.sfs /tftpboot/puppy/

With those commands, we create a directory to store the files in, and copy them over.

Step 2 – Setting it up

We will need to pack lupu_525.sfs into the initrd image for this to work as the livecd expects it to be somewhere on the boot media but we don’t have any boot media as we are booting over the network.

So what we do is make a folder so we can modify the initrd –

mkdir /tftpboot/puppy/temp

Change to that directory

cd /tftpboot/puppy/temp

Then we will extract the contents of the initrd.

zcat /tftpboot/puppy/initrd.gz | cpio -i -H newc -d

Now the contents of the initrd are in /tftpboot/puppy/temp
We’ll move the lupu_525.sfs file into the temp folder –

mv /tftpboot/puppy/lupu_525.sfs /tftpboot/puppy/temp

Then we’ll repack it up into a new initrd.gz file by running this command while inside the temp directory –

find | cpio -o -H newc | gzip -4 > ../newinitrd.gz

Now we have our new initrd.gz file, we can setup the pxelinux config file with a new menu item.

Step 3 – Setting up pxelinux.cfg

So now we will need to add the following codeblock to /tftpboot/pxelinux.cfg/default


LABEL Puppylinux
MENU LABEL Puppy Linux 5.2.5
kernel puppy/vmlinuz
append initrd=puppy/newinitrd.gz

Notice we have used the name of the newinitrd.gz file as that is the one we will need to boot from in order for Puppylinux to get the lupu_525.sfs file.

Once you have updated the configuration file, you are now ready to boot Puppy Linux 5.2.5 !

Share
Jun 082011
 

A continuation of this post.

You can also create machine specific configuration files by naming the file the same as the mac address but replacing the colons ( : ) with dashes ( – ) and adding a 01 to the front to signify that this is an ethernet address..
So 00:15:af:69:31:79 becomes 01-00-15-af-69-31-79.

This is also the “BOOTIF” that you see on the previous screenshot.

Share
May 262011
 

Hi All,

Recently I decided to update my Lenovo laptop’s BIOS, but I didn’t have any blank CDs to burn the update iso onto.
Now that I have my PXE server running though, I can boot the ISO over PXE !

So first step was to grab the ISO file from the Lenovo website.
Once you have the ISO file, you will need to copy it to your /tftpboot/ directory, and depending on your style, a subdirectory. I have my ISO file in a subdirectory called lenovo, so the full path would be /tftpboot/lenovo.

Next up is to modify the pxelinux.cfg/default file to add the lines you will need for the ISO file.
Now you will need the memdisk kernel before you add these lines.
If you haven’t already found it, it can be found in the /usr/lib/syslinux/ directory.
I have put memdisk into the boot subdirectory for this exercise, and then added the following block to my default file.


label LenovoBios
menu label Lenovo BIOS 66ET60WW
kernel boot/memdisk
append initrd=lenovo/66et60ww.iso iso

You’ll have to replace the ISO file name with the file that you downloaded, but you should be able to boot off that and update the BIOS that way as I’ve managed to do it with my Lenovo 3000 N200 laptop.

Share
May 192011
 

Hi All,

I’m in the process of setting up PXE for some computers of mine, but I wanted them to have a separate configuration file as they do not have the power to run some of the other options, so I don’t want them to show up. I didn’t want to define specific IP addresses for the computers either or use IP specific configuration files as IP address may change.

So, what I did is to make a configuration file with the SYSUUID as the filename, since the SYSUUID is based off the mac address of the computer.
Then when it loads, the computer will boot off the SYSUUID configuration file instead of the default one.
You can find the SYSUUID on the boot page when a computer is booting from the network.

The SYSUUID is outlined in red, and quite long, but if a file is named that then the computer will boot off it, as that one is currently doing.

Share