Thursday, 6 December 2018

ubuntu - Grub2 MBR vs. Windows MBR

I have an HP system that came with Vista installed and also a hidden restore partition. I subsequently upgraded to Win7(32 bit) Ultimate, and from there to Win7 Pro. Now the hard drive is failing. I managed to use partimage to grab the recovery partition (without errors) before I put it on ice in preparation for a freezer-based recovery of the Win7 partition.


On another drive I created 3 primary partitions and one extended partition:



  1. Recovery partition (NTFS)

  2. Win7 partition (NTFS)

  3. Ubuntu root (ext4)

  4. Ubuntu swap (ext4) (logical partition)


Next, I installed Ubuntu 10.4 and allowed grub2 to install the MBR. Then, I used partimage to populate the recovery partition with the image that I pulled off the failing drive. Now, before I attempt to recover the Win7 partition I want to be sure I can access the existing recovery partition. And I can't. I can see the files but I can not boot it up. Grub sees it as a Windows partiton and lists it in the menu. But when I try and boot to it I just stare at a blank screen with a blinking cursor. I tried to bypass grub by using gparted to make the recovery partition active and boot directly to that instead of grub, but I still boot into grub.


So with that background, let me pose my questions.



  1. As I understand it, the standard IBM/WIndows MBR code looks in the partition table for the first primary partition with the active/bootable flag set and then transfers control to the code it finds at the beginning of that partition, or the "partition boot record" (PBR). The PBR then locates NTLDR/BOOTMGR/grub/etc and loads it. Is my understanding correct?

  2. Where in the boot process is the interrupt key (f11 in the case of HP) to boot into the recovery partition handled? MBR? PBR? Boot manager/loader?

  3. When grub writes the MBR it also seems to use the rest of track 0 and the MBR code executes this code before moving on to load the rest of the grub code in whatever partition it is loaded in (in my case partition 3). In this sense it disregards the active/bootable flag in the partition table. Have I understood this correctly?


I am obviously missing some pieces here because I can not get my recovery partition to load. I would think the grub "chainloader" (why +1?) command would just exec PBR code. If this is true then something in my recovery partition is hosed.

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...