BartPE and FreeDOS on same USB-stick

I use many tools at work to rescue data and fix computers which are not able to boot anymore, and time to time I need various tools to make it happen.. Unfortunately many of those handy tools are made for DOS and time to time I need WinPE environment for some of the tasks. So I used to have 2 different USB-sticks with me but after I while I really wanted to have those tools on a single USB-stick. I googled a lot around and didn’t find satisfactory solution for the problem how to have both BartPE and FreeDOS on the same USB-stick.

But, I found solution which wasn’t too hard to come up with after all, all you need is:

  • hex-editor (for win32 I recommend http://mh-nexus.de/hxd/ with linux I personally use khexedit which comes with KDE)
  • Boot sector from BartPE USB-stick
  • BartPE and FreeDOS installation media
  • USB-stick, 256MB should be enough but I recommend 512MB

First you need to install BartPE of the USB-stick, after you have done this successfully, next task is to install FreeDOS.

When you have installed FreeDOS on the same stick as BartPE, you’ll see that you cannot really start FreeDOS because BartPE doesnt have standard windows boot-loader, so you don’t have boot menu on the start.

Next task is to copy standard NT-boot loader (ntldr) from windows xp installation on the USB-Stick, but before you can do that you need to rename original “ntldr” file to “peldr” on the root folder of your USB-stick. After this copy standard “ntldr” file from your windows xp installation on to USB-stick root folder.

Now you need to extract boot sector from USB-stick to continue, theres some tools for windows to do this like MKBT. You need to extract boot sector to file called boot.bin and copy it on the root folder of USB-stick as well.

Next we need to open boot.bin file into hex-editor and change 2 bytes in it. On index 000001A1 theres originally reading NTLDR, you need to change this to PELDR and save the file.

HXD editing boot.bin

Final task is to open boot.ini file on USB-stick and edit it to look like this:

boot.ini

Now you should be able to boot into BartPE and Freedos environment!

Leave a Reply