Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

[Project] Windows PE as a recovery partition

- - - - -

  • Please log in to reply
34 replies to this topic

#26
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 10,092 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

OK so here is the function in the VBScript. It runs imagex just fine but obviously it is failing to run diskpart. I doubt the reason it fails is because of the fully qualified path. But maybe I should try it out?

Set objShell = CreateObject("WScript.Shell")
	ObjShell.run "cmd /c x:\windows\system32\diskpart /s x:\windows\system32\full_diskpart.txt",0,True
	ObjShell.run "cmd /c imagex /apply c:\sp1.wim 1 d:",0,True

Or perhaps its the cmc /c interacts different with diskpart than with imagex? Any other ideas? I'll compare to my deployment code to see if I can find any differences. Actually my other code (I didn't write it) uses the following:

ObjShell.run("&chr(34) & "cmd /c diskpart /s" & chr(34) &" &chr(32) & TempTXT)

As you can see it uses a var called TempTXT but I am not going to use a var. Also I don't quite understand the chr(34) usage.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg


How to remove advertisement from MSFN

#27
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 10,092 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

Riddle me this Batman! I got it all functional at last.

This does not work:
ObjShell.run "cmd /c x:\windows\system32\diskpart /s x:\windows\system32\full_diskpart.txt",0,True

This works:
ObjShell.run "cmd /c diskpart /s x:\windows\system32\full_diskpart.txt",0,True

Strange... Now I am back to GUI stuff again, and after that figue out a deployment process.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg

#28
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 10,092 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

I am still ocassionally getting this error. I am going to try to recreate it so I can make a note as to what it says. I set up a separate test environment on a DQ45CB board for our other guy to test out. There is a major difference between the Intel board and the Wind. The Wind will recover a sysprepped image. The Intel board will recover an Audit mode image.

Also, another annoying this is that sometimes (about as sometimes as the imaging error), the PE doesn't rehide the partition after recovering. This only has happened after a successful recovery, and not during one of those ones that failed. It may also be a "disk not ready" issue, so I'm going to have to add some redundancy into the scripts...

Fatal Error
An error has been encountered that prevents Setup from continuing.

Windows is unable to start because the registry could not be updated. To address this problem, please contact your computer manufacturer. Windows must now Shut Down.

Press OK to view the Setup log file


Clicking OK reboots the computer. So far it seems like this is the operation of events, and appears to be reproducable.

1. A working model with XP on C and recovery partition hidden.
2. Boot into recovery, run a full recovery (that formats the C drive, or D drive actually)

... wait

I found major errors here. First on the Wind, the size that the recovery formats the C drive is wrong. Also on the Intel board, the recovery formats the entire drive, deleting the recovery partition... :realmad:

I can do this manually. What seems to be happening is that when Diskpart creates the partition, initially it is 130GB which is fine, but after reboot it becomes 60GB

select disk 0
select vol d
delete vol
create part pri
select part 1
active
assign letter=d
format fs=ntfs quick
exit

Afterwards, using list vol I get the following:

Volume 0	 D	 NTFS	Partition	135 GB	Healthy
Volume 1	 C	 NTFS	Partition	14 GB	  Healthy
Volume 2	 E				 Removable  0 GB	 No Media

then dropped the image. It of course WORKED this time. :angry: and go through welcome and let it boot into Windows again. AND NOW IT WORKS.

On a side note, while the drive size is correct and XP didn't blow up, the recovery partition has a drive letter assigned to it. I have the PE actually hide the partition TWICE. Once during winpeshl.ini and again in between formatting the partition and imaging. So I have these three scenarios that seem to happen BECAUSE of certain situations.

Situation 1
- Windows does not error out before welcome
- the system partition size is correct
- the recovery partition is not hidden and is assigned a drive letter
- I then hide the partition and reboot into recovery

Situation 2
- Windows errors out
- after reboot into Recovery, diskpart shows the system partition to be 60GB.
- run recovery again

Situation 3
- Windows does not error out.
- the system partition is 60GB in Windows
- the recovery partition is hidden

These happen in that order each time, never had them work in any other order. If I recovery AGAIN after Situation 3, it loops and it will start at 1 again. I am really stumped.

Edited by Tripredacus, 08 June 2009 - 02:15 PM.

MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg

#29
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 10,092 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

Here are some related articles.

http://support.microsoft.com/kb/818171
I can't see how this could be related. For one, I am not using RTM, but SP2. Also this only happens 33% of the time, so it doesn't explain the times when it works. And most articles about this error seem related to sysprep, however the actual problem is definately in the (re)deployment phase.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg

#30
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 10,092 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

Normal testing is complete at this point, as I may have found the cause of the problem. Our regular XP unattend (which I used to create the recovery image) uses a WINBOM.INI file that OOBE may be processing incorrectly. I cannot post this file, but I have my two log files that I have been compiling.

Full statistics report of recovery partition behaviour. 

Product: MSI Wind Netbook MS-N0111X-044US
OS: Windows XP Pro SP2 sysprepped
partition: Windows PE 2.1 with custom apps
RAM: 1GB SODIMM
HDD: Toshiba Mobile 160GB

Different scenarios outlined below:

Situation 1
- Windows does not error out before welcome
- the system partition size is correct
- the recovery partition is not hidden and is assigned a drive letter
- I then hide the partition and reboot into recovery

Situation 2
- Fatal Error: Windows is unable to start because the registry could not be updated.
- Recovery partition is hidden
- System partition is 61GB in PE/Diskpart
- WINBOM file is created in sysprep, see winbomfiles.txt

Situation 3
- Windows does not error out.
- the system partition is 61GB in Windows
- the recovery partition is hidden

### Timeline of events. 

06-09-2009 (earlier) reflected situation 1
06-09-2009 15:45 - situation 3
06-09-2009 16:04 - situation 3
06-10-2009 08:55 - situation 3
06-10-2009 09:10 - situation 2
06-10-2009 09:57 - situation 2

UPDATE: modifying recovery image to remove information from the WINBOM.INI file.

and winbomfiles.txt so far:

WINBOM FILE #1

WINBOM FILE #2
Factory is using the following WinBOM.ini file: C:\sysprep\WINBOM.INI
ERROR: Factory state "Preparing for automatic logon" failed.
Application ".NET Framework 1.1" returned exit code 0.
Application ".NET 1.1 Framework SP1 Update" returned exit code 3010.
Application "NDP1.1sp1-KB886903-X86" returned exit code 3010.
Application ".NET 2.0" returned exit code 0.
Application "NDP20-KB917283-X86.exe" returned exit code 0.
Application "NDP20-KB922770-X86.exe" returned exit code 0.
Application "Malicious Software Removal Tool" returned exit code 0.
Application "WindowsXP-KB885835-x86-ENU" returned exit code 0.
Application "Windows-KB913433-x86-ENU.exe" returned exit code 0.
Application "WindowsXP-KB923789-x86-ENU.exe" returned exit code 0.
Application "Updates" returned exit code 0.
Factory is using the following WinBOM.ini file: C:\sysprep\WINBOM.INI
ERROR: Factory state "Preparing for automatic logon" failed.
Factory is using the following WinBOM.ini file: C:\sysprep\WINBOM.INI
ERROR: Factory state "Preparing for automatic logon" failed.
Factory is using the following WinBOM.ini file: C:\sysprep\WINBOM.INI
ERROR: Factory state "Preparing for automatic logon" failed.
Factory is using the following WinBOM.ini file: C:\sysprep\WINBOM.INI
ERROR: Factory state "Preparing for automatic logon" failed.
ERROR: Could not locate WinBOM.ini on any removable drives or the system drive.

WINBOM FILE #3

At this point, I will have to totally reimage the drive because I can't copy the WIM off the recovery partition. Its too big (1.3GB) and I didn't enable networking in the PE.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg

#31
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 10,092 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

SR for this issue requested to Microsoft. Until a resolution can be reached, this project is on hold. I held a meeting and it was determined we will use SoftThinks for the moment until this issue is resolved.

Update: XP support in the OEM channel is done so I couldn't get a real answer. However, I did get this info. Imagex isn't designed with XP in mind, only Vista, 2008 and 7. The problems I experienced were only with XP recoveries and not the others. There is a point, x% of the time, the recovery fails. With no official support option for XP anymore, this project is halted. I forgot to update this thread, we have indeed started using the netbooks with SoftThinks because it works 100% of the time. I did sure learn alot about HTA, VBScript and the MBR, so thanks all you chipped in!
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg

#32
tblo

tblo
  • Member
  • 5 posts
  • Joined 16-August 09
I read /skimed through most of this one thing strikes my tho. It is mention'd as part of your project you rehide the winpe/re partition. call me a novice but would it not be easyer and more effective in both quality & effectiveness to simply set everything up (boot wise drive wise ect) then use bcdedit to export the current bcdstore (vista's version of boot.ini) then have your script/project simply use bcdedit /import to reimport the bcdstore after format/reimage. it will not damage the lettering of your drives & if you use the administrative console in control panel in vista to remove a drive letter it will not be accsessible from vista or winRE booted off of a vista disk. HOWEVER it will still be bootable into the winRE that is on it if the values are already in the BCDSTORE drive letter or not. you can boot to it reformat main reapply image reimport bcdstore never reapplying a drive letter(ie: unhiding it) all while booted from it. (I know I Have done it)

#33
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 10,092 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

Yes, if I were using a Vista system, I would use BCD. But this partition was designed to restore XP. And also, this is not WinRE at all, just a PE with an HTA in it. WinRE with XP is not supported and I did not consider it as an option.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg

#34
tblo

tblo
  • Member
  • 5 posts
  • Joined 16-August 09
sorry for missing the xp bit.

on this note tho....

WinRE with XP is not supported and I did not consider it as an option.


this is actually right & wrong. PE or RE can be installed & booted to from a xp machine easily tho it requires some files off a vista dvd (bootmgr anyone!)
winpe/re will boot file & can do anything you want to the file's or file structure. However you are right on the note of the WinRE variation of pe. winre will
boot fine & youll get the standard dashboard & their respective programs will launch however their respective programs will not work for xp (start up repair & rollback).
however cmd & all related stuff work fine. On the note of imagex, it was made for vista yes but microsoft made sure it would play nice for xp & msdn has plenty how-to's for
xp imagex bassed deployments.

I know this because i had to fix a friends E-machine & the technician who made the restore disks for it made some disk that would bsod right after the windows boot logo scrolly bar animation.
I wound up doing a fresh install from scratch. it was a xp machine but vista & winPE/RE was already out so I created a winpe partition set up a bat file to auto repair(format/reload) after a few
warnings. (I was a noob back then the bat file used the format command I have sense graduated to diskpart.).

see this website for a detailed how-to for dual boot win xp & winPE 2.0. It has you add boot manager & utilize it. In the case of my friends computer I created a bat file that ran bcdedit /import
that would change the default boot order straight into pe & the pe recovery script put xp back as defualt agine using bcdedit /import (I created 2 diffrent bcd stores with diffrent boot orders & used
bcdedit /export).

http://technet.micro...sktopfiles.aspx

This is all assuming you care if however you found a solution that already works then you dont need to bother.

#35
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 10,092 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

When I speak of "supported" I am referring to official support. What I am able to do is limited by our licenses and support from Microsoft. I understand it is physically possible to do many things with XP and Imagex. For XP, our solution shall continue to be SoftThinks.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users