Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub drops to prompt after mkconfig finds Win10 [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6639
Location: The soundosphere

PostPosted: Mon Mar 19, 2018 9:03 pm    Post subject: Grub drops to prompt after mkconfig finds Win10 [SOLVED] Reply with quote

I just set up a dual-boot with Win10. In chroot, grub-mkconfig would not find Win10. (os-prober is installed.) But after booting into my fresh Gentoo install, I could grub-mkconfig again and Win10 was found. But thereafter, Grub dropped to a prompt. I fixed it by chrooting back in and running grub-mkconfig again, where Win10 was not found by Grub.

Until I fix this, I'm using the BIOS to boot into Win10 when I need it.

So it seems something goes wrong when Grub picks up Win10, although no error is reported. What's happening and how do I fix it?
_________________
decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN


Last edited by audiodef on Mon May 07, 2018 11:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Mon Mar 19, 2018 9:45 pm    Post subject: Reply with quote

Are either or neither or both Win10 and Gentoo installed as UEFI?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6639
Location: The soundosphere

PostPosted: Tue Mar 20, 2018 12:53 pm    Post subject: Reply with quote

Both installed as UEFI with the laptop in full UEFI mode.

I forgot to mention - if this is important - that as an experiment, I used the EFI partition that Win10 set up during its own install. I figured it should work, since creating another EFI partition for Gentoo would simply result in a second EFI partition with exactly the same fs anyway. There is plenty of space on this partition to hold both Win10 and Gentoo EFI stuff.
_________________
decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Tue Mar 20, 2018 2:52 pm    Post subject: Reply with quote

"I used the EFI partition that Win10 set up during its own install." That is absolutely the right thing to do. Multiple EFI Systems Partition's (ESP) can cause confusion.
It appears that grub installed on the ESP but can't find or can't read grub.cfg.
Are you sure Windows is behaving? boot windows, Press Win + R > type msinfo32 > press Enter. BIOS Mode entry should be UEFI
Are you sure that the installed Gentoo system was in UEFI mode when you were running grub-install? Boot installed Gentoo. and run
Code:
mount
; if "efivarfs on /sys/firmware/efi/efivars type efivarfs (ro,relatime)" appears in the output, your install is in uefi mode and the kernel supports efivars.
Run:
Code:
emerge wgetpaste
ls -lR  /boot | wgetpaste -t

If you are using a separate boot partition,
Code:
mount /boot
ls -lR  /boot | wgetpaste -t
Mount the ESP, assuming the ESP is on /dev/sda2 (note that if /etc/fstab has an entry for /boot and for /boot/efi that the boot partition must be mounted before the ESP is mounted or grub-install will go random) and assuming that you want the ESP to use mount point /boot/efi:
Code:
mount /boot/efi /dev/sda2
ls -lR  /boot | wgetpaste -t
fdisk -l | wgetpaste -t
mount | wgetpaste -t
post the url's returned.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6639
Location: The soundosphere

PostPosted: Tue Mar 20, 2018 4:45 pm    Post subject: Reply with quote

DONAHUE,

Thanks for your help. I'm glad I was right about using the existing EFI partition.

Windows is behaving. My install appears to be in UEFI mode. (It should be, no legacy options were enabled in the BIOS when installing both Windows and Gentoo.)

ls -lR /boot | wgetpaste -t: https://paste.pound-python.org/show/Chfh8syMEvk1zYKgwLHN/

Using a separate boot partition, but EFI is on the boot partition as /boot/EFI.

fdisk -l | wgetpaste -t: https://paste.pound-python.org/show/lz6lz87frCO0l0gjszam/

mount | wgetpaste -t: https://paste.pound-python.org/show/vPkqvXkYaLhBCHCpBZ6D/
_________________
decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Tue Mar 20, 2018 8:08 pm    Post subject: Reply with quote

Do you have to mind the exact command options used when you did grub-install?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6639
Location: The soundosphere

PostPosted: Wed Mar 21, 2018 2:02 am    Post subject: Reply with quote

I did
Code:

grub-install --efi-directory=/boot

No error was reported, I though I did have to mount -o rw,remount /boot and /sys/blah/efivars.

The weird thing is that grub only drops to a prompt when os-prober is present and picks up Windows, otherwise grub works as expected when booting up. (No Windows in grub, works fine, Windows in grub, drop to prompt.)
_________________
decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN
Back to top
View user's profile Send private message
bammbamm808
Guru
Guru


Joined: 08 Dec 2002
Posts: 548
Location: Hawaii

PostPosted: Wed Mar 21, 2018 2:40 am    Post subject: Reply with quote

If you get sick of spending do much effort configuring software you might not need, consider the rEFInd boot manager instead.
_________________
MSI MAG B550 Tomahawk
Ryzen 3900x
32Gb Samsung B-die (16GB dual rank x2) DDR4 @ 3200MHz, cl14
Geforce RTX 2070S 8GB
Samsung m.2 NVME pcie-3.0
Etc....
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6639
Location: The soundosphere

PostPosted: Wed Mar 21, 2018 1:34 pm    Post subject: Reply with quote

I was reading about using EFI itself as a bootloader, but I'd been haxxing with this laptop for several days, figuring out what dual-boot and config options I want, so I decided I wanted to stop haxxing and start using. Next time I set up a UEFI machine, though, I'm going to learn how to do this.
_________________
decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN
Back to top
View user's profile Send private message
skellr
l33t
l33t


Joined: 18 Jun 2005
Posts: 975
Location: The Village, Portmeirion

PostPosted: Wed Mar 21, 2018 2:59 pm    Post subject: Reply with quote

audiodef wrote:
Using a separate boot partition, but EFI is on the boot partition as /boot/EFI.


audiodef wrote:
I did
Code:

grub-install --efi-directory=/boot

....


I would try grub-install again with --efi-directory=/boot/EFI
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Wed Mar 21, 2018 4:38 pm    Post subject: Reply with quote

The ls -lR pastebin earlier shows "grub-install --efi-directory=/boot" worked well as far as placing correct files in the correct places on the ESP. (also known, in this case, as the boot partition).
If I grasp the problem correctly: booting installed Gentoo, mounting /boot, running grub-mkinstall -o /boot/grub/grub.cfg (with os-prober installed) produces output resembling mine
Quote:
grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Found Windows Boot Manager on /dev/nvme0n1p2@/efi/Microsoft/Boot/bootmgfw.efi
Found Gentoo/Linux on /dev/nvme1n1p1
Found SystemRescueCD on /dev/nvme1n1p1
done
thus showing os-prober finding windows.
I am presuming that
Quote:
But thereafter, Grub dropped to a prompt.
means on the subsequent reboot? If my presumption is correct the problem is that the generated /boot/EFI/gentoo/grubx64.efi can not find or can not read grub.cfg
If my presumption is wrong and grub-mkconfig displayed the os-prober information and then crashed to a grub prompt without an intervening reboot -- very interesting.
Suggest the following:
boot installed gentoo
Code:
mount /dev/nvme0n1p2 /boot
#copy and post the terminal output of the next 2 commands
#if any remounting required it is very strange
grub-install --target=x86_64-efi --efi-directory=/boot --boot-directory=/boot #excessive,redundant, I know
grub-mkconfig -o /boot/grub/grub.cfg
wgetpaste -t /boot/grub/grub.cfg
efibootmgr -v | wgetpaste -t
post url's, reboot
_________________
Defund the FCC.
Back to top
View user's profile Send private message
skellr
l33t
l33t


Joined: 18 Jun 2005
Posts: 975
Location: The Village, Portmeirion

PostPosted: Wed Mar 21, 2018 5:00 pm    Post subject: Reply with quote

DONAHUE wrote:
The ls -lR pastebin earlier shows "grub-install --efi-directory=/boot" worked well as far as placing correct files in the correct places on the ESP. (also known, in this case, as the boot partition).

Yes, it would seem to look like it was installed ok. I just wanted to make sure it wasn't saving the value of efi-directory and using it for something else later, or something else using it.
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6639
Location: The soundosphere

PostPosted: Thu Mar 22, 2018 12:36 pm    Post subject: Reply with quote

What's happening is this:

emerge -C os-prober (don't find Windows, leave it out)

grub-mkconfig -o /boot/grub/grub.cfg

Output as expected, succeeds

Reboot

Grub appears normally, boot into Gentoo

Now...

emerge os-prober (let's find Windows and include it)

grub-mkconfig -o /boot/grub/grub.cfg

Output as expected, succeeds, Gentoo and Windows written to grub.cfg

Reboot

Grub drops to prompt

If I emerge -C os-prober and redo grub-mkconfig, grub goes back to showing boot options and booting normally into Gentoo.

So the question is: why does this work when Windows is ignored, and grub drops to prompt on reboot after adding Windows to grub.cfg?
_________________
decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Thu Mar 22, 2018 4:10 pm    Post subject: Reply with quote

Is there any terminal output before the grub prompt appears?
Can you pastebin a grub.cfg that includes windows and one that does not?
Suggest print the windows containing grub.cfg. Then boot it and enter the windows menu commands manually at the grub prompt. Record any output from the commands.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6639
Location: The soundosphere

PostPosted: Mon May 07, 2018 11:27 pm    Post subject: Reply with quote

Finally got back to this issue and solved it (experimentally, not on purpose) by keywording os-prober and adding the "mount" use flag to grub. After that, grub-mkconfig simply worked as expected and I can choose Windows or Gentoo without having to go into the BIOS to make this choice.
_________________
decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum