How to define what boot loader on my computer is primary and what is secondary? Maybe some command? System has ROM with BIOS. I know that I can go to folder /boot/ to see what kind of loader my system is using, but what I am going to do if there will be no secondary bootloader? The goal of my questions is how to define the boot loader on my computer(primary or secondary)?
-
2Could you please [edit] your question and clarify what you're asking? There is no reason to define anything of the sort. What are you actually trying to do? Are you asking how to install a bootloader? How to install Linux? What is your final objective here? Perhaps this answer will help clarify a little. – terdon Oct 20 '15 at 11:15
-
old BIOS or UEFI? – phk Oct 20 '15 at 12:43
-
1on a uefi system there really isnt such a thing as a boot loader. and the old mbr primary loader idea was always ass-backwards in the first place. boot loaders only ever existed because BIOS got too old to be useful in the way it was designed to be and nobody wanted to fix it. it was always stupid to associate a loader with a specific os's partition - the loader comes first, after all, why shouldn't it get the only primary partition anyway? please read – mikeserv Oct 20 '15 at 13:15
-
See http://superuser.com/questions/732570/ for a misconception in this question. – JdeBP Oct 21 '15 at 05:13
1 Answers
The mechanism to bootstrap a full operating system on a computer is complex, doubly so on the (crippled by origin) PC. The following is a rough outline for classic PCs, i.e., before the whole UEFI nonsense).
When powering up, BIOS starts and does some "self check", probes some of the hardware, and goes on to load a sector from the boot drive into a fixed part of memory. This is the Master Boot Record (MBR).
The boot sector in turn uses BIOS calls to load a more substantial boot loader into memory, mostly from fixed places on the disk (no real filesystem available, there is very little space available).
This in turn loads either the kernel directly (e.g. lilo, using a preset set of disk addresses) or a more substantial loader, which understands filesystems (like grub2). Those might offer some form of menu to select what to start next.
The loaded kernel is started. It uncompresses itself and other payloads (initrd), and initializes it's own view of the system (cribbing some data left by BIOS or earlier stages in the process).
The kernel calls init
, which in turn starts userspace processes to get the system up and running. In the process it switches from having the root in RAM to the real filesystem.
Other machines will differ substantially, even for the same machine you could use radically different boot chains. I.e., for Linux on PCs use lilo, isolinux, grub, ... It used to be that the kernel could even be copied to the start of a diskette and booted directly (doing the whole MBR dance by itself), but that is part of the almost forgotten past.

- 18,253
-
umm... no its not part of the almost forgotten past - a vanilla linux kernel is an EFI executable. put it on the system partition, point the firmware at it, and forget all of the rest of the boot loader nonsense. – mikeserv Oct 22 '15 at 01:59