1

I am aware that Linux systems largely use GRUB 2 as the bootloader stored in the master boot record of a GPT hard disk. However, each partition has its own Volume Boot Record or Partition Boot Record, and from this link, I found the following information

Boot sectors are the first sectors on a hard disk partition, except in the case of extended partitions, which are just containers for other partitions. Boot sectors offer 512 bytes of space and are designed to contain code capable of launching an operating system on this partition. Boot sectors of formatted DOS, Windows, and OS/2 partitions do exactly that (in addition, they contain some basic data about the file system structure).

In contrast, the boot sector of a Linux partition is empty (even after creating a file system on it). Thus, a Linux partition cannot bootstrap itself, even if it contains a kernel and a valid root file system. A boot sector with a valid start code contains the same magic number as the MBR in its last two bytes (AA55).

Why doesn't Linux write anything in the partition boot sector?

  • 1
    The explanation lies in "a Linux partition cannot bootstrap itself"; it requires, as Anthon points out, a separate bootloader. This is sort of a good thing; since the nature of the partition is not proprietary, it is straightforward enough for anyone with the prerequisite skills to write one. This makes Linux more flexible than proprietary systems and part of the reason it is used in a much wider variety of contexts. – goldilocks Nov 5 '14 at 15:01
3

You are mistaken that it doesn't, you just have to tell grub-install to write it there.

Once you have done that you can chain-boot-load from that boot sector.

The main reason not to write in the partition by default on a new setup is that your BIOS will not find it there, you would still need some bootloader in the bootsector of the disc that gets booted.

There are however advantages in doing so, e.g. if you have two Linux versions installed then an upgraded kernel of the version that did not write the boot sector, will not result in an updated grub menu with the new version (for that you have to reboot the other version and run update-grub there). If you chain load that version, it will pass through the updated (second) grub menu after selecting to start that in the first menu.

  • Note that in order to install grub to the pbr, it has to use blocklists to find /boot/grub/core, which is error prone and not recommended, thus it requires a force flag. – psusi Nov 5 '14 at 14:43

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.