Re: Recover my XPe image
From: KM (konstmor_at_nospam_yahoo.com)
Date: 09/09/04
- Next message: Andrew Roy: "component database manager err: CMI 0x80042343"
- Previous message: JC: "Re: sp2"
- In reply to: Per Dunberg: "Re: Recover my XPe image"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 9 Sep 2004 09:46:02 -0700
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...
--
Regards,
KM, BSquare Corp.
> Hi Slobodan,
>
> Yes, that was my first idea and approach to this problem.
> I saved a temporary script file then use Diskpart to run this script. The
> problem I had was to know if my script was executed without errors or not. I
> guess you can run another script to see if the drive letter is missing and
> then check if it appears after you create a new partition. (No return codes
> from Diskpart...)
> For the overlay partition I couldn't find a way to detect it using a script
> but I guess it can be done somehow, also I could not erase whole disk since
> that would erase the customers data which resides on user partition on the
> same physical disk.
>
> If I only had to consider one specific software/hardware configuration then
> scripting would be most simple and quickest way.
>
> Thanks.
>
> Per
>
> "Slobodan Brcin (eMVP)" wrote:
>
> > 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
> >
> > "Per Dunberg" <PerDunberg@discussions.microsoft.com> wrote in message news:D10800D4-E232-409F-8C0A-53558CAF6BD5@microsoft.com...
> > > 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
> > >
> > > "KM" wrote:
> > >
> > > > Nothing to add here since Slobodan has already replied you with all the necessary info. :-)
> > > > Maybe just to refer to Slobodan's tip: http://msdn.microsoft.com/embedded/community/community/tips/xp/rtpartin/default.aspx
> > > >
> > > > --
> > > > Regards,
> > > > KM, BSquare Corp.
> > > >
> > > >
> > > > > Hi Guys,
> > > > >
> > > > > I've created a bootable CD that will work as a recovery and/or system update
> > > > > disc.
> > > > > I need to delete the previous system partition and create a new smaller
> > > > > system partition. I've tried to deleting the partition using "Diskpart.exe"
> > > > > but it doesn't work since it cannot delete system partitions. Even quick
> > > > > formatting the old partition doesn't work because "format.com" cannot perform
> > > > > this operation on a system partition. After booting from the CD that loads
> > > > > loads a RAM disk the configuration looks like this...
> > > > >
> > > > > C:\ RAM DISK
> > > > > D:\ SYSTEM PARTITION
> > > > > E:\ CD-ROM
> > > > >
> > > > > How can I delete my old system partition? (so I can create new smaller
> > > > > system partition) Is there any tool that can do this?
> > > > >
> > > > > Thanks for you help.
> > > > >
> > > > > - Per
> > > > >
> > > > > Ps. Thanks Slobodan for the tip about using RAM disk...great help!
> > > > >
> > > > > "KM" wrote:
> > > > >
> > > > > > 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).
> > > > > >
> > > > > > --
> > > > > > Regards,
> > > > > > KM, BSquare Corp.
> > > > > >
> > > > > >
> > > > > > > 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
> > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > > > >
> > > > > > > "Malvem" <velbony@yahoo.com.tw> wrote in message news:54e0dde9.0408030451.3714550f@posting.google.com...
> > > > > > > > Hi Slobodan,
> > > > > > > > Plz tell me more detail.
> > > > > > > > reimage? How to reimage?
> > > > > > > >
> > > > > > > >
> > > > > > > > Regards,
> > > > > > > > Malvem
> > > > > > > >
> > > > > > > >
> > > > > > > > "Slobodan Brcin \(eMVP\)" <sbrcin@ptt.yu> wrote in message news:<erZZaEIeEHA.720@TK2MSFTNGP11.phx.gbl>...
> > > > > > > > > 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
> > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >
- Next message: Andrew Roy: "component database manager err: CMI 0x80042343"
- Previous message: JC: "Re: sp2"
- In reply to: Per Dunberg: "Re: Recover my XPe image"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|