Question: When I turn on my computer, what is the software that selects which operating system to boot, and how does it decide when given multiple options?
More specifically, what if I have a computer with multiple operating systems living on the same disk? And what if I have external drives – does it search every partition across all storage devices for formats that it recognizes?
From my understanding every disk has its own boot sector that contains information on which partition the computer should boot. But what if I have multiple disks attached, where each disk has a different boot sector – which one does it load?
When trying to research this topic, I’ve run into some confusion since not all technologies behave the same (e.g. some say that the bootable flag is important while others say it is ignored). Some clarity in how different systems work would be much appreciated.
Answer: Unfortunately this has become more complex as computers have evolved.
Initially (ie the first PC’s) there was a fixed order (which depended on cabling).
Almost all computers still have a default boot order which can be controlled/influenced by the BIOS. Newer computers supplement this functionality with UEFI, which in some ways supercedes the BIOS.
For BIOS booting there is a preferred order. The BIOS looks at each drive for bootable boot sectors, and will attempt to load these, going down its list of options until one boots.
For UEFI there is a filesystem on the disk, (a small fat partition labeled as UEFI which contains a first stage boot loader and instructions. In some cases this is supplemented by instructions programmed into the UEFI (ie settings stored in nvram similar to the BIOS)
Once a boot loader/UEFI partition has been found, a program takes over the boot process, and this may offer the ability to boot into different modes or OSs.