Jump to content

Modifying MBR to boot to second partition


Recommended Posts

I am, once again, trying to find an alternate solution to running a system recovery than using the software we currently use. This time, instead of duplicating their recovery partition in order to redeploy with Imagex, I am making one of my own. To do this, I built a custom Win PE that launches a Flash Projector app that the user can use to recover the C drive. I have not been able to see if this portion is working yet as I am having a problem getting it to attempt to boot to the second partition, or even the main partition.

Jaclaz has mentioned a MBR app here: http://www.msfn.org/board/index.php?showto...st&p=769544

Which I must not be using properly. Let me run down the steps I've gone through so far, and how the system behaves after the reboot.

1. Boot into our normal PE and run the following in diskpart:

select disk 0
create part pri size=62220
assign letter=c
format fs=ntfs quick
create part pri
select part 2
assign letter=d
format fs=fat32 quick

2. Deploy the image to C, which is a Windows XP Pro SP2 x86 image.

3. Deploy the recovery image onto drive D

4. open up diskpart again

select disk 0
select vol 1
att vol set hidden
att vol set nodefaultdriveletter

5. Run mbr program (its in the recovery partition)

mbr 0 /install selm 5 11 "Press F11 for recovery" 0xC 0x52

6. Restart the PC.

If I let the computer boot normally, it reboots by itself and loops this way. This is fine atm because I don't care if it can boot into Windows.

If I press F11 when the prompt comes up, it reports that it cannot find boot media, or if LAN boot is enabled, it tries to boot of the IBA (Intel Boot Agent).

So I am thinking I am missing a step. Any ideas? The method of installing the MBR or the bootloader needs to be a 32bit app so that I can run it from the PE after imaging.

Link to comment
Share on other sites

OK I found out why the C drive wouldn't boot. Diskpart showed both Vol 0 and Vol 1 to be HIDDEN NODEFAULTDRIVELETTER. So I clear those attributes on Vol 0 (Drive C) and it cleared it on both volumes. I assigned a letter to Vol 0 (C:) and Vol 1 (D:) but for some reason if I mark Vol 1 as HIDDEN, both volumes get marked HIDDEN. And yes, I am using sel vol 0 and sel vol 1.

So at this point, neither of the above MBR commands allow it to find the second partition.

Link to comment
Share on other sites

Some (small sketchy) info here - http://support.microsoft.com/kb/300415

XP TechNet - http://technet.microsoft.com/en-us/library/bb490893.aspx

Another more organized reference here - http://www.geocities.com/rick_lively/MANUA.../D/DISKPART.HTM

So is this a difference between using VOLume as apposed to PARTITION? I see that using VOL when using basic disks assumes "partition". In addition, it seems that somehow you may need to set the Recovery Partition to Active (has to be one active, you know). I have noted in the past (AFAIKR) that if only one partition exists then that partition will boot. Could be because on Compaq/HP (past experience), the BIOS "sees" only one and "decides" to boot to it; could have been because the Disk Boot Code (MBR)(before the Partition Boot) was "special code" by the OEM to set the only to active or just "go there" (kind of like Grub4Dos, also kindly provided by Jaclaz).

Any help here?

Edited by submix8c
Link to comment
Share on other sites

I got it to work, and also know why the attributes were being assigned to both volumes. This happened because the partition table is set up as MBR and not the GUID method.

Terrabyte Unlimited has a tutorial (of sorts) to set up a recovery partition. They also have a second revision.


I had to do some additional commands with MBR.EXE also. These in the image phase:

mbr 0 /install selm 5 11 "Press F11 for recovery" 0xC 0x1C
mbr 0 1 /h

The second, sets the second partition to hidden, so it does not appear in Windows. It still appears in DISKPART but it does not display the HIDDEN attribute, but it is still hidden anyways. Also have to add this to the boot process of the OS on the recovery partition:

mbr 0 /reset

This makes it so after you reboot from the recovery partition, it sets it back to being hidden and makes the first partition active, to allow you to boot into Windows again.

For now I am working on getting my custom software to work off the recovery partition, and for that I will make a post in the Windows PE forum.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...