* bug#62140: enable LVM in Grub
@ 2023-03-11 18:02 Emmanuel Beffara
2023-03-13 13:56 ` bug#44877: " Michael Rohleder
2024-01-23 16:36 ` Erik Eduardo via Bug reports for GNU Guix
0 siblings, 2 replies; 9+ messages in thread
From: Emmanuel Beffara @ 2023-03-11 18:02 UTC (permalink / raw)
To: 62140
Hello Guix,
Unless I missed something in the configuration process, the `grub.cfg`
generated by `guix system reconfigure` does not enable LVM, even if the store
is in an LVM volume. The immediate consequence is that Grub cannot load its
data files nor boot the system. The fix is as simple as adding `insmod lvm` in
`grub.cfg` before any `search` command, which I do by hand on each
`reconfigure`, but obviously Guix itself should do that.
I looked at `grub.scm` to see where things happen, and I see no mention of LVM
in this file. This surprises me because I am probably not the only one using
it. Actually, I use LVM on LUKS for full-system encryption, but this is
probably not rare either.
--
Emmanuel
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#44877: bug#62140: enable LVM in Grub
2023-03-11 18:02 bug#62140: enable LVM in Grub Emmanuel Beffara
@ 2023-03-13 13:56 ` Michael Rohleder
2023-03-14 21:26 ` Emmanuel Beffara
2024-01-23 16:36 ` Erik Eduardo via Bug reports for GNU Guix
1 sibling, 1 reply; 9+ messages in thread
From: Michael Rohleder @ 2023-03-13 13:56 UTC (permalink / raw)
To: Emmanuel Beffara; +Cc: 62140, 44877
[-- Attachment #1: Type: text/plain, Size: 289 bytes --]
Hello Emmanuel!
Thx for the report!
I think this is bug 44877, maybe we can/should merge it.
Here [1] is a patch (and testcase).
[1] https://issues.guix.gnu.org/60442
--
Man braucht zwei Jahre, um sprechen zu lernen,
und fünfzig, um schweigen zu lernen. E.Hemingway
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#44877: bug#62140: enable LVM in Grub
2023-03-13 13:56 ` bug#44877: " Michael Rohleder
@ 2023-03-14 21:26 ` Emmanuel Beffara
2023-03-23 12:48 ` Maxim Cournoyer
0 siblings, 1 reply; 9+ messages in thread
From: Emmanuel Beffara @ 2023-03-14 21:26 UTC (permalink / raw)
To: Michael Rohleder; +Cc: 62140, 44877
De Michael Rohleder le 13/03/2023 à 14:56:
> Hello Emmanuel!
>
> Thx for the report!
>
> I think this is bug 44877, maybe we can/should merge it.
> Here [1] is a patch (and testcase).
>
>
> [1] https://issues.guix.gnu.org/60442
Indeed, it seems to be the same issue.
However, the patch sets the value of `GRUB_PRELOAD_MODULES`, which afaik is
used by `grub-mkconfig` to produce `grub.cfg`, but there seems to be code in
`grub.scm` that also produces `grub.cfg`, and no call to `grub-mkconfig`
there. I'm not sure I understand how all this works anyway…
--
Emmanuel
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#44877: bug#62140: enable LVM in Grub
2023-03-14 21:26 ` Emmanuel Beffara
@ 2023-03-23 12:48 ` Maxim Cournoyer
2023-03-23 14:58 ` Emmanuel Beffara
0 siblings, 1 reply; 9+ messages in thread
From: Maxim Cournoyer @ 2023-03-23 12:48 UTC (permalink / raw)
To: Emmanuel Beffara; +Cc: 62140, Michael Rohleder, 44877
Hi,
Emmanuel Beffara <manu@beffara.org> writes:
> De Michael Rohleder le 13/03/2023 à 14:56:
>> Hello Emmanuel!
>>
>> Thx for the report!
>>
>> I think this is bug 44877, maybe we can/should merge it.
>> Here [1] is a patch (and testcase).
>>
>>
>> [1] https://issues.guix.gnu.org/60442
>
> Indeed, it seems to be the same issue.
>
> However, the patch sets the value of `GRUB_PRELOAD_MODULES`, which afaik is
> used by `grub-mkconfig` to produce `grub.cfg`, but there seems to be code in
> `grub.scm` that also produces `grub.cfg`, and no call to `grub-mkconfig`
> there. I'm not sure I understand how all this works anyway…
Guix indeed takes care to generate the grub.cfg itself, via the
make-grub-configuration procedure from (gnu bootloader grub), and
grub-mkconfig is *not* used.
grub-install is used though, so perhaps GRUB_PRELOAD_MODULES could be
honored by it (although it's not documented so I doubt it). It seems to
me that since we produce grub.cfg ourselves if there's something to add
there for LVM support (which I'm not sure there is -- apparently it
already works for you ?), it should be explicitly coded in (gnu
bootloader grub).
info '(grub) Changes from GRUB Legacy' mentions that "* GRUB 2 can read
files directly from LVM and RAID devices.", so I would think there's
nothing special to do?
--
Thanks,
Maxim
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#44877: bug#62140: enable LVM in Grub
2023-03-23 12:48 ` Maxim Cournoyer
@ 2023-03-23 14:58 ` Emmanuel Beffara
2023-03-24 12:24 ` Maxim Cournoyer
0 siblings, 1 reply; 9+ messages in thread
From: Emmanuel Beffara @ 2023-03-23 14:58 UTC (permalink / raw)
To: Maxim Cournoyer; +Cc: 62140, Michael Rohleder, 44877
Hello,
De Maxim Cournoyer le 23/03/2023 à 13:48:
> It seems to me that since we produce grub.cfg ourselves if there's something
> to add there for LVM support (which I'm not sure there is -- apparently it
> already works for you ?), it should be explicitly coded in (gnu bootloader
> grub).
It does not work for me, that is why I reported this! The system does not boot
unless I manually add `insmod lvm` in `grub.cfg` because Grub does not find
the partition that contains the store.
So I agree something has to be done there.
> info '(grub) Changes from GRUB Legacy' mentions that "* GRUB 2 can read
> files directly from LVM and RAID devices.", so I would think there's nothing
> special to do?
As I understand it, this just means that Grub 2 has a module for reading LVM
devices and a module for reading RAID devices. But it still has to load them
somehow (unless there is a way to include them statically so they are
available from the beginning).
--
Emmanuel
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#62140: enable LVM in Grub
2023-03-23 14:58 ` Emmanuel Beffara
@ 2023-03-24 12:24 ` Maxim Cournoyer
2023-03-28 12:32 ` Emmanuel Beffara
0 siblings, 1 reply; 9+ messages in thread
From: Maxim Cournoyer @ 2023-03-24 12:24 UTC (permalink / raw)
To: Emmanuel Beffara; +Cc: 62140, Michael Rohleder, 44877
Hi,
Emmanuel Beffara <manu@beffara.org> writes:
> Hello,
>
> De Maxim Cournoyer le 23/03/2023 à 13:48:
>> It seems to me that since we produce grub.cfg ourselves if there's something
>> to add there for LVM support (which I'm not sure there is -- apparently it
>> already works for you ?), it should be explicitly coded in (gnu bootloader
>> grub).
>
> It does not work for me, that is why I reported this! The system does not boot
> unless I manually add `insmod lvm` in `grub.cfg` because Grub does not find
> the partition that contains the store.
>
> So I agree something has to be done there.
OK, thanks for explaining. Could you please try
https://issues.guix.gnu.org/60442 (by applying the patch to a local guix
checkout, building it, then 'sudo -E ./pre-inst-env sudo guix system
reconfigure /path/to/your/config.scm)? The test suite was broken it
seems (it passed without the fix), but perhaps the fix still does work?
--
Thanks,
Maxim
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#62140: enable LVM in Grub
2023-03-24 12:24 ` Maxim Cournoyer
@ 2023-03-28 12:32 ` Emmanuel Beffara
2023-03-28 14:10 ` Maxim Cournoyer
0 siblings, 1 reply; 9+ messages in thread
From: Emmanuel Beffara @ 2023-03-28 12:32 UTC (permalink / raw)
To: Maxim Cournoyer; +Cc: 62140, Michael Rohleder, 44877
Hi,
De Maxim Cournoyer le 24/03/2023 à 13:24:
> OK, thanks for explaining. Could you please try
> https://issues.guix.gnu.org/60442 (by applying the patch to a local guix
> checkout, building it, then 'sudo -E ./pre-inst-env sudo guix system
> reconfigure /path/to/your/config.scm)? The test suite was broken it
> seems (it passed without the fix), but perhaps the fix still does work?
I did as you suggested, and unfortunately the patch has no observable effect
on my system.
I can't say it comes as a surprise. Indeed, what the patch does is set the
environment variable `GRUB_PRELOAD_MODULES` before calling `grub-install`,
which is expected to have no effect: this variable is used by `grub-mkconfig`
to generate a `grub.cfg`, but the code in Guix assembles a Grub configuration
file itself and never calls `grub-mkconfig`. The same applies to the variable
`GRUB_ENABLE_CRYPTODISK`, by the way. Maybe the way `grub.cfg` is produced has
changed at some point in history ?
The only hypothesis I can make is that it would influence `grub-install` by
preloading the given modules in the installed image, but that is not the case.
According to Grub's documentation, passing `--modules=...` to `grub-install`
would have this effect, but I'm not sure it is the right approach.
--
Emmanuel
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#62140: enable LVM in Grub
2023-03-28 12:32 ` Emmanuel Beffara
@ 2023-03-28 14:10 ` Maxim Cournoyer
0 siblings, 0 replies; 9+ messages in thread
From: Maxim Cournoyer @ 2023-03-28 14:10 UTC (permalink / raw)
To: Emmanuel Beffara; +Cc: 62140, Michael Rohleder, 44877
Hi,
Emmanuel Beffara <manu@beffara.org> writes:
> Hi,
>
> De Maxim Cournoyer le 24/03/2023 à 13:24:
>> OK, thanks for explaining. Could you please try
>> https://issues.guix.gnu.org/60442 (by applying the patch to a local guix
>> checkout, building it, then 'sudo -E ./pre-inst-env sudo guix system
>> reconfigure /path/to/your/config.scm)? The test suite was broken it
>> seems (it passed without the fix), but perhaps the fix still does work?
>
> I did as you suggested, and unfortunately the patch has no observable effect
> on my system.
Thanks for testing it!
> I can't say it comes as a surprise. Indeed, what the patch does is set the
> environment variable `GRUB_PRELOAD_MODULES` before calling `grub-install`,
> which is expected to have no effect: this variable is used by `grub-mkconfig`
> to generate a `grub.cfg`, but the code in Guix assembles a Grub configuration
> file itself and never calls `grub-mkconfig`. The same applies to the variable
> `GRUB_ENABLE_CRYPTODISK`, by the way. Maybe the way `grub.cfg` is produced has
> changed at some point in history ?
I'm not sure, but I agree it's confusing to have extraneous setenv
there if they serve no purpose (and my understanding is the same as
yours: I don't see how that'd work).
> The only hypothesis I can make is that it would influence `grub-install` by
> preloading the given modules in the installed image, but that is not the case.
> According to Grub's documentation, passing `--modules=...` to `grub-install`
> would have this effect, but I'm not sure it is the right approach.
Since we already generate a custom grub.cfg, the right approach is
probably to add any needed directive directly to it.
--
Thanks,
Maxim
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#62140: enable LVM in Grub
2023-03-11 18:02 bug#62140: enable LVM in Grub Emmanuel Beffara
2023-03-13 13:56 ` bug#44877: " Michael Rohleder
@ 2024-01-23 16:36 ` Erik Eduardo via Bug reports for GNU Guix
1 sibling, 0 replies; 9+ messages in thread
From: Erik Eduardo via Bug reports for GNU Guix @ 2024-01-23 16:36 UTC (permalink / raw)
To: 62140
[-- Attachment #1: Type: text/plain, Size: 150 bytes --]
I could correctly implement lvm as root (I think), however there is any intention on support this on guix? Let me know and I will try to send a patch.
[-- Attachment #2: Type: text/html, Size: 162 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-01-25 15:14 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-11 18:02 bug#62140: enable LVM in Grub Emmanuel Beffara
2023-03-13 13:56 ` bug#44877: " Michael Rohleder
2023-03-14 21:26 ` Emmanuel Beffara
2023-03-23 12:48 ` Maxim Cournoyer
2023-03-23 14:58 ` Emmanuel Beffara
2023-03-24 12:24 ` Maxim Cournoyer
2023-03-28 12:32 ` Emmanuel Beffara
2023-03-28 14:10 ` Maxim Cournoyer
2024-01-23 16:36 ` Erik Eduardo via Bug reports for GNU Guix
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).