Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem with booting a new board and/or new drive
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
seansmr
n00b
n00b


Joined: 04 Dec 2011
Posts: 52
Location: Bangkok

PostPosted: Wed Jan 02, 2019 6:01 pm    Post subject: Problem with booting a new board and/or new drive Reply with quote

In April this year I installed Gentoo on a new ASUS B360 motherboard with an i5 8400. It was my first Linux install on UEFI, but I had no trouble getting it booting. I just followed the install handbook.

Now I have a new H370 based motherboard, the same cpu and a few drives. For the drives, I have some NVMe and a regular SATA 2.5" I thought that I would have a new system running within a few hours. It was not to be.

My first installation, on the older machine, was actually done incorrectly, just slightly, but it worked. During the install of Grub2 on the new SATA drive using the old computer, I accidentally formated the boot drive of the old machine. Since I had never backed up a boot partition before, I took the chance to install Grub2 properly. It worked fine.

After installing grub2 on the SATA drive, I tried to boot the new computer. It would not boot, it was as if there was nothing installed on the drive yet. Failing in that, I tried the same thing on the NVMe drive, it wouldn't boot either.

I moved the SATA drive back to the older machine and tried to boot it. Again, like an empty drive. I have not tried moving any PCIe drives. This leads me to believe that there is something wrong with how I have installed Grub2. However, since I have done the same thing for working and non-working drives, I can't figure out what to do next.

Here are some observations about the drive and the UEFI BIOS:
- The working UEFI boot drive shows on the boot menu as "gentoo (drive details)"
- The other new drives just show as the drive name, as they did when they where new
- The new drives, with grub2 installed, do not show up with gentoo at the front
- The new drives, with grub2 installed, do not show up with the UEFI prefix on the boot menu, like USB drives do
- If I try to boot from either newly installed drive, nothing happens
- When I set the boot mode to UEFI only, these drives do not show up at all
- I have the flags set as in the manual
- I have tried making the MBR partition bootable as suggested somewhere

I copied or duplicated everything on the working machine to the new one. I can't think of anything more to try, except for using dd from the old, working install.

So, here I am looking for help.
Thanks in advance for any help
Back to top
View user's profile Send private message
niku
n00b
n00b


Joined: 23 Dec 2018
Posts: 38

PostPosted: Thu Jan 10, 2019 4:35 am    Post subject: Reply with quote

After installing grub, the NVRAM (on the motherboard) has to updated to let it know about the new module. Normally, grub-install would do that for you. Was that done? (When I installed grub on the disk I was using, the installer just said, "Could not prepare Boot variable: Read-only file system". I then had to remount efivarfs as rw, and then run the installer again.)

Check the Gentoo Wiki page on efibootmgr.
Back to top
View user's profile Send private message
seansmr
n00b
n00b


Joined: 04 Dec 2011
Posts: 52
Location: Bangkok

PostPosted: Mon Jan 21, 2019 4:59 am    Post subject: Reply with quote

Thank-you for the reply. I realize that I was way too verbose, the result of being tired, frustrated and having no idea of the problem. Later I realized that it was not even getting to grub.

I don't recall using efibootmgr last time, or if it is mentioned in the install guide. I am currently in a hospital, so I can't try it for a few days.
I am, finally, trying to install Gentoo on my Thinkpad T420, but it will not boot either.

I have found it hard to understand UEFI and grub2. I was just trying things until it works.


Last edited by seansmr on Wed Jan 30, 2019 10:24 am; edited 1 time in total
Back to top
View user's profile Send private message
niku
n00b
n00b


Joined: 23 Dec 2018
Posts: 38

PostPosted: Mon Jan 21, 2019 11:46 am    Post subject: Reply with quote

Yeah, you were too verbose!

I too found UEFI boot difficult to understand. Once I got it working, I was so scared of the whole business that I didn't touch my grub installation for years! But I think I now understand it.

About the failing Grub installation, I think efivarfs pratition mounted ro is creating a lot of problem to many people. In the Handbook's talk page, someone says "For grub-install with EFI, please include the 2 steps for EFI vars. Otherwise, grub-install will silently fail. ..." I too got stumped here. But when I added this information on the GRUB2 Quick Start wiki page, it was deleted. :evil:
Back to top
View user's profile Send private message
bammbamm808
Guru
Guru


Joined: 08 Dec 2002
Posts: 548
Location: Hawaii

PostPosted: Tue Jan 22, 2019 4:35 pm    Post subject: Reply with quote

UEFI is just something new. I had difficulty with it until I had struggled with it for a while. It will always be like this when there are new things to learn. As far as efivars being mounted ro, I think there are very good reasons for this. If you make a habit of googling error messages instead of trying to use the handbook as your only resouce, little gotchas like this are usually easily overcome. Remounting efivars rw is, in particluar, very easily solved by this method.
_________________
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
seansmr
n00b
n00b


Joined: 04 Dec 2011
Posts: 52
Location: Bangkok

PostPosted: Wed Jan 30, 2019 11:22 am    Post subject: Reply with quote

Thanks for the help on this. I finally have time to get back to it.

I now understand the concept of writing to NVRAM on the motherboard now, and that you can write the boot line in there.

Got the efivars in remount rw and installed grub, still doesn't work. There is no entry on the NVRAM.
When an USB drive is shown on the boot menu, it has an UEFI and legacy boot option. Installed drive do not have this option. They only show when legacy mode is selected in the BIOS, they do not even show when UEFI boot is set in the BIOS. Is this behavior specific to ASUS boards?

So, I booted up the old machine, installed in April and it is the same. It does have an entry at the top that starts with gentoo followed M2 drive (and partition number, I guess) So that must be the NVRAM entry.

So now I know that there is no way to boot using UEFI to attached storage without an NVRAM entry.
In April, I just followed the Gentoo install guide and it worked. I didn't understand it one bit.

How is it that following the Gentoo guide worked before and not now?
Is the solution to write the boot drive, partition manually? (Which I will try now)
Back to top
View user's profile Send private message
seansmr
n00b
n00b


Joined: 04 Dec 2011
Posts: 52
Location: Bangkok

PostPosted: Wed Jan 30, 2019 12:13 pm    Post subject: Reply with quote

Ok, using efibootmgr doesn't work.

Almost have this working, just one small problem:
It doesn't work because it sees it as an MBR drive. Makes some sense as I tried the "Protective MBR" option I found, when it didn't work.

Disk flags show as: pmbr_boot

Removed that flag, still calls it an MBR drive. Is it possible fix this?
Back to top
View user's profile Send private message
seansmr
n00b
n00b


Joined: 04 Dec 2011
Posts: 52
Location: Bangkok

PostPosted: Wed Jan 30, 2019 8:01 pm    Post subject: Reply with quote

I got it working by installing Grub2 on a 3rd disk and not following instructions. No need to use efibootmgr, the boot info is written to NVRAM automatically, as it should be.
The key to getting it working is to not mount any efi partition to /boot/efi. That is what I did different.

Neither the Gentoo install guide nor the Grub2 wiki will get you booting UEFI correctly. Each has necessary info that the other doesn't have. Some is obvious.
Just don't boot any partition 1 to /boot/efi, if you have followed instructions that say this.

UEFI and Grub2 are not just new, they actually are much more complicated than the old way. GPT may be great, but the cost to be able to use it is high.
Back to top
View user's profile Send private message
bammbamm808
Guru
Guru


Joined: 08 Dec 2002
Posts: 548
Location: Hawaii

PostPosted: Wed Jan 30, 2019 8:05 pm    Post subject: Reply with quote

Yeah. you need to make use of all your storage option: Turn off CSM in bios. Boot the rescue/install environment, cp -a all of your data over to storage space, wipe the partition of the drive you want to boot UEFI and create a new GPT partition table and formatted partitions, copy your data back via 'cp -a', (dont forget your efi system partition). Then chroot in and reinstall grub, running efibootmgr as needed.
_________________
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
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