Jump to content











Photo
- - - - -

Recovery Console not working from USB Stick


  • Please log in to reply
159 replies to this topic

#26 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 02 August 2008 - 04:31 PM

..you got me:-)

Sure :cheers:, I knew you would have tried cheating! :cheers:

Its not always easy getting the answer from you, but one learns something on the way...:-)


Experience: that most brutal of teachers. But you learn, my God do you learn.

:cheers:

See you next week, for the "fine tuning", and further "tricks".

:cheers:

jaclaz

#27 pecd.net

pecd.net

    Silver Member

  • .script developer
  • 947 posts
  •  
    Germany

Posted 04 August 2008 - 05:33 PM

so, here i am again:-))

i now have a working version for USB Sticks, i boot it from grub with this

title Windows XP SP2 Recovery Console English
find --set-root /CMDCONS/SETUPLDR.BIN
chainloader /CMDCONS/SETUPLDR.BIN
write 0x7C03 0x63646D63
write 0x7C07 0x00736E6F

but this version can not be bootet from a cd (iso in vmware for testing). A Ntdetec message comes up and then it reboots.

So i assume something is different when booting from cd. I also noticed that from USB case seems not to matter much (i once misstyped "find --set-root /CMDCONS/setupldr.bin" which works from USB but not from ISO). Can you explain to me how the CD boot process is different from the HD boot process? I would really like to get my RC universal or to have a script that changes it when it is transfered to USB. Thanks!

#28 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12,436 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 04 August 2008 - 05:50 PM

so, here i am again:-))

i now have a working version for USB Sticks, i boot it from grub with this

title Windows XP SP2 Recovery Console English
find --set-root /CMDCONS/SETUPLDR.BIN
chainloader /CMDCONS/SETUPLDR.BIN
write 0x7C03 0x63646D63
write 0x7C07 0x00736E6F

but this version can not be bootet from a cd (iso in vmware for testing). A Ntdetec message comes up and then it reboots.

So i assume something is different when booting from cd. I also noticed that from USB case seems not to matter much (i once misstyped "find --set-root /CMDCONS/setupldr.bin" which works from USB but not from ISO). Can you explain to me how the CD boot process is different from the HD boot process? I would really like to get my RC universal or to have a script that changes it when it is transfered to USB. Thanks!

Allow me a bit of fantasy ...

We delete ALL 'bootable something' creating scripts in ALL porojects.

And somebody writes one (ande only one) CreateBootItem.Script which contains (expandable) the options
  • Standard ISO
  • ISO with FBWF
  • ISO with (misnamed) BootSDI
  • USBStick Format with
    • ???
    • ???
  • Standard USB Stick
  • USB Stick with FBWF
  • etc. etc.
If I currently would not be too engaged in current WB development with items like 'Proxy', 'RawReg Editor', I would try.

Perhaps there is somebody else to try?

Peter

#29 pecd.net

pecd.net

    Silver Member

  • .script developer
  • 947 posts
  •  
    Germany

Posted 04 August 2008 - 05:59 PM

Hmm, i believe this will get a bit too complex to make it work with all projects, but first i am trying to get the vpe version to work at least 99% so that the normal dummy (as well as the expert dummy) user can get a working stick:-))

With the original USB Stick support i had trouble as several combinations just did not work, and it was not clear what works an what not. so i want to make a more fool proof version that just works.-)

#30 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 04 August 2008 - 06:15 PM

@ctmag
Maybe I got you again, :cheers:
Do READ here:
http://www.msfn.org/...n...5.html&st=2

:cheers:

I never tried if there is a way to boot "directly" into RC from CD.

I will try to have a look at it, and will let you know.

But booting through the Setup blue screen is what the Recovery CD made by the batch does.

So What have you done to change it's behaviour on USB stick:
1) Renamed \i386 to \CMDCONS
2) Added a WINNT.SIF in \CMDCONS
3) Loaded it with CMDCONS bootsector substiitution

To revert:
1) Rename \CMDCONS to \i386
2) Delete \i386\WINNT.SIF
3) Load it "normally":
title RC on CD

find --set-root /WIN51IP.SP2

chainloader /i386/setupldr.bin
(of course you now need "back" the CD tag files WIN51, WIN51IP and WIN51IP.SP2)

You can remove the need for tag files by editing TXTSETUP.SIF:
http://www.msfn.org/...showtopic=65541
http://www.msfn.org/...ite-t99385.html

It is strongly suggested to add the "No more CATCH 22" trick, as otherwise the utility of RC is greatly reduced:
http://www.911cd.net...o...20983&st=25

A further step, as explained in the 911CD thread is to remove the loading of obsolete and unneeded drivers, which makes RC much snappier when loading.

Finally, you can HexEdit SETUPLDR.BIN to have the SAME directory both on CD and USB, but that won't allow for booting directly. Maybe it is possible to further hexedit SETUPLDR.BIN, but I haven't seen it documented anywhere.

jaclaz

#31 pecd.net

pecd.net

    Silver Member

  • .script developer
  • 947 posts
  •  
    Germany

Posted 04 August 2008 - 07:00 PM

so much info...just not enough time to read all posts in the links...but i try:-)

#32 pecd.net

pecd.net

    Silver Member

  • .script developer
  • 947 posts
  •  
    Germany

Posted 06 August 2008 - 06:41 AM

when running from cd (blue con with "R") the catch22 trick does not work (the fake installation is not found)

The cd drive is drive D:

any idea how to make this work?

#33 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 06 August 2008 - 10:08 AM

Sure, have you ever heard of a Windows installation on a CD? :cheers:

...and yes, it can be done :cheers::
http://www.boot-land...?showtopic=3890

but it was not "designed" by MS.

Now that you have tested extensively the features of the two methods (HD vs CD), I'll introduce you to the next step, which is simply that of using RAMDISK booting (SETUPLDR.BIN and RAMDISK.SY_/RAMDISK.SYS from Server 2003 SP1 or R2).

Using a RAW disk image, you can have RC on a smallish image, less than 10 Mbytes, that is loading in a flash and that has all the features of the "HD" versions even if booted from "CD".

And that's another reason to reduce as much as possible the number of files and size of the RC.

Just post if you need more details.

jaclaz

#34 pecd.net

pecd.net

    Silver Member

  • .script developer
  • 947 posts
  •  
    Germany

Posted 06 August 2008 - 02:34 PM

I have used this ramdisk method with bartpe before, but i can not use it here as i do not have the 2003 files and my solutions must be work with no manual interaction and (if really needed) only small downloads from the web... and both is not possible with the server2003 files afaik:-(

Well for me ist enough on the subject RecoveryConsole. Th final script is acceptable, works from usb and cd and even has the catch22 trick included for the usb version:-)

#35 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 06 August 2008 - 11:11 PM

Just post if you need more details.


Do you have a link? I'm curious as a while ago I attempted to ram-boot Recovery Console without success.

Thanks,
Galapo.

#36 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 07 August 2008 - 09:31 AM

Do you have a link? I'm curious as a while ago I attempted to ram-boot Recovery Console without success.

Thanks,
Galapo.


NO link, sorry.

I'll have to find the tests I made and put together a report, it will take some time, though, I simply cannot find where I stored those tests. :cheers:

And I seem not to be able to repeat them fully from scratch, I'm getting old....:cheers:

:cheers:

jaclaz

#37 ilko

ilko

    Frequent Member

  • Advanced user
  • 487 posts
  •  
    Bulgaria

Posted 07 August 2008 - 07:52 PM

Do you have a link? I'm curious as a while ago I attempted to ram-boot Recovery Console without success.

Thanks,
Galapo.

Whats the goal? Would this link be useful, in second half it's about RAM boot of text mode setup, recovery console is similar:
http://www.msfn.org/...en-t119742.html

#38 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 07 August 2008 - 10:53 PM

Whats the goal?


There was only two for me: a) seeing if it was possible, which would lead to b) less usb-stick file clutter since ram-boot would ideally be booting a single image containing RC.

Thanks for the interesting link!

Regards,
Galapo.

#39 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 08 August 2008 - 06:59 PM

I am stumped! :cheers:

I could have sweared that I was able to build a RAMDISK booting RC, but I must have been mistaken.

RAMDISK booting the XPRC.ISO is perfectly possible.

As well I am working towards a reduced .IMG version.

But I seem not to be able to start either with the /cmdcons switch, nor with the edited bootsector, nothing.:cheers:

SO you have to go through the Setup bluescreen anyway.

Moreover, the RAMDISK appears to not be parsed for "existing installation", probably it is seen as a "superfloppy", thus the CATCH 22 does not work.

@Galapo
Having a \CMDCONS directory on ROOT of the stick and booting directly appears to be the best option.
The alternative (if one wants/needs the CATCH 22 trick) is to have a \CATCH22 directory with the config files.
Booting form CD/DVD the above appears not possible. :cheers:

I am not done (yet :cheers: ) with it, but I seem to find not a way.

For the moment just the "normal" way.

To ramdisk boot from stick:
1) .ISO file
1.1) Create a XPRC.ISO as per the Laurie batch, replacing the ramdisk.sy_ file in \I386 with the 2k3 SP1 version and add AUTOCHK.EXE to \I386.
1.2) Use to load SETUPLDR.BIN of Windows 2003 SP1 with this WINNT.SIF (in ROOT of stick)
[SetupData]

BootDevice = "ramdisk(0)"

BootPath = "\I386\"

OsLoadOptions = "/noguiboot /fastdetect /rdexportascd /rdpath=XPRC.ISO"

2) .IMG file
2.1) Create a RAW HD image, 10 Mb in size is enough, name it XPRC.IMG
2.2) Copy to it the entire \I386 directory of the modified XPRC.ISO above
2.3) Use to load SETUPLDR.BIN of Windows 2003 SP1 with this WINNT.SIF (in ROOT of stick)
[SetupData]

BootDevice = "ramdisk(0)"

BootPath = "\i386\"

OsLoadOptions = "/noguiboot /fastdetect /rdexportashd /rdimageoffset=32256 /rdpath=XPRC.IMG"
(the rdimageoffset value is for a normal HD image with 63 hidden sectors)

Optionally add the CATCH22 directory to ROOT of stick (attached).

When booting, connect to CATCH22 and type:
batch setallon

:cheers:

jaclaz

Attached Files



#40 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 09 August 2008 - 09:58 AM

I am stumped! :cheers:


That's OK. If there's a way, I'm sure you'll find it. In any case, I'm happy with the information provided.

For the moment just the "normal" way.


Thank you indeed! I have a feeling I was the offset when I was trying earlier in the year.

Regards,
Galapo.

#41 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 23 August 2008 - 11:27 AM

OK, peeps. :whistling:

I have some good news and some bad news......

BAD NEWS first ;) :
Either:
1) I am really getting old, and my memory is getting increasingly worse
2) I am still the good'ol' jerky jaclaz that is able to lose files by either misplacing, backing them up somewhere where they should not be, delete them by accident or whatever

I could not find ANYWHERE my old test images and notes! ;)

But here are the GOOD NEWS ;) :
I managed to directly boot Recovery Console within ramdisk(0).

This fact justifies the following peruse of the walk like an Egyptian thingy :):
:) :) :) :) :)

I've tried every trick of the trade, and even some more ones, and got nothing, until I made a "redundant" image, with files in ALL of the directories:
/CMDCONS
/i386
/minint
/$WIN_NT$.~BS
and got nothing, until i did the MSDOS5.0->cmdcons trick on the bootsector of the ramdisk loaded image and guess what?

SUCCESS!! :)

Basically:
1) the bootsector of the ramdisk loaded image (a hard disk image named RCXPd.dsk in my case) must be edited MSDOS5.0->cmdcons and invoke SETUPLDR.BIN
2) Recovery Console files must be in \CMDCONS
3) ramdisk.sy_ from server 2003 SP1 must be in \CMDCONS
4) SETUPLDR.BIN and NTDETECT.COM from Server 2003 SP1 must be in ROOT
5) the WINNT.SIF must be in \CMDCONS, with just this content:
[data]

CmdCons="1"
6) and here comes the clever part:
you need an additional \I386 directory containing:
a copy of TXTSETUP.SI_

Booting of the image is done from the "main" drive or image with grub4dos with this entry:
title Ramdisk booting RC

find --set-root /RCXPd.dsk

map /RCXPd.dsk (hd31)

map --hook

root (hd31,0)

chainloader /setupldr.bin

In the ROOT of "main" drive or image there is a WINNT.SIF with these contents (example):
[SetupData]

BootDevice = "ramdisk(0)"

OsLoadOptions = "/noguiboot /fastdetect /rdexportashd /rdimageoffset=32256 /rdpath=RCXPd.dsk"

I was tempted to use the good ol' "Fermat" approach to the demonstration of some of his theorems:
http://en.wikipedia.org/wiki/Fermat's_little_theorem
http://en.wikipedia.org/wiki/Fermat's_last_theorem
something like:

I would post the details, if I did not fear its being too long

or:

I have a truly marvellous proof of this approach to recovery console which this screen is too narrow to contain

;)

but though getting oldish and forgetful, I am still after all a nice guy. :)

Next steps:
1) Remove "oldish" unneeded drivers
2) Minimize TXTSETUP.SIF/TXTSETUP.SI_ from 461 Kb/74 Kb
(I made a test where TXTSETUP.SIF/TXTSETUP.SI_ were 8 Kb/3 Kb, but it needs a few betterings)
3) find a "modular" way to remove/add drivers and remove unused keyboard mappings
4) find a way to avoid the 5 seconds delay for different keyboard layout choosing
5) find the smallest possible image size and "better" filesystem for it
6) automate the whole thing via batch
7) some other semi-random ideas that may come out

Anyone willing to help for any of the above? :)

jaclaz

#42 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 23 August 2008 - 11:43 AM

Hi Jaclaz,

WOW, you did it!

I guess Peter's RC project could be expanded to include ram-booting option.

I'm not entirely sure of this step:

i did the MSDOS5.0->cmdcons trick on the bootsector of the ramdisk loaded image and guess what

1) the bootsector of the ramdisk loaded image (a hard disk image named RCXPd.dsk in my case) must be edited MSDOS5.0->cmdcons and invoke SETUPLDR.BIN

That is, how do we get a MSDOS5.0 bootsector and what in it is to be edited.

Regards,
Galapo.

#43 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 23 August 2008 - 02:37 PM

I'm not entirely sure of this step:
That is, how do we get a MSDOS5.0 bootsector and what in it is to be edited.


Galapo, Galapo, you did not do your homework:
http://www.boot-land...opic=5316&st=21
(point 7) :whistling:)

;)

jaclaz

#44 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 23 August 2008 - 10:01 PM

Crazy thing is at the link you gave there is this more detailed link: http://www.boot-land...topic=2362&st=7

And I remember reading that now -- but I'd forgotten ever even reading it when I posted above!

Deary me...

Thanks, I'll try to reproduce your results early next week.

Regards,
Galapo.

#45 cdob

cdob

    Silver Member

  • Expert
  • 977 posts

Posted 24 August 2008 - 09:32 PM

BAD NEWS first :whistling: :
Either:
1) I am really getting old, and my memory is getting increasingly worse
2) I am still the good'ol' jerky jaclaz that is able to lose files by either misplacing, backing them up somewhere where they should not be, delete them by accident or whatever

I join the club.
Worse, I am getting old, memory is fading and I lose files.
Previous recovery console images are gone, deleted by intention. It's a 2gb USB flash only. Space is precious.

Yes, your current reovery console approach does work.
True, patching loaded image is required. Set cmdcons at partition boot sector.
Grub4dos "cmdcons" to memory did failed. This dosn't match 2003 setupldr.bin RAM loading.

I used
title Ramdisk booting RC

find --set-root /cmdcon2.img

map /cmdcon2.img (hd0)

map --hook

rootnotverify (hd0,0)

chainloader (hd0,0)/setupldr.bin

#this fails:

#####################################################################

# write string "cmdcons" to memory 0000:7C03 in 2 steps:

#####################################################################

# step 1. Write 4 chars "cmdc" at 0000:7C03

#write 0x7C03 0x63646D63

# step 2. Write 3 chars "ons" and an ending null at 0000:7C07

#write 0x7C07 0x00736E6F

boot
Well boot sector calls ntlr still, hence the chainloader (hd0,0)/setupldr.bin.

winnt.sif
[SetupData] 

BootDevice = "ramdisk(0)" 

BootPath = "\cmdcons\" 

OsLoadOptions = "/noguiboot /fastdetect /rdpath=RAMLOAD.IMG /rdimageoffset=0"
Recogince the BootPath. There dosn't exist a file \i386\txtsetup.sif.
There is \cmdcons\txtsetup.sif only.


Another approach: Cansas city shuffle.
XP files only used. Chain boot does work at recovery console too.
title cmdcons.img Recovery Console - ChainBoot this drive

map --read-only /cmdcons.img (hd0)

map --hook

rootnotverify (hd0,0)

chainloader (hd0,0)/cmdcons/setupldr.bin

#####################################################################

# write string "cmdcons" to memory 0000:7C03 in 2 steps:

#####################################################################

# step 1. Write 4 chars "cmdc" at 0000:7C03

write 0x7C03 0x63646D63

# step 2. Write 3 chars "ons" and an ending null at 0000:7C07

write 0x7C07 0x00736E6F

boot

Simple approach (some files maybe deleted in addition, not tested):
all recovery console files inside file cmdcons.img
in addition at USB stick

\cmdcons\AUTOCHK.EXE
\cmdcons\AUTOFMT.EXE
\cmdcons\DRVMAIN.SDB
\cmdcons\KB*.DLL
\cmdcons\SYSTEM32\NTDLL.DLL
\cmdcons\SYSTEM32\SMSS.EXE



#46 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 25 August 2008 - 09:15 AM

I join the club.

Welcome to the club. :)

winnt.sif

[SetupData] 

BootDevice = "ramdisk(0)" 

BootPath = "\cmdcons\" 

OsLoadOptions = "/noguiboot /fastdetect /rdpath=RAMLOAD.IMG /rdimageoffset=0"
Recogince the BootPath. There dosn't exist a file \i386\txtsetup.sif.
There is \cmdcons\txtsetup.sif only.


That's the part that was failing for me, hence the second copy.

I was using "BootPath = \CMDCONS\", though.
Would it be possible that CaSe MaTtErS? ;)
Or would the fact of txtsetup.sif being used instead of the compressed "txtsetup.si_" (maybe this is more probable) ;)

I am definitely sure (within the limits of my failing memory ;)) that I had never used the "double" txtsetup.si_ before, and actually at the time I was making the tests, I was using one of my "reduced" txtsetup.sif, uncompressed because I was too lazy to re-compress it after having edited it.

Il''retry with "\cmdcons\" nad unncompressed txtsetup.sif..... :whistling:

;)

jaclaz

#47 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 25 August 2008 - 01:32 PM

Smallish update:
It seems like it is not a problem of compressed/uncompressed files or whatever, the essential difference with cdob's menu.lst entries appears to be I was mapping the image to (hdn), whilst he maps it to (hd0) (First Drive).

I tried replicating cdob's first approach, and while I was getting RC loading ;), I later got a STOP 0X0000006b in Qemu, or some times, a 0x0000007b one :whistling:

Further tests are needed.... I seem not be able to replicate properly

jaclaz

P.S. @cdob:
there is a small typo here:

rootnotverify (hd0,0)

BTW "normal" root is always preferred, and you should post a complete description of each single setup you testes, first entry looks for cmdcon2.img, the WINNT.SIF to RAMLOAD.IMG (with rdimageoffset=0 ;)) second entry looks for cmdcons.img ;), I am not sure where you did have (inside the image or on base partition) your WINNT.SIF....

#48 cdob

cdob

    Silver Member

  • Expert
  • 977 posts

Posted 25 August 2008 - 04:29 PM

Sorry for confusion. Today I can't repeat results from yesterday.
Of coure testing files are overwritten already ;)
Neither can I RAM boot recovery console anymore.
I get: File \$WIN_NT$.~BT\biosinfo.inf could not be loaded.
Bootsector contains cmdcons still, however setup use installation mode.
Currtently I suspect file location.
Or a insane user :whistling:

Second approach cmdcons.img does contain files at \cmdcons.
Remember "XP Kansas city shuffle" http://www.911cd.net...&...st&p=147613
http://www.911cd.net...showtopic=21242
In addition there are some selected files at USB drive \cmdcons.
This approach does boot still today.

#49 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3,841 posts
  •  
    Australia

Posted 26 August 2008 - 02:59 AM

After playing around, this (or varient version) is probably the easiest solution:

2) .IMG file
2.1) Create a RAW HD image, 10 Mb in size is enough, name it XPRC.IMG
2.2) Copy to it the entire \I386 directory of the modified XPRC.ISO above
2.3) Use to load SETUPLDR.BIN of Windows 2003 SP1 with this WINNT.SIF (in ROOT of stick)

[SetupData]

BootDevice = "ramdisk(0)"

BootPath = "\i386\"

OsLoadOptions = "/noguiboot /fastdetect /rdexportashd /rdimageoffset=32256 /rdpath=XPRC.IMG"
(the rdimageoffset value is for a normal HD image with 63 hidden sectors)


I was unable to get a RAW fat image to mount and boot properly using grub4dos mapping.

The following attached script automates the process in Peter's BSOR project. Replace 'BSORISO.script' with the attached modified script (note: requires WB 075b4 or above).

Regards,
Galapo.

Ps: for those downloading Jaclaz's 'catch22' archive above, to get it to work you'll need to create an empty 'drivers' folder under '\system32'.

#50 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7,100 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 26 August 2008 - 06:53 AM

I was unable to get a RAW fat image to mount and boot properly using grub4dos mapping.


The RAW image must be a Hard disk image, not a "partition" or "superfloppy" image like those made with IMDISK.

Use my MKIMG/MRBATCH
MKIMG
<image name>
10M
16/63
01
/fsz

grub4dos will tell you that the image is somehow wrong (it actually is :whistling:) but will work allright.

To avoid the grub4dos warning, use a "correct size":
10Mb=10x1,024x1,024=10,485,760 bytes
10,485,760/512=20,480 sectors
20,480/63=325.0793.... heads
326/16=20.375 cylinders
Then:
21x16x63x512=21,168 sectors 21x16x63=21,168 sectors <- ERRATA CORRIGE
21,168*512=10,838,016 bytes

MKIMG
<image name>
10,838,016
16/63
01
/fsz


The offset of the image for WINNT.SIF is 63x512=32256.

jaclaz