Tutorial - build BartPE, use with Macrium -- boot from RAM

Discussion in 'backup, imaging & disk mgmt' started by Sully, Nov 13, 2009.

Thread Status:
Not open for further replies.
  1. Sully

    Sully Registered Member

    Joined:
    Dec 23, 2005
    Posts:
    3,719
    OVERVIEW

    This guide contains methods and data that can be found in many places. I am not claiming them as my own in any way, but merely attempting to show you how I went about creating my project.

    Lets start with a couple of very basic items. You will need the source files for Windows XP. The source files are basically all of the files on your Windows XP CD. It will be convenient for you to have these files on your HDD (short for hard drive). Let us now create a directory (also called a folder) to put these XP source files into. Create a directory named XP_Source. It might be c:\XP_Source or d:\XP_Source. It does not really matter which HDD this directory is located in.

    After you have made your XP_Source directory, go ahead and insert your Windows XP CD. Navigate to the drive the CD is in, and then hi-lite ALL of the directories and files that exist there. Copy the contents of the CD to the XP_Source directory. This should be around 500mb in size.

    Now that you have the source files, you need to ensure you are using either Windows XP Service Pack 2 or Service Pack 3. The easiest way to do this is to look for a file named win51ip in the XP_Source directory. This file "should" be appended with the service pack edition. So win51ip.sp2 indicates the source is Service Pack 2 and win51ip.sp3 indicates it is Service Pack 3.

    If your source is not already SP2 or SP3, or if you wish to upgrade SP2 to SP3, then you must download the proper Service Pack from Microsoft.com. Typically when you download these types of updates from Microsoft, they will give you two options. One option downloads just enough information to get started and then downloads whatever else you need. The other option is often labeled "redistributable". This is the type of file you want, as it is the entire package. It is larger, but once you have downloaded it, you can archive it for future use.

    Once you have downloaded the Service Pack, go ahead and rename it. Rename the file to XPSP2.EXE or XPSP3.EXE depending on which you have chosen. Once you have the file named correctly, create a directory in the same HDD you made your XP_Source directory in. Name this directory XPSP2 or XPSP3. So for example it might be c:\XPSP2 or d:\XPSP3. Now we need to extract the contents of the Service Pack into this new directory. First though, go ahead and copy the Service Pack (now renamed) into your new directory you just made.

    Once you have the Service Pack located in the Service Pack directory, choose a method below to extract it. Both methods should extract the entire contents of the Service Pack into your Service Pack directory.

    Method 1: Use 7zip or equivilant to extract contents of XPSP2.EXE to c:\XPSP2
    Method 2: Open command prompt. Type c:\XPSP2\xpsp2.exe -x:c:\XPSP2
    ( !! NOTE !! -- Be SURE to use the correct drive letter here !! )

    Slipstream the Service Pack into the OS Source.

    Now that you have your chosen Service Pack ready to use, you need to "infuse" it into your OS Source. This is known as "Slipstreaming". To slipstream the Service Pack, to the following.

    Open command prompt. Type c:\XPSP2\i386\Update\update.exe -s:c:\XP_Source
    ( Be sure to use the correct drive letter !! )

    Now you should have to sit and watch as the Service Pack is "Slipstreamed" into the OS Source files. When this is done, the directory XP_Source should be updated to whatever Service Pack you chose.

    Special files needed to boot BartPE into RAM from your HDD.

    If you desire to have a fast boot of BartPE, you can have a boot option when you start your computer to do that. This method actually loads the BartPE image that resides on your HDD into memory. To do this however, requires two files that are from Windows 2003 Service Pack 1. Here is the address to dowload that if you want to do it manually
    http://download.microsoft.com/downl...52/WindowsServer2003-KB889101-SP1-x86-ENU.exe

    There is an easier way though. There is a project called WinBuilder, which is a front-end for various PE type projects such as BartPE, LiveXP, WinPE, and others. This program is designed to help you get files you need and build the PE project for you. When you first start the program, it asks you to choose which project(s) you want to use. Choose the BartPE project. WinBuilder then downloads a list of sorts that shows what is available for the BartPE project. On the left side of WinBuilder the project is now shown, with many items checkmarked. Clicking the 'download' button will have WinBuilder go and fetch everything checked.

    For our use right now, uncheck everything in the BartPE project. Then expand the TOOLS directory. In the TOOLS list of items, check two items: ramdisk.sy_ and SETUPLDR.BIN. Make sure nothing else is checked. Then click the 'download' button on the bottom of WinBuilder. WinBuilder will download those two files. One of these files, ramdisk.sy_ is compacted, much like a zip file. You will need to extract it. You can use a built-in windows command to do this.

    These files live wherever the WinBuilder program exists. WinBuilder should have created a sub-directory named Projects. Inside of the projects directory should be a sub-directory named Tools. Inside of the tools directory should be the two files you downloaded. To get the ramdisk.sy_ file usable type this into a command prompt, using the correct HDD letter and paths to match your own
    expand c:\WinBuilder\Projects\Tools\ramdisk.sy_ .\ramdisk.sys
    Now you should see the file ramdisk.sys exist. Rename this to all capital letters RAMDISK.SYS. This is important !

    Now you need to copy these two files to your XP_Source\i386 directory. From a command prompt or run box type this:
    copy c:\WinBuilder\Projects\Tools\SETUPLDR.BIN c:\XP_Source\I386\SETUPLDR.BIN
    copy c:\WinBuilder\Projects\Tools\RAMDISK.SYS c:\XP_Source\I386\RAMDISK.SYS
    (yes, you can replace the files existing with these new ones)

    These two files are needed for booting from RAM. Without them your project will give errors when attempting to boot from RAM.

    Protect your work, create a working copy.

    I would highly advise creating a copy of the XP_Source directory and renaming it to XPCD. This way you can use this XPCD directory in your project, but always have a "clean" version of the files if you need to start over. The choise is of course yours though.

    The OS Source files are ready for use with your projects !
     
    Last edited: Nov 13, 2009
  2. Sully

    Sully Registered Member

    Joined:
    Dec 23, 2005
    Posts:
    3,719
    BartPE - what is this doing again?

    I am not a PE expert, but I will try to give a very brief explanation of what is going on here.

    PE stands for Pre-installed Environment. What this means to us is that we can have a sort of "mini XP" operating system that you can boot from a CD or from your HDD. It is fairly quick and small. It does not have everything a standard version of XP has. It is primarily used to trouble-shoot computers. You can access your hard drives/files even if you are using NTFS. It can give access to some software like browsers and virus scanners. You can use different tools to fix/repair your hard drives while booting into a somewhat familiar but smaller version of XP. You can tote the CD with you and attempt to use it on any computer you might have access to. Some use it as a portable OS when they are traveling etc, so that they can check thier email or browse the web.

    I have a very specific reason for this tutorial and using BartPE. It is to use a plugin for a disk imaging software application. Specifically it is geared towards using Macrium Reflect Free, but other imaging software also are compatible with BartPE. As it happens Macrium Free will allow you to create a Macrium Plugin for use with BartPE. All you really need to do is figure out how to make a BartPE CD that works with your computer and it's hard drive controller, then include the Macrium Plugin when you build your BartPE CD.

    Of course we are going to do a little bit more than just that, but you should get the general idea now of what BartPE is and what to use it for. Like I said, this is a very generic explanation.

    Getting started with BartPE.

    What to do first ?

    The first time you start pebuilder.exe, you should fill in the Source: (path to Windows installation files) box with the XPCD (or XP_Source if you did not copy it) directory you made. For example it might read d:\XPCD. Leave the rest at default, where the Custom: box is empty, the Output: box should read BartPE, and the Media Output option should be NONE. Then click the BUILD button. This will copy/extract the files needed for BartPE from your XPCD directory and create a BartPE directory in the PEbuilder directory. This is now your project source for BartPE. If you modify things and need to start over, or just have issues, simply delete this newly made BartPE directory, and repeat the steps to create it from the XPCD source files.

    You will most likely have troubles with either your hard drive controller or your network adapter. You will need to get the drivers for your hardware to continue.

    This is a common problem now. The XP drivers do not stay up to date with newer hardware, so you will have to provide the drivers yourself. I have to draw the line somewhere with this project, and it shall be that you are expected to understand what a driver is, and how you will find it. I personally download the driver from the manufacturers website, then extract it. It is common to have some type of setup.exe which installs the driver for you. Closer inspection normally reveals a sub-directory that is labeled according to your OS choise, such as 2kXP or Vista. Inside of this directory are the actual driver files. These are the files I use. I make a directory that describes what the driver is for and place it either in the NET directory or SCSIAdapter directory. The NET directory is for user supplied network drivers and the SCSIAdapter directory is for user supplied hard drive controller drivers. See the images for a better understanding.

    If your BartPE CD does not recognize and use your HDD or your NIC, you must supply the correct drivers yourself ! This is not always the case, as if you have Service Pack 3 it provides many new drivers that XP did not have before SP3. It really depends on how new your hardware is.


    Add any plugins you wish to use.

    Now is the time to add any plugins you wish to use. Macrium Reflect Free creates a plugin for use with BartPE. Place it in the plugin directory. This Macrium plugin is ready to go once you place it there. There are many plugins available from many sources online if you need to expand what BartPE can do. The idea though is to keep your BartPE disc small in size, so don't go overboard.

    Once your plugin is in place, be sure to click the PLUGINS button in the PEBuilder window. This allows you to choose which plugins will be included in the cd/iso output for BartPE. Be sure Macrium Reflect is in the plugins list and is ENABLED. Now you are ready to see if your BartPE project will work with your hardware. Go ahead and create an .iso as the output and click the BUILD button. The result is that in the PEBuilder directory should be a new file named pebuilder.iso, and it should be roughly around 140mb in size unless you included many plugins.

    Your BartPE .iso image is made, now what ?

    You can burn this .iso to a CD-RW if you like, to test it out. But you can also go ahead and try it out from RAM if you chose to put the files SETUPLDR.BIN and RAMDISK.SYS into the XP_Source directory as explained earlier.

    A quirk regarding BartPE and USB drives.

    It is best if you wish to use a USB drive of any kind with BartPE, to have the drive plugged into a USB port PRIOR to booting into BartPE. I have successfully gotten USB devices added AFTER booting into BartPE to work, but it is does not work every time. It is better to just have them plugged in before-hand as they are accessible most of the time this way.
     
    Last edited: Nov 13, 2009
  3. Sully

    Sully Registered Member

    Joined:
    Dec 23, 2005
    Posts:
    3,719
    Make your BartPE .iso file bootable into RAM for fast boots (or just to test it).

    To get your BartPE image to boot into RAM, go to this web page
    http://www.911cd.net/forums//index.php?showtopic=21883

    and download this file
    http://wimb.winbuilder.net/downloads/?dir=&download=U_XP_SET.exe

    The U_XP_SET.exe is a zip file, so you can use winrar, 7zip, winzip etc to extract it to a directory, for example c:\U_XP_SET.

    Now here is a funny thing. Although you need the files SETUPLDR.BIN and RAMDISK.SYS in the XP_Source\i386 directory for your BartPE project to work in RAM properly, you also need to provide those files for this U_XP_SET tool to work as well. These two files must also be located here
    c:\U_XP_SET\USB_XP_Setup\makebt\srsp1
    Place those two files there now.

    Start a program named PStart.exe in c:\U_XP_SET. Now in the PStart window you want to double click the BOOT_IMG item. This starts the BOOT_IMG program. In the Select Boot Image File box, browse to your pebuilder.iso file. For the Target Drive box choose your OS drive letter, normally C:

    You will be notified of any errors, but there should be none if you have followed my steps. At this point you should be able to click the 'GO' button. In a short time it will be finished.

    What has happened is that your boot.ini file has been backup up, and a new one is created. The new boot.ini file has some extra options. You can view it to piece together what has changed. In a nutshell you now have an option to boot into the pebuilder.iso file. You will also note that a boot to GRUB option exists. GRUB is another way to start your OS, or other OS's on other drives, such as secondary HDDs or USB drives or Floppy or CD-Rom drives, as well as .img and .iso files such as what we are doing now. You may not need GRUB, but in a later article I will show you how you can supplement your boot options by using it.

    You have done all of this, what is the next step? Try your BartPE out !

    Are you ready? Reboot your computer, and when the boot options come up, choose to boot into pebuilder. If all goes well, in roughly 30 seconds you should be at the BartPE desktop. First thing you should do is open the A43 file manager and see if all of your HDDs are showing and usable. Next see if the Macrium Restore program is working and that it can find your image file you would want to restore. And lastly, you can see if your network card is found.

    What now Einstein?

    Well, if your BartPE is working properly, you can burn it to a CD or leave it as is as a RAM boot option. If you wish to replace your Macrium image, just boot into RAM with BartPE, use the Macrium plugin to restore your image, then reboot.

    If BartPE is not working properly, maybe you don't have all the drivers you need or you wish to modify it, just build another pebuilder.iso file with your new settings/drivers/options. Then you can copy the c:\pebuilder\pebuilder.iso file and replace the c:\pebuilder.iso file. The structrue is already in place to boot to any .iso named pebuilder, so you can build as many as you like until you get what you want.

    My personal preferences.

    I like to install XP fresh, set my preferences, install very basic tools/applications that are small in size, no video driver other than the default MS one. Then I make sure the BartPE into RAM option is working 100%. Then I make a Macrium image. Now when I restore my image, not only is it small because this is a pretty bare build, but it also includes the BartPE into RAM option. So whenever I restore, I no longer have to repeat this whole process.

    As I find new setting or tools, I will put my image back in place, then install the new software or change my settings, then create another Macrium image. My images are only around 3.5 gb, and are continually being refined. I have a dozen at any one time.

    You might be asking yourself, what about programs that are large, like Open Office or games? Well, that is a good question. I decided that I want my images small, so if I want office on, I will install it after I put my image on. Common tools like VLC Media Player or my chosen firewall are all in the image, but they are very small. For games and some programs, I install them all to D:\Program Files\Game_XYZ. I then extract the registry values that the game put into HKLM\Software or HKCU\Software and house them with the game. Some of my images have these registry values and desktop shortcuts in them, some do not. The whole point is that my very large 'space hog' items are not usually re-installed, they just live in an alternate location.

    One downfall to doing this is that if a game or program puts preference/user files in My Documents somewhere, I have to remember to copy those somewhere other than C: before I restore an image, otherwise those are lost. Then I have to put them back into place after an image restore to use them. This has been a small price to pay for such speedy image restoration. But, I have recently been playing with a tool Macrium has called RoboRestore. This tool lets me restore my image files, but it does not delete files that are not in the image. So for example, a directory named My_Special_Stuff would not be deleted after an image restoration using RoboRestore, but any file/directory that was in my image would be replaced on the HDD from what is in the image. A sort of hybrid approach where you replace 'dirty' files with 'clean' ones from the image without affecting things as they are that are 'new' since the image.

    Where I am going from here.

    I am certainly going to devote more time to the RoboRestore feature, and likely will write some sort of article around it. I know many who could use it if they had a guide.

    I have used LiveXP, and enjoy it. An article built around that using WinBuilder is also likely to happen. I sort of want to check out some of the other PE projects from WinBuilder, but don't know if I will either find the time to do that or if an article will be produced from it.

    All of this is my current focus, although I plan on upgrading my PGS program this winter as well.

    Cheers.
    Sul.
     
    Last edited: Nov 13, 2009
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.