Linux (the kernel) does not care how many boot partitions you have. Loading the kernel from disk is the job of the bootloader (e.g. grub
, grub2
, lilo
) and these tools also do not care about the number of locations a kernel might be located. They only care about the specific location.
As an example, my boot partition is /dev/md1
, which is a mdadm RAID mirror backed by the physical partitions /dev/sde1
and /dev/sdf1
. I can mount these individually if I wanted and as such this technically counts as having two boot partitions, though they should contain the same data.
Having two partitions for /boot for me is an availability issue, but they could equally be different /boot partitions. The next step to is how does the bootloader know? Here is how:
menuentry 'Linux 3.10.17 (sde) kernel-3.10.17-g' {
root=hd0,1
linux /boot/kernel-3.10.17-g domdadm dolvm root=/dev/md3
initrd /boot/initrd-3.10.17-g
}
menuentry 'Linux 3.10.17 (sdf) kernel-3.10.17-g' {
root=hd1,1
linux /boot/kernel-3.10.17-g domdadm dolvm root=/dev/md3
initrd /boot/initrd-3.10.17-g
}
This is an excerpt from a grub2
configuration and you'll note that the only differences are root=hd0,1
and root=hd1,1
which establish which boot partition that entry references.
Now to walk you though a boot so you can understand what is going on here.
- The BIOS reads the MBR from the boot volume and jumps to the bootloader
- The bootloader (e.g.
grub2
) is configured to know which device and partition contains your kernel. Grub2 accesses this partition directly and loads your kernel into memory.
- Your bootloader then jumps into the kernel and the kernel boots your machine.
The bootloader doesn't care how many boot partitions you have, it only cares where they are and you must tell it that information.
The kernel doesn't care how many boot partitions you have, because it never needs to see them (you only need to have it available to add new kernels for example).