LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   A question on GRUB and NTLDR (https://www.linuxquestions.org/questions/linux-newbie-8/a-question-on-grub-and-ntldr-722022/)

saagar 04-27-2009 11:38 AM

A question on GRUB and NTLDR
 
Hello Friends..

My question is as follows:

Once we install XP, ntldr will be occupying the MBR. But later if we install Linux (dual booting), GRUB (stage I) will be occupying the MBR. My doubt here is, to which location the ntldr will be placed?. Will GRUB put the ntldr to a windows partition and then later will chainload the ntldr from the Windows partition to RAM when the user selects the XP operating system from the Boot menu?....
I can understand the chainloading concept (a bootloader loading another bootloader), but what i wish to know is, is the ntldr is taken off the MBR and placed to a different place when GRUB is placed in MBR?

please pardon if my concept is wrong. Thank you.

yancek 04-27-2009 12:17 PM

The stage1 file of Grub is placed in the mbr in your scenario but all of the Grub bootloader files are not, obviously since the mbr is only 512 bytes. Grub doesn't place ntldr anywhere, it is installed to the root of the windows partition (usually C:\). Not using windows I'm not sure what file xp puts in the mbr. In my W98 install it was a file called bootsect.dos, which is 512 bytes just like stage1 in Grub.

Grub basically just points to where the windows bootloader is (or should be) on the windows partition.

pixellany 04-27-2009 02:55 PM

Yes, NTLDR is the name for what Windows uses after the initial boot code. I suppose it is analogous to something like GRUB stage 1.5 or 2.

Windows puts boot code in the MBR which is analogous to GRUB stage 1.

sundialsvcs 04-27-2009 07:18 PM

The documentation for Grub is actually quite extensive about just how it is able to boot Windows. (This is not an "RTFM" response!)

When you boot NT natively:
  • The MBR passes control to NTLDR.
  • NTLDR boots the system.

Basically, when you're using Grub:
  • The MBR passes control to Grub.
  • You choose to boot Windows.
  • Grub hands-off control to NTLDR in exactly the same way that the MBR would have done.
  • Your computer hardware whines because you are once again forcing it to endure Windows instead of a nice, civilized operating system like Linux. ;)
  • NTLDR boots the system.

dxqcanada 04-27-2009 07:25 PM

As per Wikipedia:

The conventional MBR code expects the MBR Partition Table scheme to have been used, and scans the list of (primary) partition entries in its embedded partition table to find the only one that is marked with the active flag. It then loads and runs the Volume Boot Record for that partition.

saagar 04-27-2009 09:46 PM

Thank you friends for all your responses. Let me type what I understood:

NTLDR will be installed not in the MBR, but in the active partition of Windows and the partitition table entry with the active flag set will be used for booting and that is where ntldr is stored.
Is it right?


All times are GMT -5. The time now is 01:20 PM.