I had wanted to be able to network boot diagnostic tools such as Drive Fitness Test, Memtest and BartPE/WinPE for quite a while; I had figured that as a small computer repair business owner it would simplify things and reduce the amount of physical media I needed. And when a new version of a tool comes out, it could just dropped directly onto the network boot server. I also hoped to be able to boot a BartPE ISO into RAM, meaning that the ISO could be modified at any time and also the PE image would run much faster from RAM than a CD. Finally, since most recent computers support network boot (many need it enabled in the BIOS, but most support it), there shouldn’t be many systems that can’t be used with this setup.

First of all, this is by no means the simplest tutorial you will find here; in fact it may be on of the most advanced. It’s also very dependent on your hardware configuration, adding to the complexity. But if you’re an advanced enough user to be looking to do something like this, hopefully you can adapt this tutorial to your needs.

Lets get started! We will be booting the images using PXE and TFTP. You will need the following:

  • A server running Ubuntu Server edition 9.04 (or newer presumably). This can work on Windows too, using a program called Tftp32, but I’m not going to explain how. Everything is the same in this tutorial up until the step where the TFTP server is configured.
  • A Windows computer to setup the files initially. I suppose you could use Linux, but this tutorial focuses on Windows for the preparation portion.
  • Gigabit Ethernet is very useful for pushing BartPE/WinPE images across the network, but for simple diagnostic tools 100MB Ethernet is fine.
  • The PXEBOOT package: Download
  • A DHCP server that supports PXE booting. The easiest is dnsmasq, such as a DD-WRT flashed router – it needs one line in the configuration file to work.
  • Copies of your diagnostic tools in IMG/IMA/IGZ format. This can be made by creating a floppy disc of them and then using a floppy image creator tool to make an image file. You sometimes can get ahold of them by downloading the floppy image file. Also, some diagnostic tools that offer an ISO CD image contain the floppy image and a copy of memdisk to run it. You can just take the image file out of the ISO image.

Gathering the required files

*** NEW! I HAVE PUT ALL OF THE REQUIRED FILES TOGETHER INTO ONE DOWNLOAD. CLICK HERE TO DOWNLOAD ***

1. First of all, we’ll get the files you need. Create a folder on your PC called tftpboot. We will upload this to the server later on.

2. Download the PXEBOOT package and extract the following files to the tftpboot folder. All of these files will be in one folder, there will no longer be subdirectories:

  • com32\menu\menu.c32
  • core\pxelinux.0
  • memdisk\memdisk

3. Place any images you want to boot into the tftpboot folder as well (skip BartPE for now if you plan on adding that as well, we’ll add it later on).

4. Create a subdirectory called ‘pxelinux.cfg’ and a file called ‘default’ in there (with no extension)

Creating the Boot Menu

1. Open up the file ‘pxelinux.cfg/default‘ using Notepad or your favorite text editor. The structure of this file is very simple and easy to edit. The example below will create a menu titled “Diagnostic Tools” and have the options to boot Drive Fitness Test, Memtest, Darik’s Boot And Nuke and BartPE (which we will add to the tftpboot folder later on). The ‘^’ symbol goes before the shortcut letter you would like to use. For example, pressing the ‘M’ key will start Memtest86

DEFAULT menu.c32
TIMEOUT 300
ALLOWOPTIONS 0
PROMPT 0

MENU TITLE Diagnostic Tools

LABEL Memtest
MENU LABEL ^Memtest86
kernel memdisk
append initrd=memtest.img

LABEL DFT
MENU LABEL ^Drive Fitness Test
kernel memdisk
append initrd=dft.img

LABEL BARTPE
MENU LABEL ^BartPE
kernel startrom.0

LABEL Dban
MENU LABEL DB^AN
kernel memdisk
append initrd=dban.img

LABEL BootHDD
MENU LABEL Boot From ^Hard Drive
LOCALBOOT  0

2. Save this file and you are ready to continue setting up the TFTP/PXE server

Adding BartPE/WinPE to the image (Optional)

BartPE/WinPE is an incredibly useful tool that can help recover data from a failing computer, remove viruses and more. By default, it boots from a CD. This takes a fairly long time to boot, and also causes applications to run slowly as it loads them off of the CD. It is much faster to run the image directly from RAM, although it may take a bit longer to boot up initially. You also need more RAM in the computer – At least as much as the ISO image file plus enough for the RAMDISK and enough for the applications you wish to run. If you have a small BartPE image (maybe around 300MB), you can get away with 1GB of system RAM. One thing to note is that you cannot TFTP a file over 500MB, so the ISO needs to be less than 500MB or you will receive an error when it begins to load.

1. You need to build your PE image using a Windows 2003 Server souce. If, like me, you already had it built using a Windows XP source, don’t worry as it’s an easy fix. Download the Windows Server 2003 Service Pack 1 Update to your desktop. You will need this either way, so download it even if you built from a Server 2003 source. Skip to step 4 if you built your PE disc using a Windows Server 2003 Source.

2. If you built your BartPE disc from Windows XP, extract ramdisk.sy_ from the Windows Server 2003 Service Pack 1 file and expand it to ramdisk.sys by opening a command prompt and running the following command:

  • extract ramdisk.sy_ ramdisk.sys

3. Take that file you extracted, and using a utility such as UltraISO, overwrite the file in the i386\system32\drivers folder of the BartPE ISO and save it. The ISO is now ready to be used.

4.  Extract the following files from the Windows Server 2003 Service Pack 1 file and expand the first two using the method in step 2:

  • setupldr.ex_
  • startrom.n1_
  • ntdetect.com

5. Rename the files as following. They are case sensitive, so be careful:

  • setupldr.exe becomes NTLDR (no extension)
  • ntdetect.com stays ntdetect.com
  • startrom.n12 becomes startrom.0 (that is a zero)
  • bartpe.iso becomes BARTPE.ISO

6. Create a file called winnt.sif (all lowercase) and copy and paste the following into it. This file is the one that tells startrom.0 to load the ISO after it is called in the main menu:

[SetupData]
BootDevice = “ramdisk(0)”
BootPath = “\i386\System32\”
OsLoadOptions = “/noguiboot /fastdetect /minint /rdexportascd /rdpath=bartpe.iso”

7.  Save this file and all the others from this section into the tftpboot folder.

8.  At this point, you should have the following files in your tftpboot folder:

  • NTLDR
  • ntdetect.com
  • startrom.0
  • BARTPE.ISO
  • pxelinux.o
  • memdisk
  • menu.c32
  • winnt.sif
  • (Any image files such as dft.img or dban.img. This is case sensitive as well; the case must match that in the file pxelinux.cfg\default)
  • pxelinux.cfg (this is a folder)
    • default (inside pxelinux.cfg folder)

9. Your files are now ready to be TFTP booted

Setting up the TFTP server and dnsmasq for PXE booting

Now that you have your files ready, it’s time to get the server up and running. Once you have your server up and running with Ubuntu 9.04 Server Edition, it’s time to install the TFTP server. At a command prompt, run the following command. Be sure to use the tftpd-hpa package, and not the older tftpd package, as the tftpd package does not support what we are trying to do with this:

  • sudo apt-get install tftpd-hpa

That’s it! Just transfer your tftpboot folder to /tftpboot on your server and your TFTP server is ready to go. The last thing to do is setup your DHCP server for PXE booting. I’m only going to cover dnsmasq because it’s incredibly easy to setup and is also the package used on DD-WRT, the open source firmware for routers such as the Linksys WRT54G. Other DHCP servers can be used, but you will need to find how for youself how to configure them for PXE booting.

To setup PXE booting to your server on DD-WRT, go to Administration/Services in the DD-WRT control panel, make sure DNSMasq is Enabled, Local DNS is Disabled, and add the following line to “Additional DNS Options”:

  • dhcp-boot=pxelinux.0,server,192.168.1.1

Be sure to replace “server” and “192.168.1.1″ with the correct hostname and IP address of your server. Also, this configuration line should work on any implementation of dnsmasq, not just a DD-WRT router.

You’re now ready to give the whole setup a try. Connect a computer that supports PXE booting to your network, and see how it works. If all goes well, you will be presented with an interactive menu that allows you to choose what tool to boot. One thing to note, is that memdisk does not function properly on some computers that do not have floppy drives. That means that running memtest86 will work for some reason, but tools like Drive Fitness Test will give you a “non system disk or disk error” message. The workaround to this is to enable a floppy drive in the BIOS, connect a USB floppy drive to the machine, or just use a plain old CD with the image on it. I’ve mainly seen this issue on older HP branded machines (mainly Pentium 4/Athlon XP  and a few Core 2 Duo and Athlon 64 machines), but I have seen it on other PCs as well.

Hopefully this guide works out for you. This took me a long time to get every part pieced together, and there was no other guide on the Internet for something like this, so I’m sharing this knowledge with the hopes that others can benefit from it as well. If you can’t get something working, feel free to leave a comment here and I’ll do my best to help.

One final thing is I’d like to give credit to the resources I used in putting together this guide. First, the information about TFTP booting BartPE was derived from this page: http://wiki.contribs.org/PXE_booting_to_BARTPE, and the information about dnsmasq on DD-WRT is from here: http://www.dd-wrt.com/phpBB2/viewtopic.php?t=4662

 

5 Responses to “Network Booting Diagnostic Tools”

  1. Brandon says:

    Wow, i have been wanting to set something up like this for a while now and thought i was going to have to do it all by hand. If this works for my needs i want to donate something to you for your work. Email me and we can discuses it. Thanks A million.

  2. Brandon says:

    I seem to be getting hung up on NTLDR wanting the file BOOTFONT.BIN, any ideas? I seems to look for it, not find it and craps out the tftp connection. Thanks in advance.

  3. Brandon says:

    Found it here. FYI.
    http://www.911cd.net/forums//index.php?showtopic=9685&st=40
    was a tftp issue via windows it seems.

  4. Brandon says:

    Last one for the night. I seem to be getting “Line 4 of the INF file winnt.sif is invalid
    Setup can not continue. Press any key to exit”

    I double checked file and it matches whats on the site. And have made adjustments to the tftp server as well. Not sure what to try next. If you have any ideas let me know. thanks

  5. admin says:

    Brandon,

    You mentioned something about tftp via windows. So I’m assuming you are using Tftp32 server on Windows rather than tftpd-hpa on Linux?

    Where are your files located? C:\tftpboot?

    Does everything else work, such as booting the diagnostic tools?

    Finally, did you try downloading the zip file I put together with all of the files pulled straight off of my server? The link is at the beginning of the article under “Gathering the Required Files”

Leave a Reply