All of lore.kernel.org
 help / color / mirror / Atom feed
From: Francis Moreau <francis.moro@gmail.com>
To: Chris Murphy <lists@colorremedies.com>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: Re: Soft RAID and EFI systems
Date: Sun, 02 Feb 2014 22:34:42 +0100	[thread overview]
Message-ID: <52EEB9F2.2000607@gmail.com> (raw)
In-Reply-To: <70EFD3D5-F7AC-4359-8888-99EB6CCA9E4F@colorremedies.com>

Hi Chris,

First of all, thanks for your answer :)

On 02/02/2014 09:39 PM, Chris Murphy wrote:
> 
> On Jan 31, 2014, at 10:02 AM, Francis Moreau <francis.moro@gmail.com> wrote:
> 
>> Hello,
>>
>> On EFI systems I'd like to RAID mirror /boot partition.
> 
> Yes this is non-obvious with existing tools I think. With BIOS it's as simple as grub-install /dev/sdX for each member device in the md raid1 array, and then grub-mkconfig -o /boot/grub/grub.cfg which creates a single (mirrored) copy of the grub.cfg.
> 
> For UEFI, we need:
> 1.  ESP created per member device
> 2.  grubx64.efi on each ESP. Grub-install depends on the ESP being mounted in order to install to it, unlike MBR gap or BIOS Boot installs. So you have to manually umount/mount each ESP to do a grub-install; or copy one grubx64.efi to each ESP.
> 3. grub.cfg at /boot/grub just like on BIOS.
>

That's funny because one of the reasons I want to use UEFI firmware is
to get rid of grub (I don't like it and the way it has become such a
bloated beast): since /boot is vfat and has its own partition, I prefer
use a much simpler bootloader such as gummyboot.

> For those distros doing Secure Boot, its complicated because there is no such thing as grub-install. There's a one size fits all signed grubx64.efi which typically searches for grub.cfg in the same directory as the grubx64.efi file. That means your grub.cfg isn't mirrored, and any time you do a kernel update you have to manually update all the grub.cfgs on each ESP. Messy. That's the way it is on Fedora right now and I just filed some bugs on this.

Could you give me a pointer on the bug you filled out, I would be
interested.

> 
> Anyway, another way to do this is a simpler grub.cfg on each ESP that's never updated again, that forwards to the /boot/grub/grub.cfg which is updated with kernel updates. That simple grub.cfg is described as:
> 
> # forward to real config
> 	  search --no-floppy --fs-uuid --set=root --hint-bios=hd$d,gpt2 --hint-efi=hd$d,gpt2 --hint-baremetal=ahci$d,gpt2  d7bc9d0e-7706-44f9-b1a7-ff24b7c360a7
> 	  configfile /boot/grub2/grub.cfg
> 
> # $d is the number for each md member disk, so that the hint is only looking for the fs-uuid on the local disk first. But I think even a single such grub.cfg that's not customized per disk will work, but it does need to be copied to each ESP.
> 

Interesting, I didn't know such trick was possible.

> 
>> For Fake RAID, I'm not sure but I would say that the bios is able to
>> read the RAID metadata as well.
> 
> I'm not sure if the fake raid is going to present a single ESP to the firmware or not? If the EFI System partitions are raided via fake raid, then you have only one grubx64.efi and one grub.cfg so there should be no problem? I haven't test it.

I haven't and can't because of lack of HW, at least for now. But I would
think there's no problem on such systems. That would give a first reason
to use them.

> 
>>
>> For (md) Soft RAID, I don't know. I would say that the bios is
>> unlikely to understand the md metadata stored in the /boot partition
>> so it won't work.
> 
> The UEFI firmware has no way of directly reading /boot aside from the md metadata, which is that it's likely ext4 which the firmware won't understand. UEFI firmware is looking for an OS loader on the EFI System Partition (ESP) and that OS Loader will be grub, which will understand both md raid1 metadata and ext4.
> 

Actually, IIRC, one metadata format (0.9 perhaps) is stored at the end
of the partition which would allow the UEFI firmware to access the /boot
partition transparently, no ?

Thanks !

  reply	other threads:[~2014-02-02 21:34 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-31 17:02 Soft RAID and EFI systems Francis Moreau
2014-02-01 22:04 ` Martin Wilck
2014-02-02 21:39   ` Francis Moreau
2014-02-02 21:56     ` Martin Wilck
2014-02-02 20:39 ` Chris Murphy
2014-02-02 21:34   ` Francis Moreau [this message]
2014-02-02 22:30     ` Chris Murphy
2014-02-02 22:57       ` Phil Turmel
2014-02-03  7:19         ` Martin Wilck
2014-02-04  8:41         ` Francis Moreau
2014-02-04  8:48           ` David Brown
2014-02-04  8:53             ` Francis Moreau
2014-02-04 12:27             ` Phil Turmel
2014-02-04 15:13             ` Chris Murphy
2014-02-04 15:29               ` Chris Murphy
2014-02-07  7:42               ` Francis Moreau
2014-02-04  8:32       ` Francis Moreau
2014-02-04  8:57         ` David Brown
2014-02-04  9:06           ` Francis Moreau
2014-02-04  9:35             ` David Brown
2014-02-04  9:45               ` Francis Moreau
2014-02-04 15:27             ` Chris Murphy
2014-02-04 15:40           ` Chris Murphy
2014-02-04 14:50         ` Chris Murphy
2014-02-07  8:00           ` Francis Moreau
2014-02-03  9:56 ` David Brown
2014-02-04  8:22   ` Francis Moreau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52EEB9F2.2000607@gmail.com \
    --to=francis.moro@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=lists@colorremedies.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.