Grub2 boot problem

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Grub2 boot problem

Magnus Johansson
Hello.

I've got a fresh Gentoo installation that does not boot. I just end up in the Grub2 shell.

However when there if I do 'set root=(md/0)' and 'configfile /grub/grub.cfg' I do get to the Grub2 menu where Gentoo boots just fine.

/boot and / are both on mdadm devices.

I've tried re-running grub-mkconfig and grub-install several times without luck.

I've added domdadm to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub.

Drives sda/sdb use GPT disklabels and have 20M BIOS boot partitions first.

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Grub2 boot problem

Tom H-4
On Wed, Jan 31, 2018 at 2:58 PM, Magnus Johansson <[hidden email]> wrote:

>
> I've got a fresh Gentoo installation that does not boot. I just end up in
> the Grub2 shell.
>
> However when there if I do 'set root=(md/0)' and 'configfile /grub/grub.cfg'
> I do get to the Grub2 menu where Gentoo boots just fine.
>
> /boot and / are both on mdadm devices.
>
> I've tried re-running grub-mkconfig and grub-install several times without
> luck.
>
> I've added domdadm to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub.
>
> Drives sda/sdb use GPT disklabels and have 20M BIOS boot partitions first.

To which device are you installing grub?

Check what "core.img" prefix and modules grub-install is using with

grub-install --debug $your_device 2>&1 | grep grub-mkimage

[I hit a similar problem with mdadm 6 or 7 years ago and had to create
a custom "core.img" to boot normally. You might have to do the same
but i would've thought that this problem's been solved. I haven't
encountered it since.]

Reply | Threaded
Open this post in threaded view
|

Re: Grub2 boot problem

Magnus Johansson
> > I've got a fresh Gentoo installation that does not boot. I just end up in
> > the Grub2 shell.
> >
> > However when there if I do 'set root=(md/0)' and 'configfile /grub/grub.cfg'
> > I do get to the Grub2 menu where Gentoo boots just fine.
> >
> > /boot and / are both on mdadm devices.
> >
> > I've tried re-running grub-mkconfig and grub-install several times without
> > luck.
> >
> > I've added domdadm to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub.
> >
> > Drives sda/sdb use GPT disklabels and have 20M BIOS boot partitions first.
>
> To which device are you installing grub?
>
> Check what "core.img" prefix and modules grub-install is using with
>
> grub-install --debug $your_device 2>&1 | grep grub-mkimage
>
> [I hit a similar problem with mdadm 6 or 7 years ago and had to create
> a custom "core.img" to boot normally. You might have to do the same
> but i would've thought that this problem's been solved. I haven't
> encountered it since.]

I install grub to devices sda and sdb in the hope I can boot from both/either

m / # grub-install --debug /dev/sda 2>&1 | grep grub-mkimage
grub-install: info: grub-mkimage --directory '/usr/lib/grub/i386-pc'
--prefix '(mduuid/46488b259685a3b9c52b7449d592dc80)/grub' --output
'/boot/grub/i386-pc/core.img' --format 'i386-pc' --compression 'auto'
'ext2' 'part_gpt' 'part_gpt' 'diskfilter' 'mdraid1x' 'biosdisk'
m / #

Reply | Threaded
Open this post in threaded view
|

Re: Grub2 boot problem

Steven Lembark
On Mon, 5 Feb 2018 22:00:39 +0100
Magnus Johansson <[hidden email]> wrote:

From my grub.cfg:

    insmod gzio
    insmod part_msdos
    insmod diskfilter
    insmod mdraid1x
    insmod raid5rec
    insmod lvm
    insmod xfs

Sanity check that you have all of the necessary modules installed
(e.g., "mdraid*" "raid5rec").

--
Steven Lembark                                       1505 National Ave
Workhorse Computing                                 Rockford, IL 61103
[hidden email]                                    +1 888 359 3508

Reply | Threaded
Open this post in threaded view
|

Re: Grub2 boot problem

Magnus Johansson
2018-02-07 18:50 GMT+01:00 Steven Lembark <[hidden email]>:

> On Mon, 5 Feb 2018 22:00:39 +0100
> Magnus Johansson <[hidden email]> wrote:
>
> From my grub.cfg:
>
>     insmod gzio
>     insmod part_msdos
>     insmod diskfilter
>     insmod mdraid1x
>     insmod raid5rec
>     insmod lvm
>     insmod xfs
>
> Sanity check that you have all of the necessary modules installed
> (e.g., "mdraid*" "raid5rec").

How do you mean? Since 'set root' and 'configfile' makes it boot I'd
assume the modules are there?

I ran 'set' from grub2 shell and

cmdpath=(hd0)
prefix=(mduuid/####)/root=grub
root=mduuid/####

Where #### is the correct UUID.

Which looks ok?

Reply | Threaded
Open this post in threaded view
|

Re: Grub2 boot problem

Tom H-4
In reply to this post by Magnus Johansson
On Mon, Feb 5, 2018 at 4:00 PM, Magnus Johansson <[hidden email]> wrote:

>>>
>>> I've got a fresh Gentoo installation that does not boot. I just end up in
>>> the Grub2 shell.
>>>
>>> However when there if I do 'set root=(md/0)' and 'configfile /grub/grub.cfg'
>>> I do get to the Grub2 menu where Gentoo boots just fine.
>>>
>>> /boot and / are both on mdadm devices.
>>>
>>> I've tried re-running grub-mkconfig and grub-install several times without
>>> luck.
>>>
>>> I've added domdadm to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub.
>>>
>>> Drives sda/sdb use GPT disklabels and have 20M BIOS boot partitions first.
>>
>> To which device are you installing grub?
>>
>> Check what "core.img" prefix and modules grub-install is using with
>>
>> grub-install --debug $your_device 2>&1 | grep grub-mkimage
>>
>> [I hit a similar problem with mdadm 6 or 7 years ago and had to create
>> a custom "core.img" to boot normally. You might have to do the same
>> but i would've thought that this problem's been solved. I haven't
>> encountered it since.]
>
> I install grub to devices sda and sdb in the hope I can boot from both/either
>
> m / # grub-install --debug /dev/sda 2>&1 | grep grub-mkimage
> grub-install: info: grub-mkimage --directory '/usr/lib/grub/i386-pc'
> --prefix '(mduuid/46488b259685a3b9c52b7449d592dc80)/grub' --output
> '/boot/grub/i386-pc/core.img' --format 'i386-pc' --compression 'auto'
> 'ext2' 'part_gpt' 'part_gpt' 'diskfilter' 'mdraid1x' 'biosdisk'
> m / #

[ I assume that "46488b259685a3b9c52b7449d592dc80" is the UUID that's
displayed as "UUID" or "Array UUID" when you use "mdadm -D ..." or
"mdadm -E ..." respectively ]

Does "set" in the grub shell display
"prefix=(mduuid/46488b259685a3b9c52b7449d592dc80)/grub" and
"root=(mduuid/46488b259685a3b9c52b7449d592dc80)"?

Does "grub-probe -t drive -d /dev/md0" output "(mduuid/...)" or
"(md/0)" or "(md0)"?

Reply | Threaded
Open this post in threaded view
|

Re: Grub2 boot problem

Tom H-4
In reply to this post by Magnus Johansson
On Sat, Feb 10, 2018 at 10:28 AM, Magnus Johansson <[hidden email]> wrote:

> 2018-02-07 18:50 GMT+01:00 Steven Lembark <[hidden email]>:
>> On Mon, 5 Feb 2018 22:00:39 +0100
>> Magnus Johansson <[hidden email]> wrote:
>>
>> From my grub.cfg:
>>
>>     insmod gzio
>>     insmod part_msdos
>>     insmod diskfilter
>>     insmod mdraid1x
>>     insmod raid5rec
>>     insmod lvm
>>     insmod xfs
>>
>> Sanity check that you have all of the necessary modules installed
>> (e.g., "mdraid*" "raid5rec").
>
> How do you mean? Since 'set root' and 'configfile' makes it boot I'd
> assume the modules are there?
>
> I ran 'set' from grub2 shell and
>
> cmdpath=(hd0)
> prefix=(mduuid/####)/root=grub
> root=mduuid/####
>
> Where #### is the correct UUID.
>
> Which looks ok?

The "prefix=" line isn't OK, unless you've mistyped it.

Reply | Threaded
Open this post in threaded view
|

Re: Grub2 boot problem

Magnus Johansson
In reply to this post by Tom H-4
>>>> I've got a fresh Gentoo installation that does not boot. I just end up in
>>>> the Grub2 shell.
>>>>
>>>> However when there if I do 'set root=(md/0)' and 'configfile /grub/grub.cfg'
>>>> I do get to the Grub2 menu where Gentoo boots just fine.
>>>>
>>>> /boot and / are both on mdadm devices.
>>>>
>>>> I've tried re-running grub-mkconfig and grub-install several times without
>>>> luck.
>>>>
>>>> I've added domdadm to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub.
>>>>
>>>> Drives sda/sdb use GPT disklabels and have 20M BIOS boot partitions first.
>>>
>>> To which device are you installing grub?
>>>
>>> Check what "core.img" prefix and modules grub-install is using with
>>>
>>> grub-install --debug $your_device 2>&1 | grep grub-mkimage
>>>
>>> [I hit a similar problem with mdadm 6 or 7 years ago and had to create
>>> a custom "core.img" to boot normally. You might have to do the same
>>> but i would've thought that this problem's been solved. I haven't
>>> encountered it since.]
>>
>> I install grub to devices sda and sdb in the hope I can boot from both/either
>>
>> m / # grub-install --debug /dev/sda 2>&1 | grep grub-mkimage
>> grub-install: info: grub-mkimage --directory '/usr/lib/grub/i386-pc'
>> --prefix '(mduuid/46488b259685a3b9c52b7449d592dc80)/grub' --output
>> '/boot/grub/i386-pc/core.img' --format 'i386-pc' --compression 'auto'
>> 'ext2' 'part_gpt' 'part_gpt' 'diskfilter' 'mdraid1x' 'biosdisk'
>> m / #
>
> [ I assume that "46488b259685a3b9c52b7449d592dc80" is the UUID that's
> displayed as "UUID" or "Array UUID" when you use "mdadm -D ..." or
> "mdadm -E ..." respectively ]

Almost, mdadm says 46488b25:9685a3b9:c52b7449:d592dc80

> Does "set" in the grub shell display
> "prefix=(mduuid/46488b259685a3b9c52b7449d592dc80)/grub" and
> "root=(mduuid/46488b259685a3b9c52b7449d592dc80)"?

Yes, I messed up the prefix=-line when retyping it.

> Does "grub-probe -t drive -d /dev/md0" output "(mduuid/...)" or
> "(md/0)" or "(md0)"?

It ouputs "(mduuid/46488b259685a3b9c52b7449d592dc80)"

Reply | Threaded
Open this post in threaded view
|

Re: Grub2 boot problem

mad.scientist.at.large

you need to include the punctuation, specifically the ":"s, which usually are a "-", mac addresses use the ":" but unless the syntax has changed/broadened you have to have the "-" for seperating the fields in a uuid.  The punctuation is  part of the syntax (besides breaking the uuid into sections which makes it easier to copy/verify).   for data overload see <https://en.wikipedia.org/wiki/Universally_unique_identifier> and the associated links.


mad.scientist.at.large (a good madscientist)
--
God bless the rich, the greedy and the corrupt politicians they have put into office.   God bless them for helping me do the right thing by giving the rich my little pile of cash.  After all, the rich know what to do with money.


12. Feb 2018 16:16 by [hidden email]:
>>>>>snip
I've got a fresh Gentoo installation that does not boot. I just end up in
the Grub2 shell.
Almost, mdadm says 46488b25:9685a3b9:c52b7449:d592dc80
Does "set" in the grub shell display
"prefix=(mduuid/46488b259685a3b9c52b7449d592dc80)/grub" and
"root=(mduuid/46488b259685a3b9c52b7449d592dc80)"?

Yes, I messed up the prefix=-line when retyping it.
Does "grub-probe -t drive -d /dev/md0" output "(mduuid/...)" or
"(md/0)" or "(md0)"?

It ouputs "(mduuid/46488b259685a3b9c52b7449d592dc80)"
Reply | Threaded
Open this post in threaded view
|

Re: Grub2 boot problem

Magnus Johansson
> you need to include the punctuation, specifically the ":"s, which usually
> are a "-", mac addresses use the ":" but unless the syntax has
> changed/broadened you have to have the "-" for seperating the fields in a
> uuid.  The punctuation is  part of the syntax (besides breaking the uuid
> into sections which makes it easier to copy/verify).   for data overload see
> <https://en.wikipedia.org/wiki/Universally_unique_identifier> and the
> associated links.

So what should I change and where? I seem to get three different
formats depending on source:

m ~ # blkid
/dev/md127: UUID="cd3438aa-c02b-4d03-8085-596a8d60b7c2" TYPE="ext4"
/dev/sdb4: UUID="533875eb-d678-7e77-285b-41ab6c964566"
UUID_SUB="1f217f50-3b45-921c-629c-7e5df708964f" LABEL="livecd:2"
TYPE="linux_raid_member" PARTLABEL="root"
PARTUUID="a2ae84d5-1ede-428e-9beb-816ea57bfa05"
/dev/md125: UUID="6fd35ea8-dc72-46ac-b009-e722ca3d5487" TYPE="ext2"
/dev/sdb2: UUID="46488b25-9685-a3b9-c52b-7449d592dc80"
UUID_SUB="25f34072-d83d-2a6c-0e3f-7d6df5161b1b" LABEL="livecd:0"
TYPE="linux_raid_member" PARTLABEL="boot"
PARTUUID="91c5c25d-4742-4e7e-b1b9-4f759c359e90"
/dev/md126: UUID="fdecc9e5-e411-4d32-a591-ee03850bb538" TYPE="swap"
/dev/sdb3: UUID="04b7f579-0264-ee93-dc84-276121816571"
UUID_SUB="dc306764-79d7-b606-058e-d855f59f2757" LABEL="livecd:1"
TYPE="linux_raid_member" PARTLABEL="swap"
PARTUUID="988650cb-dbc0-4b2b-a314-959f18537bd6"
/dev/sda2: UUID="46488b25-9685-a3b9-c52b-7449d592dc80"
UUID_SUB="ab474afa-d46a-4bbc-31fd-735cdb95673c" LABEL="livecd:0"
TYPE="linux_raid_member" PARTLABEL="boot"
PARTUUID="46916efb-ef91-45ce-8aa8-c2cee33b980f"
/dev/sda3: UUID="04b7f579-0264-ee93-dc84-276121816571"
UUID_SUB="ec6eca1f-26e9-b328-642a-884643c9df48" LABEL="livecd:1"
TYPE="linux_raid_member" PARTLABEL="swap"
PARTUUID="9fb247a0-3eaf-4bc2-a58b-117c9f662355"
/dev/sda4: UUID="533875eb-d678-7e77-285b-41ab6c964566"
UUID_SUB="54b01e83-bbc4-4fb4-7f6f-1c3dcb7c198b" LABEL="livecd:2"
TYPE="linux_raid_member" PARTLABEL="root"
PARTUUID="b10527b2-a782-478a-aaf5-a2fc268bdb5d"
/dev/sdb1: PARTLABEL="grub" PARTUUID="54981880-24b5-4194-b0a7-049f575861b4"
/dev/sda1: PARTLABEL="grub" PARTUUID="a7ec1c8e-688f-43ed-8597-04717e93ce8d"
m ~ # grub-probe -t drive -d /dev/md125
(mduuid/46488b259685a3b9c52b7449d592dc80)
m ~ # mdadm -D /dev/md125 | grep UUID
           UUID : 46488b25:9685a3b9:c52b7449:d592dc80
m ~ #

Reply | Threaded
Open this post in threaded view
|

Re: Grub2 boot problem

Tom H-4
In reply to this post by Magnus Johansson
On Mon, Feb 12, 2018 at 6:16 PM, Magnus Johansson <[hidden email]> wrote:


>> [ I assume that "46488b259685a3b9c52b7449d592dc80" is the UUID that's
>> displayed as "UUID" or "Array UUID" when you use "mdadm -D ..." or
>> "mdadm -E ..." respectively ]
>
> Almost, mdadm says 46488b25:9685a3b9:c52b7449:d592dc80

OK; grub's mduuid has the separators removed (I assume that it makes
its life simpler).


>> Does "set" in the grub shell display
>> "prefix=(mduuid/46488b259685a3b9c52b7449d592dc80)/grub" and
>> "root=(mduuid/46488b259685a3b9c52b7449d592dc80)"?
>
> Yes, I messed up the prefix=-line when retyping it.

:)


>> Does "grub-probe -t drive -d /dev/md0" output "(mduuid/...)" or
>> "(md/0)" or "(md0)"?
>
> It ouputs "(mduuid/46488b259685a3b9c52b7449d592dc80)"

I was hoping that it wouldn't and that we could then point to a
problem or a bug.

I'm stumped. It's been a while since I've had to troubleshoot grub
but, AFAIR, the fact that you are at the grub shell rather than the
grub rescue shell means that core.img is loaded and "prefix" and
"root" are set and recognized. So it's pretty weird that you have to
set "root=(md/0)" in order to boot (although, if you run "ls",
"(md/0)" will be listed so it's not an alien value). You could check
what modules are loaded with "lsmod" (if you need to page through the
list, run "set pager=1" first). I can't see how "mdraid1x" (and other
disk-related modules like "biosdisk" and "diskfilter") wouldn't be
listed given your "grub-install ... | grep ..." output and you're
being at the grub shell.

I don't know whether your "grub.cfg" is read before you reach the grub
shell but you could try to edit it, delete the "search ... --set=root
..." lines, and change the "set
root=(mduuid/46488b259685a3b9c52b7449d592dc80)" to "set root=(md/0)",
both in the 00_header section. It would go against the general move to
using UUIDs but...

Reply | Threaded
Open this post in threaded view
|

Re: Grub2 boot problem

Tom H-4
In reply to this post by mad.scientist.at.large
On Mon, Feb 12, 2018 at 7:21 PM,  <[hidden email]> wrote:
>
> you need to include the punctuation, specifically the ":"s, which
> usually are a "-", mac addresses use the ":" but unless the syntax has
> changed/broadened you have to have the "-" for seperating the fields
> in a uuid.  The punctuation is  part of the syntax (besides breaking
> the uuid into sections which makes it easier to copy/verify).

Please bottom-post.

No, grub's "(mduuid/...)" doesn't use separators (but the "(lvmid/...)" does!).

Reply | Threaded
Open this post in threaded view
|

Fwd: Re: [gentoo-user] Grub2 boot problem

Tom H-4
Wonderful off-list message...


---------- Forwarded message ----------
From:  <[hidden email]>
Date: Tue, Feb 13, 2018 at 4:40 PM
Subject: Fwd: Re: [gentoo-user] Grub2 boot problem
To: Tom H <[hidden email]>


Please FUCK OFF.  if you must make noise, please do it off list.
Please also learn what a moderator is, and the fact that you are not
one.  Gee, i can't top post with this account, but being a foogle
skank you wouldn't understand.

mad.scientist.at.large (a good madscientist)
--
God bless the rich, the greedy and the corrupt politicians they have
put into office.   God bless them for helping me do the right thing by
giving the rich my little pile of cash.  After all, the rich know what
to do with money.


Date: 13. Feb 2018 05:59
From: [hidden email]
To: [hidden email]
Subject: Re: [gentoo-user] Grub2 boot problem

On Mon, Feb 12, 2018 at 7:21 PM, <[hidden email]> wrote:


you need to include the punctuation, specifically the ":"s, which
usually are a "-", mac addresses use the ":" but unless the syntax has
changed/broadened you have to have the "-" for seperating the fields
in a uuid. The punctuation is part of the syntax (besides breaking
the uuid into sections which makes it easier to copy/verify).


Please bottom-post.

No, grub's "(mduuid/...)" doesn't use separators (but the "(lvmid/...)" does!).