Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Reboot and Select proper Boot device or Insert Boot Media
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
kiigass
n00b
n00b


Joined: 21 Nov 2018
Posts: 39

PostPosted: Tue Sep 01, 2020 11:36 am    Post subject: Reboot and Select proper Boot device or Insert Boot Media Reply with quote

Hi,

Background:
I installed gentoo a while ago and everything worked find. Then I needed Windows for a reason. I detached the gentoo ssd and attached a new ssd to my computer. I installed windows on that new ssd. Then I detached that windows ssd and re-attached my gentoo ssd to the computer.

Problem:
When I now try to boot my gentoo ssd I get:
Code:
Reboot and Select proper Boot device or Insert Boot Media in selected Boot device and press a key


Question:
Where do I need to look for the problem a solution?
I would think, that my grub should be ok, since I detached the ssd, such that windows cannot mess with that. On my gentoo ssd there is a 2MB legacy boot partition and an efi boot partition.

thank you for any help
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Tue Sep 01, 2020 2:25 pm    Post subject: Reply with quote

your motherboard firmware (uefi or bios) was reset by windows. do whatever your particular machine needs to get into the firmware boot menu and select grub as first boot choice.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
kiigass
n00b
n00b


Joined: 21 Nov 2018
Posts: 39

PostPosted: Tue Sep 01, 2020 5:30 pm    Post subject: Reply with quote

I am not sure if I understood you correctly. I got into the uefi and there, in the boot menu, I selected the hard drive to boot from. It did say nothing about grub at that point, only the hard disc/ssd. Unfortunately that did not change the result. I got the same error message again.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Tue Sep 01, 2020 7:09 pm    Post subject: Reply with quote

the choice you need is probably listed as gentoo possibly grub in the boot menu, selecting the hard drive will not work unless using a legacy bios mode
it is possible that windows removed the grub boot option from the firmware in addition to demoting it
if so you will need to boot a live linux cd/usb, enter the chroot, and use efibootmgr or grub_install to regenerate the grub boot option and set it as the first boot option
see the wiki's

Edit: Windows probably will have turned on Secure Boot if it installed as UEFI (default for current Win10).
Your user manual should tell you the uefi setting to turn it off, https://www.rodsbooks.com/efi-bootloaders/controlling-sb.html gives options for dealing with it.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
bammbamm808
Guru
Guru


Joined: 08 Dec 2002
Posts: 516
Location: Hawaii

PostPosted: Thu Sep 03, 2020 5:31 am    Post subject: Reply with quote

kiigass wrote:
I am not sure if I understood you correctly. I got into the uefi and there, in the boot menu, I selected the hard drive to boot from. It did say nothing about grub at that point, only the hard disc/ssd. Unfortunately that did not change the result. I got the same error message again.

There is a list of bootable 'stuff' in your UEFI that needs to contain entries for any OS you want to boot. This is in addition to having a bootable install for each OS. Windows not only added itself to this list, but removed your grub entry that allowed you to boot linux. Use a live or sysrescue linux to fix your efivars using 'efibootmgr'. You will have to mount your efivars rw before you can do this.
_________________
Asrock X470 Taichi
Ryzen 2700x
32Gb Samsung B-die (16GB dual rank x2) DDR4
Geforce GTX 1060 6GB
Samsung Evo 840 500Gb +Seagate 1TB HDD
Etc....
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3517

PostPosted: Thu Sep 03, 2020 7:30 am    Post subject: Reply with quote

kiigass wrote:
I am not sure if I understood you correctly. I got into the uefi and there, in the boot menu, I selected the hard drive to boot from. It did say nothing about grub at that point, only the hard disc/ssd. Unfortunately that did not change the result. I got the same error message again.

You might have to re-create the UEFI boot item. Some computers allow to do this from the BIOS via "Add Boot Option".
Back to top
View user's profile Send private message
kiigass
n00b
n00b


Joined: 21 Nov 2018
Posts: 39

PostPosted: Mon Sep 14, 2020 4:29 pm    Post subject: Reply with quote

Hey, thanks alot for your hints. I followed them, but did not get to a solution yet, unfortunately. I checked my BIOS/UEFI: There is neither a secure boot option nor an option to add a boot option. (I am using an ASUS UEFI 2.10.1208 from 2012).

It feels I am close to a solution, but I cannot get to it. Let me share what I did, so you can better understand me and maybe help somebody in the future with the same problem:

1. Right after booting into the live system my efibootmgr looked like this:https://i.ibb.co/C5fh2LX/20200914-173704.jpg
These two entries are the auto-generated entries for the usb thumb drive on which the live system is. (UEFI and old fashioned bios)

2. This is my disk setup. https://i.ibb.co/3p4ggF7/20200914-173802.jpg
I have both, an old MBR for BIOS booting and an UEFI partition.

3. This is my lvm setup: https://i.ibb.co/7RG9HqF/20200914-174125.jpg
There is only one volume group with three logic volumes: one for swap, /var/ and /

4. I did this to setup my chroot: https://i.ibb.co/njrMykq/20200914-174444.jpg
I basically mounted all the stuff there is. I made sure to also mount the /boot/ partition and that the efivars are mounted rw.
I got my information from here:
https://wiki.gentoo.org/wiki/Chroot
https://wiki.gentoo.org/wiki/Efibootmgr

5. Next, I deleted all existing efi boot entries: https://i.ibb.co/wKgTY9L/20200914-174537.jpg

6. I ran the grub-installer (https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader#Install), which what kind enough to add a new efi boot entry for me, yeay! https://i.ibb.co/RSCR7jn/20200914-174758.jpg

This looks quite good, but after rebooting my machine, the newly created entry is gone and only the two from the thumb drive are remaining (most probably recreated by the firmware).
As I mentioned above, I think I am close, but missing the last step somewhere.

Would you mind helping me out, please?
Any help is appreciated, gentlemen. Please excuse my late response.
Back to top
View user's profile Send private message
pietinger
Guru
Guru


Joined: 17 Oct 2006
Posts: 350
Location: Bavaria

PostPosted: Mon Sep 14, 2020 5:11 pm    Post subject: Reply with quote

Do you find in your BIOS something like CSM ? If yes, you must disable this (in every case; also to get an entry for SecureBoot). See also: https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface#CSM_booting
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Mon Sep 14, 2020 5:45 pm    Post subject: Reply with quote

2012 uefi and efibootmgr creating boot options that disappear -- I remember that happening during my 2012 first experiments with UEFI
BTW, grub-install does use efibootmgr to create the UEFI boot option "gentoo/grubx64"
in 2012 I found that I had to use bcdedit in Windows 10 to create a UEFI boot option that would not disappear,
my reference was -- https://www.rodsbooks.com/refind/installing.html#windows -- I also needed the included warning:
Warning: Windows 8 and later implement a fast shutdown feature that helps speed up shutdown and startup operations on a single-boot computer. Unfortunately, this feature can cause filesystem corruption if it's used on a multi-boot computer. You can disable the feature by launching an Administrator Command Prompt window and typing powercfg /h off in it.
Later on I replaced the UEFI software that came installed in the motherboard firmware with a newer generic version (binary download) that did
not erase changes to the boot options.

Recommend visiting https://www.rodsbooks.com/refind/getting.html and making a refind cd or usb and using that until ...
_________________
Defund the FCC.
Back to top
View user's profile Send private message
kiigass
n00b
n00b


Joined: 21 Nov 2018
Posts: 39

PostPosted: Tue Sep 15, 2020 10:13 am    Post subject: Reply with quote

I checked my BIOS/UEFI, I could find nothing like CSM or similar. I disabled everything I could find regarding Legacy Bios compatibility.

I used refind a few year ago, when Grub2 was not yet supporting UEFI. As far as I remember refind detected the OS automatically. When I booted the refind I got this: https://i.ibb.co/XWBWXtH/20200915-115141.jpg
Please note: I removed the Windows SSD as mentioned in my first post.

I did more research and found a note about EDD 3 here: https://wiki.archlinux.org/index.php/Unified_Extensible_Firmware_Interface#Boot_entries_created_with_efibootmgr_fail_to_show_up_in_UEFI
I did the trick with the wrapper as described there and ran
Code:
grub-install --target=x86_64-efi --efi-directory=/boot

I had a small success here! The boot entry which is created by grub-install persists after reboot! https://i.ibb.co/JkmNg03/20200915-115345.jpg

Unfortunately it does not boot on this entry, i.e. the entry does not work/ does not boot gentoo.
I assume there must be something wrong with that entry. Any ideas?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Tue Sep 15, 2020 12:51 pm    Post subject: Reply with quote

pastebin or post /boot/grub/grub.cfg from the chroot or /mnt/mychroot/boot/grub/grub.cfg from the live install system
Do you have an efi stub kernel on /dev/sda2?
Do you have a not efi stub kernel on /dev/sda2?
You have lvm, how have you handled the initramfs?
Assume /dev/sda2 is formatted vfat and serves as both separate boot partition and EFI Systems Partition, am I correct?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
kiigass
n00b
n00b


Joined: 21 Nov 2018
Posts: 39

PostPosted: Tue Sep 15, 2020 3:57 pm    Post subject: Reply with quote

DONAHUE wrote:
pastebin or post /boot/grub/grub.cfg from the chroot or /mnt/mychroot/boot/grub/grub.cfg from the live install system
Do you have an efi stub kernel on /dev/sda2?
Do you have a not efi stub kernel on /dev/sda2?
You have lvm, how have you handled the initramfs?
Assume /dev/sda2 is formatted vfat and serves as both separate boot partition and EFI Systems Partition, am I correct?

First, let me thank you for your effort and questions!

Please find the grub.cfg here

To be honest, I did not know what a stub kernel is and had to look it up. Hence I think I do not have a stub kernel. I was using grub almost all my life. I created a
Code:
tree /boot/
here if that helps.

I created the initramfs with
Quote:
genkernel --lvm --install initramfs
My whole procedure to update my kernels is here.

I am not sure, if I understood your question correct. Let me answer this way:
Yes, /dev/sda2 is formatted vfat.
Yes, /dev/sda2 is mounted on /boot/.
Yes, /dev/sda2 is my EFI System Partition.
But, I also have a 2MB partition for the old BIOS MBR Boot. Please find my
Code:
fdisk -l /dev/sda
here.

Thanks again for your help!
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Tue Sep 15, 2020 5:27 pm    Post subject: Reply with quote

kiigass, in earlier post, wrote:
i.e. the entry does not work/ does not boot gentoo
did you see either of the end of grub.cfg messages:
'Loading Linux 4.19.72-gentoo ...' or 'Loading initial ramdisk ...'

Edit for fractured quote :oops:
_________________
Defund the FCC.


Last edited by DONAHUE on Tue Sep 15, 2020 5:59 pm; edited 2 times in total
Back to top
View user's profile Send private message
kiigass
n00b
n00b


Joined: 21 Nov 2018
Posts: 39

PostPosted: Tue Sep 15, 2020 5:42 pm    Post subject: Reply with quote

No, I see neither of those messages. After the Bios hard disc detection it goes directly to
Code:
Reboot and Select proper Boot device or Insert Boot Media in selected Boot device and press a key
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Tue Sep 15, 2020 5:57 pm    Post subject: Reply with quote

We know that your firmware can find and boot the install media on usb and refind on usb.
We know neither your firmware nor refind can find grub or a kernel on /dev/sda2.
please run blkid and look at PARTUUID= for /dev/sda2. Is the PARTUUID equal to c2fec670-a596-4833-90ee-ffad14c42b77 ? If not the partition is incorrectly identified in efibootmgr -v output and therefore in the UEFI firmware
_________________
Defund the FCC.


Last edited by DONAHUE on Wed Sep 16, 2020 3:32 am; edited 1 time in total
Back to top
View user's profile Send private message
Whissi
Developer
Developer


Joined: 12 Jan 2011
Posts: 166

PostPosted: Tue Sep 15, 2020 11:26 pm    Post subject: Reply with quote

kiigass wrote:
I created the initramfs with
Quote:
genkernel --lvm --install initramfs
My whole procedure to update my kernels is here.
This is wrong and asking for trouble: See genkernel's output when generating initramfs -- it will not use your kernel config from your manual build. So you will probably also end up with an initramfs not matching your kernel which might be unbootable. Please either build both, kernel and initramfs with genkernel or pass --kernel-config to genkernel when just building initramfs.
_________________
Regards,
Whissi
Back to top
View user's profile Send private message
kiigass
n00b
n00b


Joined: 21 Nov 2018
Posts: 39

PostPosted: Wed Sep 16, 2020 10:00 am    Post subject: Reply with quote

DONAHUE wrote:
We know that your firmware can find and boot the install media on usb and refind on usb.
We know neither your firmware nor refind can find grub or a kernel on /dev/sda2.
please run blkid and look at PARTUUID= for /dev/sda2. Is the PARTUUID equal to c2fec670-a596-4833-90ee-ffad14c42b77 ? If not the partition is incorrectly identified in efibootmgr -v output and therefore in the UEFI firmware

I ran blkid and the PARTUUID for /dev/sda2 is c2fec670-a596-4833-90ee-ffad14c42b77. :?

Whissi wrote:
This is wrong and asking for trouble: See genkernel's output when generating initramfs -- it will not use your kernel config from your manual build. So you will probably also end up with an initramfs not matching your kernel which might be unbootable. Please either build both, kernel and initramfs with genkernel or pass --kernel-config to genkernel when just building initramfs.


Thanks, I didn't know that. I will do better next time, I promise.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Wed Sep 16, 2020 6:14 pm    Post subject: Reply with quote

random thoughts:
windows may have tampered with the UEFI firmware and the effect persists
UEFI update?
the firmware may be associating sda2 with lvm.
if the removed windows drive and the linux drive have been connected to the same sata jack, try a different jack.
fdisk to delete and remake /dev/sda1 with a partition type other than 'BIOS boot' (perhaps 0 'empty') and no file system on it
add another usb or better yet a second disk, (pretending the kernel named it /dev/sdb), with /dev/sdb1, formatted fat32, on it. boot the install media,
Code:
mkdir /mnt/a2
mount /dev/sda2 /mnt/a2   
mkdir /mnt/b1
mount /dev/sdb1 /mnt/b1
copy the kernel and initramfs and grubx64.efi from /mnt/a2 to /mnt/b1. reboot to refind and see if refind sees the kernel and/or grub. If you see the kernel icon in refind but the kernel is still not an EFI stub, it will not boot. If you see a grub icon, it should be fully functional.

While there try the assorted new to me icons, they can make changes that used to require entering the uefi screens.

I created a second partition on my brand new refind usb. Formatted it as fat32. Built a genkernel efi stub kernel and initramfs and copied them to the new partition on the refind usb. Rebooted to the refind usb. Refind automatically found the genkernel efi stub kernel and initramfs and loaded the initramfs and the kernel and then the operating system. Copied grubx64.efi from my ESP to the second partition on my brand new refind usb. Refind was able to find and start grub also. Sounds as though a workaround of whatever windows jiggered in the firmware should be possible.
_________________
Defund the FCC.
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