Boot partition for Software RAID 1

16,698

It is generally true that you need a separate /boot unless you want to boot the system on a single of the two RAID1 disks and then remount as md after the system is running or set up an appropriate initramfs.

From mdadm wiki:

Since support for MD is found in the kernel, there is an issue with using it before the kernel is running. Specifically it will not be present if the boot loader is either (e)LiLo or GRUB legacy. It may not be present for GRUB 2. In order to circumvent this problem a /boot filesystem must be used either without md support, or else with RAID1. In the latter case the system will boot by treating the RAID1 device as a normal filesystem, and once the system is running it can be remounted as md and the second disk added to it. This will result in a catch-up, but /boot filesystems are usually small.

With more recent bootloaders it is possible to load the MD support as a kernel module through the initramfs mechanism, this approach allows you to let the /boot filesystem be inside any RAID system without the need of a complex manual configuration.

Although it isn't your question, it may be useful to consult RAID Boot for more information on using initramfs to start a system booting from md volumes.

Share:
16,698

Related videos on Youtube

Siler
Author by

Siler

Updated on September 18, 2022

Comments

  • Siler
    Siler almost 2 years

    According to this tutorial:

    http://edoceo.com/howto/mdadm-raid1

    as well as the answer to this question,

    ...it is necessary to create a separate boot partition if you want to boot from a software RAID 1 array on Linux (an array created via mdadm). My question is:

    1. Is this correct?
    2. If so, why is this necessary? Why can't there be a single primary bootable partition (mounted on /) on both drives in the RAID 1 array?
  • CMCDragonkai
    CMCDragonkai over 8 years
    It seems this doesn't work for EFI System Partitions though?
  • David
    David over 5 years
    @CMCDragonkai AFAIK the EFI System Partition has to be the first physical partition on a hard disk and can not be on a software RAID array.
  • 0andriy
    0andriy over 2 years