Jump to content

Grub Install Locations...


Lost In Cyberia

Recommended Posts

Hey everyone, while taking my morning and going through the GRUB manual:

Grub Install

I came across two questions that are picking at me. This is in regards to an MBR partitioned disk. There are apparently two "main" methods to installing GRUB to an MBR style disk. We can insert GRUB after the leading chunk of MBR on the disk, and before the first partition. Or we can install GRUB to a specified partition itself. (Usually the first). Do i have this right?



So my questions are thus:


1. If the first option is chosen, to insert the bootloader after the MBR, would we still have a /boot/grub directory? Or would this directory, along with the core GRUB img, (/boot/grub/i386-pc/core.img) be installed then in the area after the MBR?

2. Does this imply that having a /boot/grub directory and general grub files, mean that GRUB is installed on your partition?

3. I then read from other sources that GRUB is installed IN the MBR? Is this just a difference in syntax? It sounds like it's different than doing it after the MBR and before the 1st partition.

4. If you put /boot onto a separate partition. Does this work the same way as it being installed on say /dev/sda1 or /dev/sda2?


Thanks everyone, hope these make sense...

Link to comment
Share on other sites

The process is that, after POST, the BIOS tries to start the bootloader that should be in/referenced from within (not certain which it is, but I think it's the latter) the MBR of the first disk in the system. If you're only using 1 OS, this is what you use.

If instead you're using multiple OSes on the same machine, you have the main bootloader - the one from the MBR of your first disk - allow you to select which OS you want, which will then jump to the appropriate partition (or even drive - if you have 2 disks you can install the secondary OS' bootloader in the MBR of the second disk) and run the bootloader that's present there. This process is called "chain-loading", because you can keep jumping around like this to your heart's content.

2. Grub is a number of things, which is probably where your confusion stems from. First, it's a set of command-line tools to let you set up the bootloader. People call the bootloader grub aswell. The bootloader has 2 stages, which is primarily due to its size. I believe there's only 1 disk sector reserved for bootloading, meaning 512 bytes. Grub is bitter than that, so when you install the bootloader the first, 512 byte part (=stage) is installed where it ought to. This stage will provide a bootloading program that's sufficiently capable to identify and load the second part/stage. This second stage knows about filesystems (the other stage only knows disk sectors). Once the second part is loaded the bootloader gains the capability to access files on disk and can provide you with the required functionality. Having the grub-related files on your system implies that you indeed use grub, but if you're using LILO you can have those files on your system and they will be completely ignored. It's like having both IE and Chrome on your system - either's presence or even the fact that it's the default the OS will pick when needed does NOT imply it's the one you typically use.

3. The Master Boot Record. When it's "in" the MBR it means its on-disk location is specified within the MBR.

4. Yes, but when you install grub into the MBR you tell it what disk contains these files. This is incorporated into the second stage that's written to the disk so GRUB knows where to find what.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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