boot - What is the difference between primary and secondary bootloader?

07
2014-07
  • noobprohacker

    What is the difference between primary and secondary bootloader? Does primary and secondary refer to the two parts of the bootloader or two stages of the bootloader? I am confused.

  • Answers
  • JdeBP

    You're confused because it is an over-simplistic way of describing the process. If you've been reading the same IBM article as mentioned in primary and secondary boot loaders, which is one place where people seem to have drawn this primary/secondary notion from, note that it takes a rather narrow, Linux-only, view of the world (as it clearly states in its first sentence), that it was written in 2005, and that it is actually making a distinction between the same boot loader program (GRUB) installed in two different places on a hard disc (the MBR-virus area and a disc partition) rather than between two different boot loader programs, one "primary" and one "secondary".

    In reality, bootstrapping most operating systems for PC Compatible and workstation class machines (per the tag on the question) is a series of loader programs, each one loading the next. A primary/secondary distinction erroneously implies that there are only two programs, or (as in Thayne's answer) erroneously implies that only two out of the several programs in the sequence have special status as "primary" and "secondary", or erroneously implies that PCs nowadays necessarily even use boot loader programs in MBRs and VBRs at all.

    Three very brief examples of such chains with more than just two programs:

    • The loader program in an old-style PC98/PC-AT machine's firmware loads the loader program in the Master Boot Record which loads the loader program in the Volume Boot Record which loads the Basic Input/Output System part of PC-DOS/DR-DOS from the IBMBIO.COM file which loads the Basic Disc Operating System part of PC-DOS/DR-DOS from the IBMDOS.COM file.
    • The loader program in an old-style PC98/PC-AT machine's firmware loads the loader program in the Master Boot Record which loads the loader program in the Volume Boot Record which loads the OS2BOOT loader program which loads the OS2LDR loader program which loads the OS2KRNL program.
    • The EFI Boot Manager program in a new-style EFI machine's firmware loads the bootmgfw.efi program which loads the winload.exe program which loads the ntoskrnl.exe program.

    There's no good case for designating any of these as more "primary" than the others. Indeed, there's no good case for designating the loader programs built into the machine firmware as "primary". If one looks at TianoCore in detail, for one example, one finds that there's even a series of boot loading stages that occur within the firmware and that there's even a concept known as the Firmware File System. (Those both go well beyond the scope of this answer, though, as does the boot process of IBM MicroChannel Architecture machines, which loaded stuff from DASD before even the MBR boot loader program.)

    The fact that GRUB 1 rather famously had a "stage 1.5" should tell one by itself, even ignoring the fact that there's obviously another loader program that loads GRUB "stage 1" in the first place, that the idea that bootstrap sequences in the PC Compatible world are just two stages long, and bootstrap programs neatly divide into "primary" and "secondary", doesn't match reality.

    Further reading

  • Thayne

    The primary bootloader is the bootloader that is on the MBR. The secondary bootloader is on one of the partitions and is started by the primary bootloader.

    For example in a dual boot Linux and windows system, grub would be the primary bootloader and would load a secondary windows bootloader if windows was selected.


  • Related Question

    linux - Need alternative to booting from bootloader. Dead HARD DRIVE
  • liamzebedee

    The hard drive in my computer is dead and the Xubuntu installer is saying that it cannot install a bootloader on the external hard drive on which I am attmpting to install Xubuntu on. What is a fix? Could I possibly install GRUB on a USB drive and then load the OS on the External HDD from there?


  • Related Answers
  • paxdiablo

    Pull the disk out straight away and replace it with another.

    Install all the software you need on the new disk then copy whatever data you can off the old one by plugging it into an external drive container.

  • sarnold

    The standard Ubuntu LiveCD, once running, makes it pretty easy to make a new USB startup disk. But you might just want to disassemble your USB drive to use in your computer, if that drive is dead already.

  • Majenko

    Plop

    No, that's not me being rude. Plop is a very powerful boot manager. It will boot anything from anywhere.

    http://www.plop.at/en/bootmanager.html