Is the "bootable flag" needed in today's distributions? If not, then why is it still in the installers? What is it exactly?


The boot flag is from ancient times, where you would indicate an MBR partition record as bootable, so you could indicate where the boot loader resided.

On modern OS'es this is widely unused, as the MBR consists of a minimal stage loader which bootstraps either into its own partition or jumps to another area on the disk where the boot loader code is kept. (An MBR can contain either executable code or the boot partition table among other things. See also this link to an article about the MBR).

As an example, GRUB is written into the MBR and boots whatever partition you choose.

See also this (quite small) Wikipedia page about the boot flag: en.wikipedia.org/wiki/Boot_flag

| improve this answer | |
  • GRUB does not need to be written into the MBR though, and can be loaded by the legacy MBR. – Ignacio Vazquez-Abrams Oct 30 '11 at 4:07
  • @IgnacioVazquez-Abrams Correct, all it needs is a boot sector loader of whatever partition. I didn't want to immerse into GRUB functionality too much, as this question was about boot flags and MBR, and not about GRUB per se. – polemon Oct 30 '11 at 5:02

At first I thought it's a bug in grub2. Some BIOS seem to test if at least one partition is marked as bootable. After a long research I noticed that, because there was no way to boot from hdd or usb-stick at all. That means even if magic bytes at the end of mbr are correct and boot-code in mbr is valid, BIOS will ignore that device and skip it in boot-sequence until bootable flag for at least one partition was set. Tested on Fujitsu P772 and HP Probook 6570b.

| improve this answer | |

Every operating system that uses some kind of PC-derived hardware needs to be booted.

This starts with an ancient, OS-independent bootstrap-search which is initiated by the BIOS (basic input output system) of the PC or server.

That BIOS-piece of code tries to load the MBR from the first suitable boot-device. The search order for the boot-device is configurable in the BIOS-setup: which (disk) device first, which next and so on.

The "legacy" MBR tries to find the first primary partition that is marked as bootable and checks whether there is a short magic hex-code on that partition.

If the hex-code is found the rest (the bootstrap loader) is executed by the bios. Here begins the booting of the operating system - may it be DOS, Windows, Linux, ...

| improve this answer | |
  • 1
    -1. It is not the BIOS that checks to see if a partition is bootable. – Ignacio Vazquez-Abrams Oct 30 '11 at 4:06
  • The BIOS attempts to load the MBR (displaying No Operating System if the proper magic number isn't found), and then the MBR takes it from there. The legacy MBR looks for the active primary partition, but other MBRs (grub, lilo, etc.) may choose to act differently. – Ignacio Vazquez-Abrams Nov 6 '11 at 22:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.