Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #180866 > unrolled thread

UEFI + Raid

Started bySam Smith <debian@net153.net>
First post2017-05-09 02:00 +0200
Last post2017-05-17 20:30 +0200
Articles 10 — 3 participants

Back to article view | Back to linux.debian.user


Contents

  UEFI + Raid Sam Smith <debian@net153.net> - 2017-05-09 02:00 +0200
    Re: UEFI + Raid Steve McIntyre <steve@einval.com> - 2017-05-09 14:40 +0200
    Re: UEFI + Raid Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-05-10 00:50 +0200
      Re: UEFI + Raid Sam Smith <debian@net153.net> - 2017-05-11 01:00 +0200
        Re: UEFI + Raid Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-05-11 07:30 +0200
          Re: UEFI + Raid Sam Smith <debian@net153.net> - 2017-05-16 19:20 +0200
            Re: UEFI + Raid Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-05-16 19:50 +0200
            Re: UEFI + Raid Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-05-16 19:50 +0200
              Re: UEFI + Raid Sam Smith <debian@net153.net> - 2017-05-17 20:10 +0200
                Re: UEFI + Raid Pascal Hambourg <pascal@plouf.fr.eu.org> - 2017-05-17 20:30 +0200

#180866 — UEFI + Raid

FromSam Smith <debian@net153.net>
Date2017-05-09 02:00 +0200
SubjectUEFI + Raid
Message-ID<tF0Jj-2c4-1@gated-at.bofh.it>
Hi,

I have installed Debian Stretch on my first system using UEFI. I used a 
two disk Raid 1 + LVM configured during install time to mount / on 
(among other things).

But now I need to figure out how to add redundancy to the software raid 
1 since I believe boot entries are only added to one disk during 
installation time?  According to 
https://wiki.debian.org/UEFI#Missing_features there doesn't seem to be 
much options. Is my only option to copy the FAT32 EFI system partition 
from the first disk to the second disk and then use efibootmgr to add it 
(the second disk) as a boot entry? And will any subsequent kernel or 
grub updates affect the system partition and thus require another 
copy/sync to the second disk?

Regards,

[toc] | [next] | [standalone]


#180878

FromSteve McIntyre <steve@einval.com>
Date2017-05-09 14:40 +0200
Message-ID<tFcAO-1J6-25@gated-at.bofh.it>
In reply to#180866
debian@net153.net wrote:
>Hi,
>
>I have installed Debian Stretch on my first system using UEFI. I used a 
>two disk Raid 1 + LVM configured during install time to mount / on 
>(among other things).
>
>But now I need to figure out how to add redundancy to the software raid 
>1 since I believe boot entries are only added to one disk during 
>installation time?  According to 
>https://wiki.debian.org/UEFI#Missing_features there doesn't seem to be 
>much options. Is my only option to copy the FAT32 EFI system partition 
>from the first disk to the second disk and then use efibootmgr to add it 
>(the second disk) as a boot entry? And will any subsequent kernel or 
>grub updates affect the system partition and thus require another 
>copy/sync to the second disk?

I'm afraid there's no automation for this yet. I'm hoping to find some
time to work on adding this during the Buster cycle, and the Grub
developers are apparently interested too.

For now, you'll need to do this by hand I'm afraid.

-- 
Steve McIntyre, Cambridge, UK.                                steve@einval.com
"I can't ever sleep on planes ... call it irrational if you like, but I'm
 afraid I'll miss my stop" -- Vivek Dasmohapatra

[toc] | [prev] | [next] | [standalone]


#180899

FromPascal Hambourg <pascal@plouf.fr.eu.org>
Date2017-05-10 00:50 +0200
Message-ID<tFm77-863-3@gated-at.bofh.it>
In reply to#180866
Le 09/05/2017 à 01:48, Sam Smith a écrit :
>
> I have installed Debian Stretch on my first system using UEFI. I used a
> two disk Raid 1 + LVM configured during install time to mount / on
> (among other things).
>
> But now I need to figure out how to add redundancy to the software raid
> 1 since I believe boot entries are only added to one disk during
> installation time?

I did it with Wheezy and wrote a post about it in a french forum. But it 
isn't very useful if you cannot read french, and it does not take into 
account new fancy grub-install options available since Jessie :
--removable
--force-extra-removable
--efi-directory
--bootloader-id

> According to
> https://wiki.debian.org/UEFI#Missing_features there doesn't seem to be
> much options. Is my only option to copy the FAT32 EFI system partition
> from the first disk to the second disk and then use efibootmgr to add it
> (the second disk) as a boot entry?

No, you have other options.
Manually install a copy of the GRUB EFI core image in the EFI removable 
path of each disk. This location does not require to add an EFI boot 
entry with efibootmgr.
Or use grub-install with --removable and --efi-directory for each disk.
Or use grub-install with --efi-directory and --bootloader to install a 
copy of GRUB wherever you want and add an EFI boot entry for it.

Maybe you could also create a RAID 1 array with superblock at the end 
and use it as the EFI system partition. Never tried it.

> And will any subsequent kernel or
> grub updates affect the system partition and thus require another
> copy/sync to the second disk?

Kernel update : no, it just affects the /boot contents.
GRUB package update : yes.

[toc] | [prev] | [next] | [standalone]


#180919

FromSam Smith <debian@net153.net>
Date2017-05-11 01:00 +0200
Message-ID<tFIKm-6A2-3@gated-at.bofh.it>
In reply to#180899
On 05/09/2017 05:44 PM, Pascal Hambourg wrote:
> Le 09/05/2017 à 01:48, Sam Smith a écrit :
>>
>> I have installed Debian Stretch on my first system using UEFI. I used a
>> two disk Raid 1 + LVM configured during install time to mount / on
>> (among other things).
>>
>> But now I need to figure out how to add redundancy to the software raid
>> 1 since I believe boot entries are only added to one disk during
>> installation time?
>
> I did it with Wheezy and wrote a post about it in a french forum. But it
> isn't very useful if you cannot read french, and it does not take into
> account new fancy grub-install options available since Jessie :
> --removable
> --force-extra-removable
> --efi-directory
> --bootloader-id
>
>> According to
>> https://wiki.debian.org/UEFI#Missing_features there doesn't seem to be
>> much options. Is my only option to copy the FAT32 EFI system partition
>> from the first disk to the second disk and then use efibootmgr to add it
>> (the second disk) as a boot entry?
>
> No, you have other options.
> Manually install a copy of the GRUB EFI core image in the EFI removable
> path of each disk. This location does not require to add an EFI boot
> entry with efibootmgr.
> Or use grub-install with --removable and --efi-directory for each disk.
> Or use grub-install with --efi-directory and --bootloader to install a
> copy of GRUB wherever you want and add an EFI boot entry for it.
>
> Maybe you could also create a RAID 1 array with superblock at the end
> and use it as the EFI system partition. Never tried it.
>
>> And will any subsequent kernel or
>> grub updates affect the system partition and thus require another
>> copy/sync to the second disk?
>
> Kernel update : no, it just affects the /boot contents.
> GRUB package update : yes.
>





Thanks for the tips.

I tried to use "grub-install -v  --target=x86_64-efi 
--bootloader-id=grub /dev/sdb"

But as far as I could tell everything was installed to the first disk 
still (sda) and /boot/efi/EFI/ then had two entries, the old 'debian' 
one and then new 'grub' one.


"efibootmgr -v" showed:

 > Boot000E* grub 
HD(1,GPT,3ec825d3-e2f7-4491-b4a5-321032b0ab8c,0x800,0x79800)/File(\EFI\grub\grubx64.efi)
 > Boot000F* debian 
HD(1,GPT,3ec825d3-e2f7-4491-b4a5-321032b0ab8c,0x800,0x79800)/File(\EFI\debian\grubx64.efi)


Basically on the same disk. I used "efibootmgr -b E -B" to delete the 
extra entry I had just made.

Next I just manually did

 > dd if=/dev/sda1 of=/dev/sdb1
 > efibootmgr -c -d /dev/sdb -p 1 -w -L 'debian backup' -l 
'\EFI\debian\grubx64.efi'

And now "efibootmgr -v" shows:

 > Boot000E* debian backup 
HD(1,GPT,96aa190b-b6c0-4753-ab6f-171ccc37b745,0x800,0x79800)/File(\EFI\debian\grubx64.efi)
 > Boot000F* debian 
HD(1,GPT,3ec825d3-e2f7-4491-b4a5-321032b0ab8c,0x800,0x79800)/File(\EFI\debian\grubx64.efi)


I guess that will work, though I haven't rebooted yet. What I find weird 
is that grub in legacy mode will install to all hard drives in the 
system, or at least it would prompt you for what hard drives you wanted 
it to be installed to. Why can't grub with efi just automatically do 
that same?


Regards,
Samuel Smith

[toc] | [prev] | [next] | [standalone]


#180922

FromPascal Hambourg <pascal@plouf.fr.eu.org>
Date2017-05-11 07:30 +0200
Message-ID<tFOPL-28n-1@gated-at.bofh.it>
In reply to#180919
Le 11/05/2017 à 00:53, Sam Smith a écrit :
> On 05/09/2017 05:44 PM, Pascal Hambourg wrote:
>>
>> Or use grub-install with --removable and --efi-directory for each disk.
>> Or use grub-install with --efi-directory and --bootloader-id to install
>> a copy of GRUB wherever you want and add an EFI boot entry for it.
(...)
> I tried to use "grub-install -v  --target=x86_64-efi
> --bootloader-id=grub /dev/sdb"
>
> But as far as I could tell everything was installed to the first disk
> still (sda) and /boot/efi/EFI/ then had two entries, the old 'debian'
> one and then new 'grub' one.

With EFI targets, grub-install ignores the specified device, because it 
is irrelevant. This i why I told to use --efi-directory to indicate 
which EFI partition (mounted on the specified directory instead of 
/boot/efi) to install the GRUB core image on.

>> dd if=/dev/sda1 of=/dev/sdb1
>> efibootmgr -c -d /dev/sdb -p 1 -w -L 'debian backup' -l
> '\EFI\debian\grubx64.efi'
>
> And now "efibootmgr -v" shows:
>
>> Boot000E* debian backup
> HD(1,GPT,96aa190b-b6c0-4753-ab6f-171ccc37b745,0x800,0x79800)/File(\EFI\debian\grubx64.efi)
>
>> Boot000F* debian
> HD(1,GPT,3ec825d3-e2f7-4491-b4a5-321032b0ab8c,0x800,0x79800)/File(\EFI\debian\grubx64.efi)

Beware that using dd clones the partition, including the UUID and label. 
So both the original and cloned partition have the same UUID, which will 
confuse libblkid and result in either being mounted on /boot/efi.

> I guess that will work, though I haven't rebooted yet. What I find weird
> is that grub in legacy mode will install to all hard drives in the
> system, or at least it would prompt you for what hard drives you wanted
> it to be installed to. Why can't grub with efi just automatically do
> that same?

Because grub-install works quite differently on EFI targets. It does not 
install on a device but on an EFI system partition mount point. Also, it 
requires to specify explicit IDs for multiple copies. Also, whhen using 
the default ID ("debian"), it deletes any existing EFI boot entry whose 
name contains "debian" (case insensitive IIRC).

[toc] | [prev] | [next] | [standalone]


#181036

FromSam Smith <debian@net153.net>
Date2017-05-16 19:20 +0200
Message-ID<tHOiB-8rM-7@gated-at.bofh.it>
In reply to#180922
On 05/11/2017 12:21 AM, Pascal Hambourg wrote:
> Le 11/05/2017 à 00:53, Sam Smith a écrit :
>> On 05/09/2017 05:44 PM, Pascal Hambourg wrote:
>>>
>>> Or use grub-install with --removable and --efi-directory for each disk.
>>> Or use grub-install with --efi-directory and --bootloader-id to install
>>> a copy of GRUB wherever you want and add an EFI boot entry for it.
> (...)
>> I tried to use "grub-install -v  --target=x86_64-efi
>> --bootloader-id=grub /dev/sdb"
>>
>> But as far as I could tell everything was installed to the first disk
>> still (sda) and /boot/efi/EFI/ then had two entries, the old 'debian'
>> one and then new 'grub' one.
>
> With EFI targets, grub-install ignores the specified device, because it
> is irrelevant. This i why I told to use --efi-directory to indicate
> which EFI partition (mounted on the specified directory instead of
> /boot/efi) to install the GRUB core image on.
>
>>> dd if=/dev/sda1 of=/dev/sdb1
>>> efibootmgr -c -d /dev/sdb -p 1 -w -L 'debian backup' -l
>> '\EFI\debian\grubx64.efi'
>>
>> And now "efibootmgr -v" shows:
>>
>>> Boot000E* debian backup
>> HD(1,GPT,96aa190b-b6c0-4753-ab6f-171ccc37b745,0x800,0x79800)/File(\EFI\debian\grubx64.efi)
>>
>>
>>> Boot000F* debian
>> HD(1,GPT,3ec825d3-e2f7-4491-b4a5-321032b0ab8c,0x800,0x79800)/File(\EFI\debian\grubx64.efi)
>>
>
> Beware that using dd clones the partition, including the UUID and label.
> So both the original and cloned partition have the same UUID, which will
> confuse libblkid and result in either being mounted on /boot/efi.
>
>> I guess that will work, though I haven't rebooted yet. What I find weird
>> is that grub in legacy mode will install to all hard drives in the
>> system, or at least it would prompt you for what hard drives you wanted
>> it to be installed to. Why can't grub with efi just automatically do
>> that same?
>
> Because grub-install works quite differently on EFI targets. It does not
> install on a device but on an EFI system partition mount point. Also, it
> requires to specify explicit IDs for multiple copies. Also, whhen using
> the default ID ("debian"), it deletes any existing EFI boot entry whose
> name contains "debian" (case insensitive IIRC).
>




Ah, this was the info I was missing. Didn't know the partition had to be 
mounted. I've used this now:
grub-install -v  --target=x86_64-efi  --bootloader-id=debian2 
--efi-directory=/mnt/efi

and I think all is well.


Regards,

[toc] | [prev] | [next] | [standalone]


#181037

FromPascal Hambourg <pascal@plouf.fr.eu.org>
Date2017-05-16 19:50 +0200
Message-ID<tHOLD-9u-11@gated-at.bofh.it>
In reply to#181036
Le 16/05/2017 à 19:40, Pascal Hambourg a écrit :
> Le 16/05/2017 à 19:12, Sam Smith a écrit :
>> On 05/11/2017 12:21 AM, Pascal Hambourg wrote:
>>>
>>> Also, when using
>>> the default ID ("debian"), it deletes any existing EFI boot entry whose
>>> name contains "debian" (case insensitive IIRC).
>>
>> I've used this now:
>> grub-install -v  --target=x86_64-efi  --bootloader-id=debian2
>> --efi-directory=/mnt/efi
>
> Because of what I left quoted just above, I advise again

Argh ! I advise *against*

> using "debian"
> as a sub-chain in the ID, because such entry may be deleted by a later
> uncautious invocation of grub-install.
>
>

[toc] | [prev] | [next] | [standalone]


#181038

FromPascal Hambourg <pascal@plouf.fr.eu.org>
Date2017-05-16 19:50 +0200
Message-ID<tHOLD-9u-13@gated-at.bofh.it>
In reply to#181036
Le 16/05/2017 à 19:12, Sam Smith a écrit :
> On 05/11/2017 12:21 AM, Pascal Hambourg wrote:
>>
>> Also, when using
>> the default ID ("debian"), it deletes any existing EFI boot entry whose
>> name contains "debian" (case insensitive IIRC).
>
> I've used this now:
> grub-install -v  --target=x86_64-efi  --bootloader-id=debian2
> --efi-directory=/mnt/efi

Because of what I left quoted just above, I advise again using "debian" 
as a sub-chain in the ID, because such entry may be deleted by a later 
uncautious invocation of grub-install.

[toc] | [prev] | [next] | [standalone]


#181075

FromSam Smith <debian@net153.net>
Date2017-05-17 20:10 +0200
Message-ID<tIbyy-6u4-23@gated-at.bofh.it>
In reply to#181038
On 05/16/2017 12:40 PM, Pascal Hambourg wrote:
> Le 16/05/2017 à 19:12, Sam Smith a écrit :
>> On 05/11/2017 12:21 AM, Pascal Hambourg wrote:
>>>
>>> Also, when using
>>> the default ID ("debian"), it deletes any existing EFI boot entry whose
>>> name contains "debian" (case insensitive IIRC).
>>
>> I've used this now:
>> grub-install -v  --target=x86_64-efi  --bootloader-id=debian2
>> --efi-directory=/mnt/efi
>
> Because of what I left quoted just above, I advise again using "debian"
> as a sub-chain in the ID, because such entry may be deleted by a later
> uncautious invocation of grub-install.
>


Wait, it (grub-install?) deletes anything with "debian" in it? Is that 
only when it is invoked with "debian" as the bootloader id? That seems 
troubling. What if I named it to "windows", would it then go delete all 
my windows installs? Guess I'll set the id to "deb2" and re-run....


Regards,

[toc] | [prev] | [next] | [standalone]


#181077

FromPascal Hambourg <pascal@plouf.fr.eu.org>
Date2017-05-17 20:30 +0200
Message-ID<tIbRU-6Bk-9@gated-at.bofh.it>
In reply to#181075
Le 17/05/2017 à 20:07, Sam Smith a écrit :
> On 05/16/2017 12:40 PM, Pascal Hambourg wrote:
>>
>> Because of what I left quoted just above, I advise again using "debian"
>> as a sub-chain in the ID, because such entry may be deleted by a later
>> uncautious invocation of grub-install.
>
> Wait, it (grub-install?) deletes anything with "debian" in it? Is that

Yes.

> only when it is invoked with "debian" as the bootloader id? That seems

When it is invoked without --bootloader-id, which results in using the 
default name "debian".

> troubling. What if I named it to "windows", would it then go delete all
> my windows installs?

I have not tested this.

Anyway, on UEFI machines with only one boot loader (per disk if RAID), I 
don't rely on EFI boot entries (too flaky) and install GRUB in the 
"removable device path" (default EFI path) with --removable.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web