Recover my XPe image

  • Thread starter Thread starter Malvem
  • Start date Start date
M

Malvem

Hi,
I need to recover my XPe system.
In addition to make a recovery cd,I try to recover orginal image from
another partition.
So I don't need recovery cd.
How can I do this job? Any idea?
 
Hi Malven,

If you want it to look nice then hardly if not:
Make multi OS boot.ini.

On second partition place recovery OS that will reimage first partition. (Yuk.)

Regards,
Slobodan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do have an opinion on the effectiveness of Microsoft Windows Mobile and Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Hi Malvem,

There are too many possible ways to do this.
Depending on OS that you will use on second partition. (Or no OS at all)

I would make simple ultra short code in asm (<100 bytes compiled) and let ntldr load and execute it as it would try to load DOS.
This code would use int 13 for reading from second partition and writing to first partition.

If not then you have on your disposal tools like ghost or tools for manipulating SDI file.

Or you can use API functions like CreateFile, ReadFile, and WriteFile from second XPe to copy content of file to volume.

I hope that this will give you some idea that is applicable in your case.

Regards,
Slobodan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do have an opinion on the effectiveness of Microsoft Windows Mobile and Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Even though I vote for the bootsector.DOS loaded by ntldr solution (the code is definitely really simple and just a few INT 13
calls), there are many solutions as Slobodan mentioned.

In one of "high level" approaches where I did not have a full control of the hardware (could not change partition layout), I had to
go with a quick solution - I just used ntldr to boot another XPe image from the same partition. The second "recovery" image was
loading a set of batch files to *prepare* the main XPe image. Since you are able to change boot.ini through a batch, the entire
procedure is easy to automate (only the procedure initiation is required).
 
Hi Per,

You will need to delete some registry entries like:
SystemPartition and all entries from MountedDevices.
You can do that from offline registry or just before last shutdown prior to making SDI file.

This will allow you to see all partition on HDD and that windows do not use them so you can access them from diskpart of Disk
Management, or some script perhaps.

http://groups.google.com/groups?hl=...a=group=microsoft.public.windowsxp.embedded.*

Best regards,
Slobodan
 
Thanks!
Just to confirm, removing the SystemPartition key in the registry before
creating the SDI image works.
However, it turned out that I needed some more complex things than just a
simple script or batch file. Using the Win32 API DeviceIoControl to get the
disk layout I could resize and set the new layout. then format the system
partition. Took me a little while to get everything right (using VB), but it
finally worked.
With this solution I could also easily detect if the device was using an
overlay partitions or unused space on the disk(s).
The recovery CD will be a success!!

Thanks for your great help!

Per
 
Hi Per,

Diskpart.exe can be scripted. Also there are override directive that allow you to delete any partition all whole MBR and to create
partitions from scratch.
So partitioning, formatting and file extraction could be done trough one batch file only. No need for API, etc.

Best regards,
Slobodan
 
Ok, now I understand what you want to do.
Then API is the best way to proceed.

Best regards,
Slobodan
 
Per,

Well.. it were a question for CE, I would suggest you much more interesting and easy to use API to accomplish what you wanted. :-)
But under Windows Desktop, I don't know any good documented APIs that helps you as much. Some info could be retrieved from
GetDiskFreeSpaceEx/GetVolumeInformation/FindFirstVolume/etc.

So, I guess, your decision to stick with DeviceIoControl was right.

Btw, there are some good useful 3rd party "hard disk" SDKs exist. This one I like: http://www.paragon-gmbh.com/n_hdm_sdk.htm.
This is not to say you are better use the SDK but just FYI...
 
Back
Top