Jump to content











Photo
- - - - -

PXE boot 45MB Stripped Down XP PE for Ghosting


  • Please log in to reply
52 replies to this topic

#1 GeekToMe

GeekToMe

    Member

  • Members
  • 39 posts
  •  
    Canada

Posted 03 September 2009 - 04:33 PM

Hey all,

I have a very peculiar setup, and I have been working to on it for close to a month with varying levels of success.

I'll give you a brief overview of what I'm trying to accomplish.

I am refurbishing large numbers of notebooks (2000+ mixed models), and this requires them to be low level DoD Secure erased, and re imaged via multicast with pre-built Ghost images.

I have had numerous issues with the DOS version of Ghost and newer hardware, eg. AHCI. To overcome this I have created a stripped down, customized, and automated version of XP PE, allowing me to use Ghost32.exe and advanced networking. It works fine when booted off a USB flash drive, and I managed to create a 45MB PXE image, allowing much faster deployment. The PXE image works on many systems, while on other it comes up with a TRAP 00000006 EXCEPTION error, an issue caused by corrupted XPLOADER.BIN, a little bit on that later.

As I said, it works fine on all systems when using the USB flash drive. Here is some info on the PXE image I created and its setup:

-Created a 45MB fixed size virtual hard drive in MS VirutalPC.

-Created an active primary FAT32 partition.

-Using WinImage mount the image as a virtual drive in Windows and run grubinst and GUI from grub4dos-0.4.2, and copied over modified menu.lst and grldr.

-menu.lst:
-find --set-root /XPLOADER.BIN
-chainloader /XPLOADER.BIN

-Next I convert the VirtualPC .vhd file to a .ima using WinImage, allowing the image to be added to my syslinux PXE boot menu along with my other utilities (customized Dos Ghost floppies, DBAN, etc).

-Then I add the modified files from my stripped down Mini XP, resulting in the following directory setup:

NAME

\XP
\XP.BIN
\XP.DAT
\XPLOADER.BIN
\XP.CA_
\menu.lst
\grldr

-Once its all saves, I test it out over the PXE and on 80% of the systems it works fine.

Now here is the main issue...

On the systems that don't work, I have played around with menu.lst, trying to figure out what the issue is. I have determined that the XP files are OK, since they usually work. And by some random chance I found that it does work on the systems that normally error, while repeatedly pressing PAUSE and ENTER (my own debugging mode lol), and just after chainloader line is executed quickly pressing PAUSE and ENTER almost simultaneously causes it to boot fine. I tried adding pauses at different parts of the menu.lst, but they all still result in the exception error. I think the boot operation is being executed before the xploader.bin is completely loaded. Lots of googling has lead me to believe the error message is basically complaining about a corrupted MBR or partition and that is why it isn't loading properly.

*The loaded PXE image is located at (hd0,0)

After combing through the Grub4DOS manual I found that the chainloader command has several options, one being the EBX/EDX. I'm not quite sure how to implement it, but there are references in the exception error that have eax=00000000, ebx=00000002, ecx=00010080, edx=0031B06F, etc.

While running in debug mode I found this:

will boot NTLDR from drive=0x80, partition=0x0(hidden sectors=0x11)

I believe this is the first step of the chainloader operation, after this there is one step that shows no output and then the next step completes the chainloader operation which i assume is automatic boot command. When running the commands manually from the console prompt or in debug mode it still has the same error issue when executing boot. The only way it works is the strange physical pressing of the PAUSE key. I am hoping that someone has a way to pause or stall the chainloder operation midway through. I think that would solve the problem allowing the XPLOADER.bin to load fully.

I'm fairly green at programming and I wouldn't know where to even start recompiling Grub4DOS to add a pause in there somewhere. I know there is quite a bit of info here to digest, but I've been trying very hard... but I'm stumped, any help would be greatly appreciated. I can provide more details and even upload some files if necessary.

Thanks

Graham

Attached Thumbnails

  • debug.jpg
  • Trap00000006.jpg
  • grub4dos_mbr.JPG


#2 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 03 September 2009 - 04:51 PM

You seem to be grossly "out of date" (no offence intended ;)), grub4dos is now at release 0.4.4

First thing use 0.4.4 2009-06-20 (latest):
http://nufans.net/grub4dos/

Then, read the guide by diddy:
http://www.boot-land...?showtopic=5187

Then, take your time browsing/searching the Forum and the Board, there are a few PXE specific ones.

:)

jaclaz

#3 GeekToMe

GeekToMe

    Member

  • Members
  • 39 posts
  •  
    Canada

Posted 03 September 2009 - 05:48 PM

Oops... dont know how I missed the version. Could someone please point me to the latest version of grubinst_gui.exe? the link in the sticky is broken... I didnt see any mention of it in a quick scan of the installation section of diddy's Grub4dos Guide. Or does it not work with the latest version 0.4.4?

#4 maanu

maanu

    Gold Member

  • Advanced user
  • 1134 posts
  •  
    Pakistan

Posted 03 September 2009 - 05:58 PM

here,

http://nufans.net/grub4dos/grubutil/

still works with the latest version . just copy grldr in that folder , and we also have alternative , grub4dos toolbox,.

#5 GeekToMe

GeekToMe

    Member

  • Members
  • 39 posts
  •  
    Canada

Posted 03 September 2009 - 06:23 PM

Ok I've updated to 0.4.4, but still having the problems. Works fine on most of the systems, but still not working on the same ones as before, PAUSE+ENTER trick still works though.

#6 GeekToMe

GeekToMe

    Member

  • Members
  • 39 posts
  •  
    Canada

Posted 03 September 2009 - 06:32 PM

I should note that there are several different types of laptops, and I dont believe it is a hardware related issue. Originally I thought it was only happening on Intel systems, but then I ran into the same issue on two AMD based units. Then I suspected memory, but in two of the units I have issues with one has 2GB and the other has 512MB.

I'm pretty sure its messing up somewhere during the chainload operation, and some properly timed PAUSE+ENTER seems to jolt it into working, but when clicking through in debug mode I belive there are 2-3 lines of code/operations that dont display any info. Is there any way to increase the verbosity of the debugging mode?

#7 maanu

maanu

    Gold Member

  • Advanced user
  • 1134 posts
  •  
    Pakistan

Posted 03 September 2009 - 06:47 PM

well i have no idea about pxe , never used it .

do we have usb boot option ? ( hopefully u wont have to worry about a working solution for multiple systems then )

edit :

sorry read the 1st post completely .

i guess u do have another option , (im afraid of 2000 notebooks but anyhow ),

first , im not sure how u r gonna manage to image these 2000 notebook with pxe , do u have an automated method or something ? cause it ll be very hard for u to network all of these ?
and are u using darik's boot and nuke for secure erase /?

anyways , what i have in mind is , if u have usb adapter ,which connects ide ,sata hdd's to systems via usb 2.0 , u can image the gho from within ur live system after attempt erase thing first .will it speed things up ?
im sure we have some alternatives which can be used in windows env for secure data erase.

dont wanna confuse u , bt ignore this post if think it is confusing..

#8 GeekToMe

GeekToMe

    Member

  • Members
  • 39 posts
  •  
    Canada

Posted 03 September 2009 - 06:52 PM

I do have a clone of it that works fine USB, thats actually what the image source ism a flash drive. And up till now I have been using the USB on the few systems that seem affected.

However we just got a pile of about 300 older MSI netbooks that dont have optical drives and don't support USB booting. I have dual 24 port gigabit switches so I can do them in a timely fashion, as I have been doing with larger batches in the past. Multicast ghost works wonders when it actually works lol.

#9 maanu

maanu

    Gold Member

  • Advanced user
  • 1134 posts
  •  
    Pakistan

Posted 03 September 2009 - 07:05 PM

plz read my edited post ,

p.s just wondering if u have any experience of using winbuilder ? u might think it is offtopic , but it isn't .

u can build a 25-30 MB pe image with ghost32 and multicast on it only . without mass storage drivers .since the latest 300 notebooks batch seems old so without sata i guess.

in this way , if u ll load it as " map --mem ' , it MIGHT wont give u the above error of xploader .

(build with wimboot option ) .

let me know if u need any help..

#10 GeekToMe

GeekToMe

    Member

  • Members
  • 39 posts
  •  
    Canada

Posted 03 September 2009 - 07:12 PM

Here is a little more... I think this is the PXE loading to RAM disk. Its a little cryptic but I can kind of make out the info its displaying. Hope this is helpful.

Attached Thumbnails

  • loading.jpg


#11 GeekToMe

GeekToMe

    Member

  • Members
  • 39 posts
  •  
    Canada

Posted 03 September 2009 - 07:17 PM

I have played with WinBuilder before. I'll try a few things with it. I just find this very frustrating because it does work on so many systems already, and it does work with the stupid PAUSE+ENTER, but its not reliable that way. Plus I have many other systems to do besides the netbooks, and its annoying to load each one off USB. I will take a crack at WinBuilder though, haven't used it in a while.

#12 GeekToMe

GeekToMe

    Member

  • Members
  • 39 posts
  •  
    Canada

Posted 03 September 2009 - 07:27 PM

lol, sorry I didnt fully read your edited post.

I dont work on all 2000 at the same time. I put them through a refurbishing process. I usually have about 50 or so on my benchs/shelving units at a time. I use Dariks Boot and Nuke and ActiveKillDisk(some crash with DBAN) and perform 3pass Department of Defense level encrypted erase and let them go overnight - 6-8hrs usually.

I have created images for all the different systems. Once the drives are scrubbed I run burnin tests from vistape, while I go through and document all the specs, S/N, service tags, etc. Once thats complete I multicast 2-3 sessions of about 15-20 units for each model.

The PXE automatically boots to the xp pe image, extracts ghost32, sets up network and connects to image server. then on the desktop I have several batch files, 1 to dump images, and 3 to restore sessions A, B, and C.

#13 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 03 September 2009 - 07:38 PM

Why do you use grub4dos in the image file itself, when you boot the image with MEMDISK already?
Just make your hard disk image bootable without using grub4dos (use Windows files only).

Also your image has a very strange layout: C/H/S: 903/6/17, while 'normal' hard disks will have 63 sectors and 255 heads: http://www.boot-land...?...10&start=10
It also has a fractional end cylinder. You can see that the following values don't match:
  • 903 cylinders x 6 heads x 17 sectors x 512 bytes per sector = 47158272 bytes
  • 46080 kilobyte x 1024 = 47185920 bytes

You can also use the internal wiping command of the hard disk. You need the tools from the manufacturer of the hard disk for that.
See the Hard Disk part on http://www.ultimatebootcd.com/ for some examples of those tools. They are much faster than DBAN and more secure.

You can use HDDerase.
See Table 1 of page 2 of the PDF on http://cmrr.ucsd.edu...ionTutorial.pdf about the speed and security level.
http://cmrr.ucsd.edu...cureErase.shtml

#14 GeekToMe

GeekToMe

    Member

  • Members
  • 39 posts
  •  
    Canada

Posted 03 September 2009 - 07:57 PM

Its a small 45MB drive created with MS VirtualPC, not an image of a physical drive, thats probably why its got the crazy C/H/S: 903/6/17.

Its booting with grub because the xp pe is contained in a highly compressed cab file, which is what let it be so small, 42MB instead of 120MB.

We have to use DBAN and ActiveKillDisk with the encrypted erase 3 PASS DOD 5220.22-M to satisfy a supplier contract.

Its strange because it does work on most systems, and the keyboard trick sometimes works too.

Do you think the MBR or partition table layout could be modified to correct the wacky values?

I'm going to check a few other systems and see if they show the same loading info...

#15 GeekToMe

GeekToMe

    Member

  • Members
  • 39 posts
  •  
    Canada

Posted 03 September 2009 - 08:04 PM

Thanks for that info on the Secure Drive Erasing, I'll bring that up with my boss. It hasn't had much of an impact on throughput, we let it run over night. And on spot checks with multiple recovery tools we were unable to recover anything. But I will definately look deeper into this.

#16 GeekToMe

GeekToMe

    Member

  • Members
  • 39 posts
  •  
    Canada

Posted 03 September 2009 - 08:20 PM

Is anyone able to explain how the chainloader operation is executed and what would be going on in the last few operations as the file is loaded? I cant see any additional details in the debugging mode...

#17 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 03 September 2009 - 08:23 PM

If the hard drives support Enhanced Secure Erase, the erasing process takes only a few seconds (changes the in-drive encryption key) (security very high). If it only supports Secure erase it takes 1-2 hours for a 100 GB disk (security high: overwrites also bad an reassigned blocks which normal utilities can't access).

Do you think the MBR or partition table layout could be modified to correct the wacky values?

  • The easiest thing to do is, do download Parted Magic or Gparted LiveCD.
  • Create a new empty hard disk of the required size (45MB or something like that) and add it to your virtual machine
  • Partition this disk (FAT16 primary partition) with Gparted from within Parted Magic or the Gparted LiveCD.
  • Then copy all needed files from the current image that you have to the new partition on the hard disk (except for the grldr and menu.lst file).
  • Install Syslinux as bootloader on this new disk and add chain.c32 to this new partition too (in the root (or in /syslinux or in /boot/syslinux)).
  • Then create a syslinux.cfg in the root of the disk (or in /syslinux or in /boot/syslinux):
DEFAULT winpeghost

PROMPT 0



LABEL winpeghost

COM32 chain.c32

APPEND ntldr=/XPLOADER.BIN
Now you can use the new image as image with MEMDISK and PXE.

#18 GeekToMe

GeekToMe

    Member

  • Members
  • 39 posts
  •  
    Canada

Posted 03 September 2009 - 09:01 PM

I'll give that a try... I think there is some compatability issue with different BIOSs' PXE's, and the MEMDISK + GRUB is screwing with something. I would still be interested in seeing if anyone can show me where the code would be for the chainloader operations.. I briefly looked through the source code folders, but I don't have much of an idea of what to look for. Or if there is a way to enable some super verbose debugging mode.

#19 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 03 September 2009 - 09:30 PM

You can find the code that does the chainloading for ntldr (and setupldr.bin) in /stage2/buildins.c:
if (((*(long *)SCRATCHADDR) & 0x00FF00FF) == 0x000100E9 && filemax > 0x30000 &&

	   (*((unsigned short *) (SCRATCHADDR + BOOTSEC_SIG_OFFSET)) != BOOTSEC_SIGNATURE))

	{

	if (chainloader_load_segment == -1)

		chainloader_load_segment = 0x2000;

	if (chainloader_load_offset == -1)

		chainloader_load_offset = 0;

	if (chainloader_load_length == -1)

		chainloader_load_length = filemax;

	if (! chainloader_edx_set)

	{

		chainloader_edx = current_drive | ((current_partition >> 8) & 0xFF00);

		chainloader_edx_set = 1;

	}

		

	grub_close ();

	

	if ((chainloader_edx & 0xFF00) == 0xFF00)

		grub_sprintf ((char *)SCRATCHADDR, "(%d)+1", (chainloader_edx & 0xff));

	else

		grub_sprintf ((char *)SCRATCHADDR, "(%d,%d)+1", (chainloader_edx & 0xff), ((chainloader_edx >> 8) & 0xff));



	if (! grub_open ((char *)SCRATCHADDR))

		goto failure;

	

	/* Read the boot sector of the partition onto 0000:7C00  */

	if (grub_read ((char *) SCRATCHADDR, SECTOR_SIZE, 0xedde0d90) != SECTOR_SIZE)

		goto failure_exec_format;



	/* modify the hidden sectors */

	/* FIXME: Does the boot drive number also need modifying? */

	

	if (*((unsigned long *) (SCRATCHADDR + BOOTSEC_BPB_HIDDEN_SECTORS)))

		*((unsigned long *) (SCRATCHADDR + BOOTSEC_BPB_HIDDEN_SECTORS)) = (unsigned long)part_start;

	if (debug > 0)

	  grub_printf("Will boot NTLDR from drive=0x%x, partition=0x%x(hidden sectors=0x%x)\n", current_drive, ((current_partition >> 16) & 0xff), (long)part_start);

	}
But try first the approach with PXELINUX ==> MEMDISK ==> SYSLINUX (inside the image) ==> chain.c32 first.

#20 GeekToMe

GeekToMe

    Member

  • Members
  • 39 posts
  •  
    Canada

Posted 03 September 2009 - 09:49 PM

Is there an installer tool or a simple guide for installing syslinux? I setup the pxelinux already, and I have the recent syslinux downloaded... can I do the installation from within PartedMagic? I've got some limited linux skills so I'll be fine with a wiki guide or how to, figured you might know where a good one is...

#21 GeekToMe

GeekToMe

    Member

  • Members
  • 39 posts
  •  
    Canada

Posted 03 September 2009 - 09:56 PM

I apologize if I seem like I want to be spoon fed... I'll do some more searching and reading. Just about done at work for the day anyway. But any quick tips would be greatly appreciated.

#22 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 03 September 2009 - 10:12 PM

To avoid mistakes, detach the old hard disk from your virtual machine.
For linux you need /linux/syslinux and /mbr/mbr.bin from the Syslinux download. Put them in the same folder.

Open a terminal window (ROXterm).
cd to the directory where you did put the syslinux and mbr file. If you did put the files on the desktop, you don't have to do anything special.
If you did put them in a subfolder like test, use:
cd test
Now run ls (unix equivalent of dir) to see if you have the two files
Suppose you did put it on the desktop.right directory first
, do the ls command
ls
It should list the syslinux and mbr.bin files. If not, you didn't extract them to the right directory.

If you have only the new hard disk attached, your hard drive is /dev/sda (if you have more, it can be /dev/sdb, /dev/sdc, ...). Run the following to install syslinux:
cat mbr.bin > /dev/sda

./syslinux /dev/sda1
Also don't forget to make the first partition active with Gparted (or fdisk).

#23 GeekToMe

GeekToMe

    Member

  • Members
  • 39 posts
  •  
    Canada

Posted 03 September 2009 - 10:24 PM

Thanks I'll give that a try when I get home.

#24 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 03 September 2009 - 11:56 PM

Oops... dont know how I missed the version. Could someone please point me to the latest version of grubinst_gui.exe? the link in the sticky is broken... I didnt see any mention of it in a quick scan of the installation section of diddy's Grub4dos Guide. Or does it not work with the latest version 0.4.4?


A little OT, since you are "steering" towards syslinux/memdisk/pxelinux, but JFYI, besides grubinst, you may want to have a look here:
Grub4DOS Toolbox
http://www.boot-land...?showtopic=7328

jaclaz

#25 GeekToMe

GeekToMe

    Member

  • Members
  • 39 posts
  •  
    Canada

Posted 04 September 2009 - 03:47 PM

So I rebuilt my boot image to run off syslinux, the hard drive seems to be properly formatted (I think), CHS 6/63/255, fat16, active. The image boots properly within MS VPC, and boots properly via PXE on several systems that worked before with the grub4dos loader.

However, on the netbooks it comes up with the same exception error as before, and on a Lenovo unit that I have been doing most of the testing on it actually resets the computer... I tired the PAUSE+ENTER key trick but it dosn't seem to work, or I cant do it at the right time.

The memdisk loading screen still mentions that the image still has a fractional end cylinder. Any way to fix this?

Is there a way to enable a debuging/verbose mode for pxelinux, memdisk, and the syslinux loaders so I can slow things down and try to pinpoint the problem? I know you could press F11 for step by step with Grub... I looked through the wiki and googled looking for debug commands for them but didnt find anything except verbose swithces for loading linux images.

Attached Thumbnails

  • memdisk_load.jpg





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users