Regarding IT

Tuesday, September 05, 2006

MBR to boot to Recovery partition

Pressing F10 during bootup (specifically, after BIOS POST and just before Windows boots) will boot to the Recovery partition to allow recovery of the Operating System partition. Re-partition the disk and this will stop working.

A custom Master Boot Record (MBR) is used to check for F10 and boot to the second partition instead of the first, and re-partitioning will reset the MBR to the default.

Poking around on the HP QuickPlay partition revealed MBRInst.exe in the root folder. It can re-write the MBR to get back the F10 feature, and exposes more options to control how it works, like providing a prompt and countdown.

I've tested it in a Virtual Machine, and it works, but did not play with all the options. Don't dare do it for real, as I don't really need the Recovery partition at this point...

Chicken!

Saturday, September 02, 2006

Inside the HP Quick Play partition

An interesting side-effect of getting the Recovery Console to work is that the Recovery Console can actually mount the HP QuickPlay partition! The 1st partition is the "user" Windows XP Operating System, the 2ndis the hidden Recovery partition, and the 3rdis the QuickPlay partition.

This notebook is a showcase for Windows technology. The Recovery partition is made using Windows Preinstallation Environment (WinPE), QuickPlay is made possible by Windows XP Embedded (Win XPe).

Using the Recovery Console, one can have a look at the QuickPlay partition's boot.ini file:

[boot loader]
timeout=0
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Embedded" /fastdetect /maxmem=256


Starting and stopping QuickPlay actually sets XPe to hibernate, and by limiting the amount of RAM and the applications running, QuickPlay manages to boot faster and conserve battery. Good stuff.

A closing comment - it's really easy to make a WinPE-type of bootable CD using Bart's PE Builder and CDShell. Both work as advertised and are free, but require some pretty technical knowledge.

Recovery Console Tweak

Once you've got the Recovery Console installed, this tweak will enable the SET command, which will in turn, enable access to all files and folders, among other things. Save this fragment as ConfigureRecoveryConsole.Reg or similar, or manaully change the settings using RegEdit:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Setup\RecoveryConsole]
"SetCommand"=dword:00000001
"SecurityLevel"=dword:00000000


BTW, setting SecurityLevel=1 will cause the Recovery Console not to require administrator password.

Anyway, once done, the following commands SET commands will be enabled (actually, all can be entered using one SET command):

set AllowAllPaths = true
set AllowRemovableMedia = true
set AllowWildCards = true
set NoCopyPrompt = true


Lots of good information on the web, so I won't reapeat. Check out the articles at commandwindows.com and theeldergeek.com.

Recovery Console and SATA disk

The Windows Recovery Console is, to me, an essential install. Normally, from the Windows XP/2000/2003 CD, just run "X:\i386\winnt32.exe /cmdcons" to install (where X: is the CD drive, or alternatively, C: since most pre-installed notebooks include all the setup files in C:\i386)

So imagine my horror when upon re-booting to test it, I was greet with a Blue Screen of Death and a STOP error! Testing with the Recovery Console directly off the CD also gave the same result.

A little research found me the reason: SATA hard disks require a driver that is not included with XP! Normally, when the Windows CD boots, it's possible to install the driver at the "Press F6 if you need to install a third party SCSI or RAID driver..." prompt, but this will load the drivers of a floppy drive. But of course, modern notebooks have no floppy drives!

Again, I couldn't find the solution on the web, but fortunately, by examining the Recovery partition, I managed to figure this out.

First, in the Device Manager, display the SATA Controller properties. In my case, its an Intel(R) 82801GBM SATA AHCI Controller. The Driver Details... button on the Driver tab will show the driver filename (iaStor.sys for me). Next, check the "Matching Device Id" in the Details tab to find the string the uniquely identifies the hardware ("PCI\VEN_8086&DEV_27C5&CC_0106").

Okay, now, in the \cmdcons folder, edit txtsetup.tif. In the section [SourceDisksFiles] add:

[SourceDiskFiles]
iaStor.sys = 1,,,,,,4_,4,1,,,1,4


In the section [HardwareIdsDatabase] add the following (most will not be needed, only the one matching the ID previously is required):

[HardwareIdsDatabase]
PCI\VEN_8086&DEV_25B0&CC_0104= "iaStor"
PCI\VEN_8086&DEV_24DF&CC_0104= "iaStor"
PCI\VEN_8086&DEV_2652&CC_0104= "iaStor"
PCI\VEN_8086&DEV_27C5&CC_0106= "iaStor"
PCI\VEN_8086&DEV_2653&CC_0106= "iaStor"
PCI\VEN_8086&DEV_2652&CC_0106= "iaStor"
PCI\VEN_8086&DEV_27C3&CC_0104= "iaStor"
PCI\VEN_8086&DEV_27C1&CC_0106= "iaStor"


In [SCSI.Load] and [SCSI] sections respectively, add:

[SCSI.Load]
iaStor = iaStor.sys,4
[SCSI]
iaStor = "Intel(R) SATA RAID Controller"


Finally, from command line, use makecab to compress the driver file:

C:\windows\system32\drivers\iaStor.sys C:\cmdcons\iaStor.sy_

And that worked for me!

BTW, Intel has more information on integrating the driver into an XP unattended installation.

ResetRmc for Recovery CDs

In case the original post ever disappears, I'm regurgitating the relevant bits here. Download ResetRmc.exe from Gateway and un-zip with the password "G8way!" (without the quotes). There is no UI, so just run and check to see if the Recovery Disc creator works. Here's an alternative download.