Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] UEFI, GPT, GRUB2, no boot :-(
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
WvR
Apprentice
Apprentice


Joined: 03 Mar 2011
Posts: 183
Location: Tsuruga, Japan

PostPosted: Sat Aug 12, 2017 3:15 pm    Post subject: [SOLVED] UEFI, GPT, GRUB2, no boot :-( Reply with quote

Today I built a PC for the first time in my life:

- MSI H110M PRO-VH motherboard
- Intel Core i5 CPU
- 8 GB RAM
- Adata SU800 512 GB SSD SATA

I have more than 15 years of experience with Gentoo and over the years I have installed it on my computers. I am not a guru but not a novice either. This PC will only have Gentoo (maybe Minix3 later...) so I do not need dual booting with Windows. I have created a bootable USB with SystemRescueCD, which boots fine. The X-server and network also work.

I followed the Gentoo Installation Handbook, I created a GPT partition label and I created the partitions as in the handbook (more or less):

Code:
 root@sysresccd /root % parted /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                               
Model: ATA ADATA SU800 (scsi)
Disk /dev/sda: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: pmbr_boot

Number  Start   End     Size    File system     Name    Flags
 1      1049kB  3146kB  2097kB  btrfs           grub    bios_grub
 2      3146kB  540MB   537MB   fat32           boot    boot, esp
 3      540MB   34.1GB  33.6GB  linux-swap(v1)  swap
 4      34.1GB  480GB   446GB   ext4            rootfs
 5      480GB   490GB   10.5GB  ext3            minix
 6      490GB   512GB   21.9GB  fat32           other


I guess I should use UEFI to be up-to-date. I have compiled a kernel with genkernel and OpenRC (I will switch to systemd later); I have set the profile to the simplest setting.

I have installed GRUB2 (I double-checked the USE flags), and I have followed each and every step in the Gentoo manual to the letter:

- mounted /dev/sda2 as /boot with vfat file system
- root #grub-install --target=x86_64-efi --efi-directory=/boot
- root #grub-mkconfig -o /boot/grub/grub.cfg

There are no error messages from GRUB2, and GRUB mentions that the kernel and the initramfs etc are found by grub-mkconfig.

When I reboot the PC, I always end up in a 640x480 VGA screen telling me "no bootable media found, please reboot". The motherboard has a configuration utility, and "boot" is set to "UEFI + Legacy"; there are 13 (!) boot options, but the first one is "UEFI Hard Disk" which sound OK to me. I tried to set "boot" to "UEFI" but that did not change anything.

There is NO GRUB2 menu, which means that the boot process is going wrong before GRUB2 becomes active. Thus perhaps the information is not in the correct place on the hard disk. I tried:

Code:
root #grub-install --target=x86_64-efi --efi-directory=/boot --removable


but that did not change anything. I am stumped. Over the years I have had kernel errors, kernels which did not boot, but this is the first time that not even GRUB works. What am I doing wrong?


Last edited by WvR on Wed Aug 16, 2017 1:09 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43994
Location: 56N 3W

PostPosted: Sat Aug 12, 2017 3:25 pm    Post subject: Reply with quote

WvR,

Some brain dead systems check for the bootable flag to be set on a partition.
Its never actually been required.

The message "no bootable media found, please reboot" comes from the firmware.

With UEFI, you shouldn't need to do this but its worth a try.
Run
Code:
fdisk -t dos /dev/sda
and set the bootable flag on the single partition in the fake msdos partition table.
You must not do anything else here. This partition table is a warning that GPT is in use.
However if your system tries to read the MSDOS partition table bootable flag, this it where it looks.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
WvR
Apprentice
Apprentice


Joined: 03 Mar 2011
Posts: 183
Location: Tsuruga, Japan

PostPosted: Mon Aug 14, 2017 1:26 am    Post subject: Reply with quote

NeddySeagoon,

I tried your recommendation bit it did not change the situation.

Meanwhile, I have:

- updated the motherboard BIOS
- checked all possible BIOS settings for anything that could be related to booting (nothing found)
- changed motherboard setting "Windows 7 installation" to "disabled" (the BIOS utility lists several items related to Windows installations but they are all "disabled")
- disabled all "fast boot" settings

I have completely re-installed the system following the Gentoo Installation Handbook to the letter and still:

"Reboot and select proper boot device or insert boot media in selected boot device and press a key"......

I guess the next step is to try efibootmgr.....? This is driving me up the wall, I've never had such a thing happening.

The GRUB2 menu does NOT appear, when the machine boots, the MSI boot screen flashes and then immediately the "reboot...." message appears.
Back to top
View user's profile Send private message
WvR
Apprentice
Apprentice


Joined: 03 Mar 2011
Posts: 183
Location: Tsuruga, Japan

PostPosted: Mon Aug 14, 2017 1:38 am    Post subject: Reply with quote

By the way: if I set the motherboard to "Boot: UEFI" then the machine does not work at all, and I can only enter the BIOS setup utility.

If I set it to "Boot: LEGACY+UEFI" I get the "Reboot..." message.

In the list of boot devices (F11), the SATA hard disk is mentioned, but not as "UEFI Hard Disk", just as "Hard Disk". All this indicates that my machine is booting in "legacy" mode and not in UEFI mode? Is there any special setting on the hard disk to make it "UEFI bootable"?

Can someone clarify this for me, I don't understand.
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 634

PostPosted: Mon Aug 14, 2017 2:02 am    Post subject: Reply with quote

I feel your pain. I struggled with a hybrid BIOS that tries to straddle legacy and UEFI. I finally got settled into pure UEFI mode. In the process I switched from grub to reFind. (I'm not recommending you do that now unless you are OK with spending a lot more time learning refind).

Personally I would try to get it to work in pure UEFI mode, not a hybrid. Unless you have devices that you need to boot from in legacy mode.

It would not hurt to just look with efibootmgr. It might give you a clue as to what the problem is. I had an issue where the bootnum / device that I wanted to boot was not "active". Since it was not active, upon booting it displayed a blank screen exactly as I describe. If it is not active, it will not have an asterisk (*) next to it in the list.

Here is an excerpt from the efibootmgr man page:
Code:
   DISPLAYING THE CURRENT SETTINGS (MUST BE ROOT).
       [root@localhost ~]# efibootmgr
       BootCurrent: 0004
       BootNext: 0003
       BootOrder: 0004,0000,0001,0002,0003
       Timeout: 30 seconds
       Boot0000* Diskette Drive(device:0)
       Boot0001* CD-ROM Drive(device:FF)
       Boot0002* Hard Drive(Device:80)/HD(Part1,Sig00112233)
       Boot0003* PXE Boot: MAC(00D0B7C15D91)
       Boot0004* Linux


HTH
Back to top
View user's profile Send private message
WvR
Apprentice
Apprentice


Joined: 03 Mar 2011
Posts: 183
Location: Tsuruga, Japan

PostPosted: Mon Aug 14, 2017 7:24 am    Post subject: Reply with quote

I was able to boot the system with lilo

When I booted, a kernel panic occurred immediately. I don't understand this, I made the kernel with genkernel.

I am now downloading sabayon, perhaps their liveUSB will allow to install a minimal system and then boot it.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2717

PostPosted: Mon Aug 14, 2017 8:07 am    Post subject: Reply with quote

WvR wrote:
I am now downloading sabayon, perhaps their liveUSB will allow to install a minimal system and then boot it.

The recommendation is trying with http://www.system-rescue-cd.org/
Back to top
View user's profile Send private message
WvR
Apprentice
Apprentice


Joined: 03 Mar 2011
Posts: 183
Location: Tsuruga, Japan

PostPosted: Mon Aug 14, 2017 9:51 am    Post subject: Reply with quote

charles17, if you read the thread you will see that I AM using SystemRescueCD.

I am hoping for some minimalist live-USB to provide a bootable system. Once the machine boots I can customize it from there.

BTW: Sabayon MINIMAL does boot, but the installer does not work and there are NO errors or warnings. Sigh....... maybe the seller was right when he said "Ooo, linux, I don't know whether or not that will work with this motherboard." :(
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2717

PostPosted: Mon Aug 14, 2017 10:55 am    Post subject: Reply with quote

WvR wrote:
charles17, if you read the thread you will see that I AM using SystemRescueCD.

Sorry for confusion.

WvR wrote:
By the way: if I set the motherboard to "Boot: UEFI" then the machine does not work at all, and I can only enter the BIOS setup utility.

If I set it to "Boot: LEGACY+UEFI" I get the "Reboot..." message.

In the list of boot devices (F11), the SATA hard disk is mentioned, but not as "UEFI Hard Disk", just as "Hard Disk". All this indicates that my machine is booting in "legacy" mode and not in UEFI mode? Is there any special setting on the hard disk to make it "UEFI bootable"?

Can someone clarify this for me, I don't understand.

Sounds like the computer's EFI implementation is broken somehow. Are you having another UEFI bootable computer to compare?
In "Boot: LEGACY+UEFI" mode with sysresccd USB inserted, the F11 boot options should offer the USB twice. Once for UEFI and once for legacy. That's how it works on Dell Latitude E6430.
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 634

PostPosted: Mon Aug 14, 2017 12:08 pm    Post subject: Reply with quote

Boot the CD in EFI mode, not legacy, I vaguely remember it can make a difference.
Back to top
View user's profile Send private message
WvR
Apprentice
Apprentice


Joined: 03 Mar 2011
Posts: 183
Location: Tsuruga, Japan

PostPosted: Mon Aug 14, 2017 12:15 pm    Post subject: Reply with quote

With SystemRescue USB connected to USB-3 port, I get in the boot menu:

Code:
 
UEFI: USB Disk 1.00, Partition 1
USB Disk 1.00
SATA1:ADATA SU800
Enter Setup


I guess that UEFI works (I guess it should....) but for some reason, the hard disk is not recognized as a UEFI device.

Sabayon is also a piece of shit. You spend hours downloading the stupid LiveCD (2.2 GB!!!!) and it boots up nicely, but the installer does not seem to work?

OK, I will try to follow the Gentoo Installation Handbook for one last time. If that doesn't work and Sabayon does not work then what to do? Just the thought of Fedora or Ubuntu sends chills down my spine.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Mon Aug 14, 2017 12:17 pm    Post subject: Reply with quote

Perhaps Secure Boot has not been disabled?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
hceline
n00b
n00b


Joined: 30 Aug 2015
Posts: 36

PostPosted: Mon Aug 14, 2017 12:27 pm    Post subject: Reply with quote

A few pointers:

Where are your partitions mounted? The grubx64.efi should be on the fat partition, inside a directory called EFI/grub.

Does "efibootmgr -v" show the right path to grub?

Have you tried booting SystemRescueCD with "Boot: UEFI" and secureboot off? (If this works Gentoo should be able to work to)
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2717

PostPosted: Mon Aug 14, 2017 12:57 pm    Post subject: Reply with quote

WvR wrote:
With SystemRescue USB connected to USB-3 port, I get in the boot menu:

Code:
 
UEFI: USB Disk 1.00, Partition 1
USB Disk 1.00
SATA1:ADATA SU800
Enter Setup


I guess that UEFI works (I guess it should....) but for some reason, the hard disk is not recognized as a UEFI device.

If so, can you (from sysresccd) access /sys/firmware/efi/efivars? See https://wiki.gentoo.org/wiki/Efibootmgr#EFI_vars.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Mon Aug 14, 2017 1:07 pm    Post subject: Reply with quote

sysresccd includes a shim that satisfies secure boot and thus is not a test for secure boot being disabled. Have you disabled Secure Boot in the UEFI? (your manual calls it BIOS)
_________________
Defund the FCC.


Last edited by DONAHUE on Mon Aug 14, 2017 1:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
WvR
Apprentice
Apprentice


Joined: 03 Mar 2011
Posts: 183
Location: Tsuruga, Japan

PostPosted: Mon Aug 14, 2017 1:10 pm    Post subject: Reply with quote

secure boot

I was not able to find any settings for "secure boot" or similar in the BIOS setup so I guess the BIOS does not have such a feature

SystemRescue CD with "Boot: UEFI"

Yes, the USB key works if I select "UEFI" instead of "Legacy + UEFI" so the UEFI system seems to work

Location of grubx64.efi

I am somewhat confused; it appears that grub2 created a directory
Code:
/boot/EFI
(uppercase) but the
Code:
efibootmgr
discusses
Code:
/boot/efi
(lower case) and I am not sure which is right. The file system is vfat.

/sys/firmware/efi

Yes, is available under SystemRescueCD.

partitions mounting points
/dev/sda4 / ext4
/dev/sda2 /boot vfat
/dev/sda3 none swap
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Mon Aug 14, 2017 1:27 pm    Post subject: Reply with quote

See if this makes sense in your "BIOS" :

- enter "bios", select "Advanced Mode", "Settings", "Windows OS Configuration"
- change "Windows 8.1/ 10 WHQL Support" to "Disabled"
_________________
Defund the FCC.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Mon Aug 14, 2017 1:37 pm    Post subject: Reply with quote

with sysresccd booted in uefi mode, mount /mnt/gentoo and /mnt/gentoo/boot and then run ls -alR /mnt/gentoo/boot | wgetpaste -t
post the url returned here
_________________
Defund the FCC.
Back to top
View user's profile Send private message
WvR
Apprentice
Apprentice


Joined: 03 Mar 2011
Posts: 183
Location: Tsuruga, Japan

PostPosted: Mon Aug 14, 2017 1:39 pm    Post subject: Reply with quote

I just used GRUB2 to set up the EFI boot system:

Code:
(chroot) sysrescd / # efibootmgr -v
BootCurrent: 0003
Timeout: 1 seconds
BootOrder: 0000,0003,0001,0002
Boot0000* gentoo     HD(2,GPT,....)/File(\EFI\gentoo\grubx64.efi)
Boot0001  Hard Drive BBS(HD,,0x0)/VenHw(.....)
Boot0002  USB KEY    BBS(HD,,0x0)/venHw(.....)
Boot0003* UEFI: USB Desik 1.00, Partition 1 (...)


The first entry looks OK to me, but the machine does not boot in UEFI mode, and instead it goes straight to the BIOS setup screen :(
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2717

PostPosted: Mon Aug 14, 2017 1:43 pm    Post subject: Reply with quote

WvR wrote:
I am somewhat confused; it appears that grub2 created a directory
Code:
/boot/EFI
(uppercase) but the
Code:
efibootmgr
discusses
Code:
/boot/efi
(lower case) and I am not sure which is right. The file system is vfat.

There should be something like /boot/EFI/grub/grubx64.efi , see EFI System Partition.
And for grubx64.efi, did you create a boot entry?
Back to top
View user's profile Send private message
WvR
Apprentice
Apprentice


Joined: 03 Mar 2011
Posts: 183
Location: Tsuruga, Japan

PostPosted: Mon Aug 14, 2017 1:48 pm    Post subject: Reply with quote

DONAHUE wrote:
See if this makes sense in your "BIOS" :

- enter "bios", select "Advanced Mode", "Settings", "Windows OS Configuration"
- change "Windows 8.1/ 10 WHQL Support" to "Disabled"


BIOS -> Advanced -> Windows OS configuration -> Windows 8.1/10 WHQL Support -> disabled (was already set to disabled, no change needed)

DONAHUE wrote:
with sysresccd booted in uefi mode, mount /mnt/gentoo and /mnt/gentoo/boot and then run ls -alR /mnt/gentoo/boot | wgetpaste -t
post the url returned here


https://paste.pound-python.org/show/nh2icRiB4q5e9OIIi3r7
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Mon Aug 14, 2017 11:48 pm    Post subject: Reply with quote

Secure Boot is not the problem.
ls -alR shows a file structure that should be workable.
The UEFI boot list does not contain an entry named gentoo; it should show a gentoo entry if grub-install worked properly. Suspect grubx64.efi is pointing at /boot instead of /boot/EFI.
Suggest rerunning grub-install from the chroot as grub-install --target=x86_64-efi --efi-directory=/boot/EFI and rerunning grub-mkconfig -o /boot/grub/grub.cfg
Were the earlier efibootmgr -v and grub-install run from the chroot?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
WvR
Apprentice
Apprentice


Joined: 03 Mar 2011
Posts: 183
Location: Tsuruga, Japan

PostPosted: Tue Aug 15, 2017 3:14 am    Post subject: Reply with quote

I've given up on Gentoo for now. I tried Sabayon: installation OK, no warnings, but the machine does not boot; I tried Funtoo, installation went OK, no warnings, machine does not boot.

UPDATE: it is too early to cry victory, but I managed to boot the machine in pure UEFI with Funtoo..... I will report later and post the solution once I understand how I solved the problem.
Back to top
View user's profile Send private message
WvR
Apprentice
Apprentice


Joined: 03 Mar 2011
Posts: 183
Location: Tsuruga, Japan

PostPosted: Wed Aug 16, 2017 1:06 am    Post subject: [SOLVED] UEFI, GRUB2, GPT, no boot Reply with quote

I finally found a (the ?) solution in the Gentoo GRUB2 wiki ( https://wiki.gentoo.org/wiki/GRUB2 ):

Quote:
If the system's UEFI firmware fails to find GRUB2's EFI bootloader file, using the default boot loader location should provide a working solution. This circumvents the boot menu managed by efibootmgr and thus offers reduced functionality, but is less error prone. To do this, verify the EFI partition is mounted at /boot/efi then copy the file grubx64.efi located at /boot/efi/EFI/gentoo/grubx64.efi to /boot/efi/EFI/BOOT/BOOTX64.EFI. This example assumes a 64-bit UEFI system, adjust accordingly for 32-bit UEFI systems.


For me, the location is /boot/EFI/BOOT/BOOTX64.EFI .

The confusion stems from the fact that the Gentoo Installation Handbook uses /boot as the top of the EFI directory, whereas most other sources use /boot/efi.

Anyway - my machine boots. It is not Gentoo but I guess Funtoo is close enough. Network, sound, video, USB work OK with Funtoo "out of the box".[/quote][/url]
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2717

PostPosted: Wed Aug 16, 2017 5:21 am    Post subject: Re: [SOLVED] UEFI, GRUB2, GPT, no boot Reply with quote

WvR wrote:
The confusion stems from the fact that the Gentoo Installation Handbook uses /boot as the top of the EFI directory, whereas most other sources use /boot/efi.
Indeed, such alternatives instead of the regular mount point causes confusion and long discussions.
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
Goto page 1, 2  Next
Page 1 of 2

 
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