This page describes some common questions about BIOS Boot Partition, why GRUB uses it, and how can you enable it.

What is the BIOS Boot Partition, and what does GRUB use it for?

In a GPT partition map, the 31 kiB area after Master Boot Record where GRUB is usually embedded to, does not exist. When GRUB can't be embedded, its only option is to use blocklists, which are unreliable and discouraged.

However, with GPT labels there's a replacement: the BIOS Boot Partition. If such partition exists, GRUB will use it for embedding, solving the problem. An additional advantage over old-fashioned MSDOS-style partition maps is that user can specify its size to be greater than 31 kiB, and use an arbitrary location for it (however, using the lower area of the disk is still recommended).

What's embedding?

Embedding means a fixed location on disk, which doesn't collide with other resources (e.g. your filesystem), is used to put GRUB's second stage of code (core.img). GRUB's first stage (boot.img, installed in MBR) will load code directly from this location and jump to it. Unless someone overwrites either the MBR or the embedding area, this setup won't break.

And blocklists?

Blocklists are the alternative used by GRUB when embedding is not possible. In this scheme, GRUB leaves core.img in the filesystem (in /boot/grub/). Then it makes a list of all blocks that compose this file. The list itself, much shorter than core.img, will be used during boot to recompose core.img and load it into memory. The problem with this scheme is that there are many situations in which it can break. Once a file is put in your filesystem, there's no guarantee the blocks won't ever be relocated. It can happen with some filesystem features (e.g. tail packing), or with some administration activities (e.g. resizing or copying a filesystem), or simply because of aggressive fsck techniques.

Another problem with blocklists is that they force core.img to be located in the same drive that provides /boot, but this (in some unusual setups) might not be the same drive we installed boot.img (the MBR) to. So in this case, the BIOS drive number for /boot needs to be guessed during install and hardcoded into boot.img. Guessing is obviously a problem (because sometimes it finds the wrong one), and hardcoding too because the setup will break if disk ordering is altered.

How do I create a BIOS Boot Partition that will be suitable for GRUB?

You can use Parted to do that. Simply create a new partition; make it at least 31 kiB (preferably more, like 64 kiB or 128 kiB), and then set the "bios_grub" tag with a command like:

  $ sudo parted /dev/sda set <partition_number> bios_grub on

IMPORTANT!! Be very careful which partition you select. When GRUB finds a BIOS Boot partition during installation, it will automatically overwrite part of it. Make sure the partition isn't being used for another purpose (e.g. a filesystem).


CategoryDocumentation

GrubWiki: BIOS Boot Partition (last edited 2010-01-20 07:08:42 by NickAndrew)