Wednesday, June 10, 2009

Knoppix via PXE

On the heels of my recent semi-success with getting DSL to work via PXE. I mean it works... I just cant get it to recognize the hard drives, so it's basically useless to me. Anyways.

I was able to get knoppix to boot through my PXE and it recognizes the hard drives, which is the most important thing when you want to do hard drive recovery :)

I had to piece together a few "how-to's" to get it to work for me but here is a rough outline and I'm not good at taking notes and I'm not really sure what worked.. I just know it works.

Things you'll need that aren't covered here:
Working PXE/TFTPBOOT service
Working NFS service

From this guys directions I followed STEP 1 and set up a terminal service while running a knoppix live CD on one workstation:

Step One: Generating the needed files

Knoppix has the built-in ability to auto-configure itself to network boot itself, and this makes the process rather easy. In the "KNOPPIX" submenu, select the "Start Terminal Server" option.

IMPORTANT NOTE! By doing this, it will start up dhcp, and many other services! Running two DHCP servers on the same subnet is generally a very bad idea!

When prompted, select the menu item to configure the terminal server, and run through that.

1. If at all possible, start the terminal service on a different NIC. This will prevent a LOT of possible mayhem. If you only have a single NIC, then before you click the final "OK" button, be sure to unplug your ethernet cable.

2. For the IPs, just a low number of IPs (must be specified as "") is fine. You cannot enter a single IP, and the range is inclusive of what you input.

3. Be sure to select all needed kernel modules on the slaves!

4. Be sure NOT to check the NX thin client button! The other software does not matter, however, if you check the secure box, by default your clients will not be able to access the root user. (Note: The "secure" option is easily changable later on.)

5. Specify any needed kernel paramaters for your slaves. If you don't need any, do as the box says and just click ok.

5b. If you only have one NIC in the computer running knoppix, and an existing DHCP server on the network, unplug the knoppix computer now.

6. Click the final ok, all done.

6b. If you unplugged your ethernet cable, be sure to stop the DHCP server on knoppix before plugging it back in.


Before I started I issued a "ifconfig eth0 down" to ensure I wasn't setting up a DHCP server on a network that already has a DHCP server.

Once I was done I copied vmlinuz and miniroot.gz to the /tftpboot/knoppix directory in my PXE server. I also copied the pxelinux.cfg/default file to get the labels to add to my current pxelinux.cfg/default file

For my working NFS service I added this line to my /etc/exports:


in /path/to/share I copied over the KNOPPIX directory from knoppix live CD

For my pxelinux.cfg/default I added these lines:

LABEL knoppix
KERNEL knoppix/vmlinuz
APPEND secure nodhcp nodma noudev 2 lang=us ramdisk_size=100000 init=/etc/init apm=power-off nomce vga=791 initrd=knoppix/miniroot.gz quiet BOOT_IMAGE=knoppix

I had to add nodma and noudev because when I booted it locked up looking for hardware. Edit these "cheatcodes" as needed.

Booted up using Network boot and typed: knoppix

And it booted up to a "live" knoppix!

Tuesday, June 09, 2009

Using Damn Small Linux via PXE

I've recently been trying to configure my PXE server to have a live CentOS option and have been unable to add this to my existing PXE server. But I have added a Damn Small Linux option that seems to work well, except I cant get it to recognize SCSI disks. Recent release notes suggest that SCSI support was removed in DSL 4.3, so I downloaded DSL 4.2 and still could not get the drives to get recognized. I see the SCSI modules when I do a modprobe -l so maybe its just a matter of time before I insert the right module to get it working. If any one has any ideas as how to get SCSI drives working in DSL please let me know. The primary reason I want a "live" linux on my PXE server is for file recovery across the network. So this is a huge roadblock for me.

Anyways. To get DSL on your existing PXE server:

Download DSL: Im using dsl-4.4.10-initrd.iso and dsl-4.2-initrd.iso(for scsi)

Extract the iso:

mount -t iso9660 -o loop dsl-4.4.10-initrd.iso /iso

copy these to files to /tftpboot/dsl #create dsl directory first

cp /iso/boot/isolinux/linux24 /iso/boot/isolinux/minirt24.gz /tftpboot/dsl

add this line into your /tftpboot/pxelinux.cfg/default

KERNEL dsl/linux24
APPEND ramdisk_size=100000 init=/etc/init lang=us vga=791 initrd=dsl/minirt24.gz quiet

you can add cheatcodes on the APPEND line as needed. Cheatcodes are located in the /iso/boot/isolinux directory as f2 f3