View previous topic :: View next topic |
Author |
Message |
AndrewAmmerlaan Developer
Joined: 25 Jun 2014 Posts: 254 Location: Nijmegen
|
Posted: Fri Jul 27, 2018 2:28 pm Post subject: [SOLVED] Booting from m2 ssd in uefi mode |
|
|
My laptop recently broke, and now I'm trying to re-install gentoo on my new pc. However I ran into a little problem, I'm trying to boot from a samsung 970 pro ssd which is connected to a MSI z370-a pro motherboard.
I installed grub2 using:
Code: |
grub-install --target=x86_64-efi --efi-directory=/boot
grub-mkconfig -o /boot/grub/grub.cfg
|
and it completed without error. However upon reboot it refuses to load grub, it says I don't have any bootable media (that is if I remove the install CD).
I've got the first partion as an efi system partiton:
Code: |
/dev/nvme0n1p1 2048 204799 202752 99M EFI System
|
I have set up this partition in fstab to be mounted at /boot and it contains the following files:
Code: |
(chroot) livecd /boot # ls
config-4.17.10-gentoo System.map-4.17.10-gentoo
EFI vmlinuz-4.17.10-gentoo
grub
|
Code: |
(chroot) livecd /boot # ls EFI
gentoo
(chroot) livecd /boot # ls EFI/gentoo
grubx64.efi
|
When I look in the bios, I see an option to boot ssd/hdd in non-uefi and uefi mode. But only the non-uefi option contains the name of the ssd in brackets behind it. (at the moment this is the only hdd/sdd connected to the system)
Also, on my old laptop I had the eif partion mounted at /boot/efi, but the wiki page shows the efi partion on /boot so I just did it that way, could this be the problem here?
Is it not possible to boot a m2 ssd in uefi mode, or did I mess up again? _________________ OS: Gentoo 6.7.3-gentoo-dist, ~amd64, 17.1/desktop/plasma/systemd/merged-usr
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400
Last edited by AndrewAmmerlaan on Tue Jul 31, 2018 6:55 am; edited 1 time in total |
|
Back to top |
|
|
axl Veteran
Joined: 11 Oct 2002 Posts: 1136 Location: Romania
|
Posted: Fri Jul 27, 2018 2:30 pm Post subject: |
|
|
Efi partition and boot partition are 2 distinct things. therefor you should mount /dev/nvme0n1p2 on /boot and /dev/nvme0n1p1 on /boot/efi. and redo everything else. |
|
Back to top |
|
|
AndrewAmmerlaan Developer
Joined: 25 Jun 2014 Posts: 254 Location: Nijmegen
|
Posted: Fri Jul 27, 2018 3:07 pm Post subject: |
|
|
I know their not the same thing, usually I don't even use a boot partition. I did it this way cause it was on the wiki.
Anyway, I remounted the partition to /boot/efi, moved the kernel files and the grub directory on folder up. Reinstalled and reconfigured grub. Now it looks like this:
Code: |
(chroot) livecd / # mount /dev/nvme0n1p1 /boot/efi
(chroot) livecd / # ls /boot
config-4.17.10-gentoo System.map-4.17.10-gentoo efi vmlinuz-4.17.10-gentoo grub
(chroot) livecd / # ls /boot/efi
EFI
(chroot) livecd / # ls /boot/efi/EFI
gentoo
(chroot) livecd / # ls /boot/efi/EFI/gentoo
grubx64.efi
(chroot) livecd / #
|
But it still won't start grub, I suspect the problem is in the bios where the name of the ssd does not show up in the UEFI: HDD/SSD boot option (as if it weren't connected). Whereas legacy HDD/SDD option shows the vendor/size etc of the sdd.
Also, here's my full partition layout:
Code: |
(parted) print
Model: Unknown (unknown)
Disk /dev/nvme0n1: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 105MB 104MB fat32 EFI System Partition boot, esp
2 105MB 495GB 495GB ext4 Gentoo
3 495GB 512GB 16.8GB linux-swap(v1) Swap
|
_________________ OS: Gentoo 6.7.3-gentoo-dist, ~amd64, 17.1/desktop/plasma/systemd/merged-usr
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400
Last edited by AndrewAmmerlaan on Fri Jul 27, 2018 3:10 pm; edited 1 time in total |
|
Back to top |
|
|
axl Veteran
Joined: 11 Oct 2002 Posts: 1136 Location: Romania
|
Posted: Fri Jul 27, 2018 3:09 pm Post subject: |
|
|
grub-install --target=x86_64-efi --efi-directory=/boot/efi
what output did you get from this?
how about from this
grub-mkconfig -o /boot/grub/grub.conf ? |
|
Back to top |
|
|
AndrewAmmerlaan Developer
Joined: 25 Jun 2014 Posts: 254 Location: Nijmegen
|
Posted: Fri Jul 27, 2018 3:12 pm Post subject: |
|
|
I did that, that's what I meant when I said that I reinstalled and reconfigured grub.
Code: | (chroot) livecd / # grub-install --target=x86_64-efi --efi-directory=/boot/efi
Installing for x86_64-efi platform.
Installation finished. No error reported.
(chroot) livecd / # grub-mkconfig -o /boot/grub/grub.conf
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.17.10-gentoo
done
|
_________________ OS: Gentoo 6.7.3-gentoo-dist, ~amd64, 17.1/desktop/plasma/systemd/merged-usr
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400 |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
axl Veteran
Joined: 11 Oct 2002 Posts: 1136 Location: Romania
|
Posted: Fri Jul 27, 2018 3:14 pm Post subject: |
|
|
AndrewAmmerlaan wrote: | I did that, that's what I meant when I said that I reinstalled and reconfigured grub.
Code: | (chroot) livecd / # grub-install --target=x86_64-efi --efi-directory=/boot/efi
Installing for x86_64-efi platform.
Installation finished. No error reported.
(chroot) livecd / # grub-mkconfig -o /boot/grub/grub.conf
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.17.10-gentoo
done
|
|
is partition nvme0n1p1 type ef00?
EDIT: looks to me you used parted to create the partition. while it is a fat filesystem it should be marked in the gpt partition table as efi which is type ef00. I don't think parted can do that. you should use gdisk. just gdisk /dev/nvme0n1, press t once, partition 1, type ef00, w for write and it's done. gdisk is in package gptfdisk. I am 99% sure this is it.
Last edited by axl on Fri Jul 27, 2018 3:28 pm; edited 1 time in total |
|
Back to top |
|
|
axl Veteran
Joined: 11 Oct 2002 Posts: 1136 Location: Romania
|
Posted: Fri Jul 27, 2018 3:18 pm Post subject: |
|
|
IF everything is set perfectly grub-install /dev/nvme0n1 should work without extra parameters. if it doesn't, maybe it will show us some extra error that we might be missing. so i suggest you try that as well. |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Fri Jul 27, 2018 3:46 pm Post subject: |
|
|
what install media are you using?
please run Code: | emerge wgetpaste
wgetpaste -t /boot/grub/grub.cfg
efibootmgr -v | wgetpaste -t
mount | wgetpaste -t | from the chroot and post the urls returned _________________ Defund the FCC. |
|
Back to top |
|
|
AndrewAmmerlaan Developer
Joined: 25 Jun 2014 Posts: 254 Location: Nijmegen
|
Posted: Fri Jul 27, 2018 4:08 pm Post subject: |
|
|
axl wrote: | IF everything is set perfectly grub-install /dev/nvme0n1 should work without extra parameters. if it doesn't, maybe it will show us some extra error that we might be missing. so i suggest you try that as well. |
This gives me the exact same output as with the parameters.
DONAHUE wrote: | what install media are you using?
please run Code: | emerge wgetpaste
wgetpaste -t /boot/grub/grub.cfg
efibootmgr -v | wgetpaste -t
mount | wgetpaste -t | from the chroot and post the urls returned |
I'm using the live-dvd, because I read somewhere the minimal cd does not support UEFI
grub.cfg: https://paste.pound-python.org/show/fnBmiCN7JjBDmilVCKdm/
efibootmgr: https://paste.pound-python.org/show/OvprDIr1356CVMngQroy/
mount: https://paste.pound-python.org/show/NVHCaiE3JoPn2HDl8j4N/
axl wrote: | AndrewAmmerlaan wrote: | I did that, that's what I meant when I said that I reinstalled and reconfigured grub.
Code: | (chroot) livecd / # grub-install --target=x86_64-efi --efi-directory=/boot/efi
Installing for x86_64-efi platform.
Installation finished. No error reported.
(chroot) livecd / # grub-mkconfig -o /boot/grub/grub.conf
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.17.10-gentoo
done
|
|
is partition nvme0n1p1 type ef00?
EDIT: looks to me you used parted to create the partition. while it is a fat filesystem it should be marked in the gpt partition table as efi which is type ef00. I don't think parted can do that. you should use gdisk. just gdisk /dev/nvme0n1, press t once, partition 1, type ef00, w for write and it's done. gdisk is in package gptfdisk. I am 99% sure this is it. |
Now that you mention it, the wiki doesn't use parted either. I thought it wouldn't matter and that all I had to was set the boot,esp flags on it. I'll try again, following the wiki page to the letter, and see what happens.
I'm actually going away for the weekend, I'll be back late on Monday. So I can't actually try this until then, but it will be the first thing I do when I get back.
Thank you for all your replies _________________ OS: Gentoo 6.7.3-gentoo-dist, ~amd64, 17.1/desktop/plasma/systemd/merged-usr
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400 |
|
Back to top |
|
|
P.Kosunen Guru
Joined: 21 Nov 2005 Posts: 309 Location: Finland
|
Posted: Sat Jul 28, 2018 1:07 pm Post subject: |
|
|
Edit: What boot media you used, are you sure boot was in UEFI mode? |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
|
Back to top |
|
|
AndrewAmmerlaan Developer
Joined: 25 Jun 2014 Posts: 254 Location: Nijmegen
|
Posted: Sat Jul 28, 2018 1:31 pm Post subject: |
|
|
P.Kosunen wrote: | Edit: What boot media you used, are you sure boot was in UEFI mode? |
Pretty sure, otherwise grub-install wouldn't have said "Installing for x86_64-efi platform" when I installed it without the target parameter, right? _________________ OS: Gentoo 6.7.3-gentoo-dist, ~amd64, 17.1/desktop/plasma/systemd/merged-usr
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400 |
|
Back to top |
|
|
axl Veteran
Joined: 11 Oct 2002 Posts: 1136 Location: Romania
|
Posted: Sat Jul 28, 2018 1:33 pm Post subject: |
|
|
AndrewAmmerlaan wrote: | P.Kosunen wrote: | Edit: What boot media you used, are you sure boot was in UEFI mode? |
Pretty sure, otherwise grub-install wouldn't have said "Installing for x86_64-efi platform" when I installed it without the target parameter, right? |
yes. you are right. |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Sat Jul 28, 2018 2:03 pm Post subject: |
|
|
Our grub.cfg's are identical except for UUID's, file systems, device names. I use reiserfs and have ESP on nvme0n1p2 and / on nvme1n1p1 explaining any differences. I conclude that grub-mkconfig functioned properly.
The UEFI boot options menu you reported and the efibootmgr output both show that grub-install failed to write a UEFI boot entry for gentoo/grub to the UEFI flash memory on the motherboard. My understanding is that grub invokes efibootmgr to write the boot entry. My entry looks like Code: | Boot0001* gentoo HD(2,GPT,cad2219f-3047-4b03-a174-19475754a5cb,0xe1800,0x32000)/File(\EFI\GENTOO\GRUBX64.EFI) | Suggest entering the chroot, mounting /boot/efi, running efibootmgr to create the gentoo/grub boot entry. My guess for the command: Code: | efibootmgr -c -d /dev/dev/nvme0n1 -p 1 -L "gentoo" -l "\efi\boot\grubx64.efi" | efibootmgr -v to check. UEFI boot options to really check.
N.B. , while running efibootmgr to test my guess, I was surprised to receive a "Could not prepare Boot variable: Read-only file system". I'm pretty sure running mount a few minutes earlier showed efivarsfs as rw, but ... Running Code: | mount -o remount,rw /sys/firmware/efi/efivars
efibootmgr -c -d /dev/dev/nvme0n1 -p 1 -L "gentoo" -l "\efi\boot\grubx64.efi" | fixed my problem but I was not in a chroot. (Actually used -p 2 to suit my system)
BTW my nvme's are Samsung 960. _________________ Defund the FCC. |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
arnvidr l33t
Joined: 19 Aug 2004 Posts: 629 Location: Oslo, Norway
|
Posted: Sat Jul 28, 2018 7:33 pm Post subject: |
|
|
It seems like you have an extra level of efi folder from me, and I also used the wiki a while back. Maybe try the grub-install with efi-dir as /boot/efi/EFI _________________
|
|
Back to top |
|
|
P.Kosunen Guru
Joined: 21 Nov 2005 Posts: 309 Location: Finland
|
Posted: Sun Jul 29, 2018 10:24 am Post subject: |
|
|
Grub install has not done boot entry for Gentoo for some reason.
You could try to boot and chroot with SystemRescueCD, UEFI Grub install has always worked for me with it.
arnvidr wrote: | It seems like you have an extra level of efi folder from me, and I also used the wiki a while back. Maybe try the grub-install with efi-dir as /boot/efi/EFI |
Grub-install creates that uppercase EFI dir in EFI boot partition if it does not exist, you should not put it in grub-install options. |
|
Back to top |
|
|
jmartos Tux's lil' helper
Joined: 23 Mar 2008 Posts: 76
|
Posted: Sun Jul 29, 2018 10:59 am Post subject: |
|
|
I recently went through the same issue when I changed motherboards to a new SuperMicro X10DRL-i MB. I had to add the "--removable" option to the grub-install command. This is mentioned in the grub2 handbook as being needed for some motherboards.
Code: |
grub-install --target=x86_64-efi --efi-directory=/boot --removable
|
|
|
Back to top |
|
|
CooSee Veteran
Joined: 20 Nov 2004 Posts: 1396 Location: Earth
|
Posted: Sun Jul 29, 2018 12:16 pm Post subject: |
|
|
only this works for me :
Code: | /dev/nvme0n1p1 510984 964 510020 1% /boot/efi |
EFI vfat is mounted on /boot/efi
and i had to rename it to BOOTX64.EFI :
Code: | /boot/efi/EFI/BOOT/BOOTX64.EFI |
i hope this helps _________________ " Die Realität ist eine Illusion, die durch Mangel an ehrlicher Kommunikation entsteht "
---
" Der Mensch ist von Natur aus neugierig, was am Ende übrig bleibt ist die Gier " |
|
Back to top |
|
|
AndrewAmmerlaan Developer
Joined: 25 Jun 2014 Posts: 254 Location: Nijmegen
|
Posted: Sun Jul 29, 2018 8:47 pm Post subject: |
|
|
The plot thickens,
grub-install is working fine, I have confirmed that it creates a gentoo option in efibootmgr:
Code: |
livecd / # efibootmgr -v
BootCurrent: 0003
Timeout: 1 seconds
BootOrder: 0000,0003,0001,0002
Boot0000* gentoo HD(1,GPT,5928dcce-9b45-44a4-b444-363cdc4c297e,0x800,0x31800)/File(\EFI\gentoo\grubx64.efi)
Boot0001 Hard Drive BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........S.a.m.s.u.n.g. .S.S.D. .9.7.0. .P.R.O. .5.1.2.G.B...................\.,.@.r.d.=.X..........A...........................%8V.........4..Gd-.;.A..MQ..L.S.4.6.3.N.F.0.K.6.2.0.3.6.4.B........BO
Boot0002 CD/DVD Drive BBS(CDROM,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0300)..GO..NO..........H.L.-.D.T.-.S.T. .B.D.D.V.D.R.W. .C.H.1.2.N.S.4.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L.9.K.I.L.V.3.2.I.4.8. .6. . . . . . . . ........BO
Boot0003* UEFI: HL-DT-ST BDDVDRW CH12NS40 PciRoot(0x0)/Pci(0x17,0x0)/Sata(0,65535,0)/CDROM(1,0x7bc6,0x8800)..BO |
However, upon reboot.... it's gone
Code: |
livecd / # efibootmgr -v
BootCurrent: 0003
Timeout: 1 seconds
BootOrder: 0003,0001,0002
Boot0001 Hard Drive BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........S.a.m.s.u.n.g. .S.S.D. .9.7.0. .P.R.O. .5.1.2.G.B...................\.,.@.r.d.=.X..........A...........................%8V.........4..Gd-.;.A..MQ..L.S.4.6.3.N.F.0.K.6.2.0.3.6.4.B........BO
Boot0002 CD/DVD Drive BBS(CDROM,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0300)..GO..NO..........H.L.-.D.T.-.S.T. .B.D.D.V.D.R.W. .C.H.1.2.N.S.4.0...................\.,.@.r.d.=.X..........A...........................>..Gd-.;.A..MQ..L.9.K.I.L.V.3.2.I.4.8. .6. . . . . . . . ........BO
Boot0003* UEFI: HL-DT-ST BDDVDRW CH12NS40 PciRoot(0x0)/Pci(0x17,0x0)/Sata(0,65535,0)/CDROM(1,0x7bc6,0x8800)..BO
|
I have also tried to add this entry manually, same thing happens.
It also doesn't seem to matter if the partition was created by parted or gdisk. (A parted partition is still marked as EF00 in gdisk)
The problem seems to be that edits that I make with efibootmgr don't stick. Maybe some "security feature" in the motherboard?
(I have checked that efivarfs is read/write)
Tomorrow I'm gonna try adding the --removable parameter and renaming the grubx64.efi file as suggested above. _________________ OS: Gentoo 6.7.3-gentoo-dist, ~amd64, 17.1/desktop/plasma/systemd/merged-usr
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400 |
|
Back to top |
|
|
axl Veteran
Joined: 11 Oct 2002 Posts: 1136 Location: Romania
|
Posted: Sun Jul 29, 2018 8:48 pm Post subject: |
|
|
But did you modify type for efi partition to ef00 using gptdisk ?
I've been waiting for an answer on that. |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Mon Jul 30, 2018 12:11 am Post subject: |
|
|
manufacturer and model of the motherboard? _________________ Defund the FCC. |
|
Back to top |
|
|
AndrewAmmerlaan Developer
Joined: 25 Jun 2014 Posts: 254 Location: Nijmegen
|
Posted: Mon Jul 30, 2018 6:07 am Post subject: |
|
|
Code: | grub-install --removable --efi-directory=/boot |
That worked the removable option actually installs grub in /boot/EFI/BOOT/BOOTX64.EFI instead of in /boot/EFI/gentoo/GRUBX64.EFI and it does not create an additional entry in efibootmgr.
Quote: | But did you modify type for efi partition to ef00 using gptdisk ? |
No I did not, I just checked that the partition had EF00 in gdisk
Quote: | manufacturer and model of the motherboard? |
MSI Z730-A Pro
Of course I forgot to install nvidea-drivers so I had to go back to the live-dvd anyway
Thank you all
I'll see about adding a note on the --removable option on the wiki when I'm done installing all the things. _________________ OS: Gentoo 6.7.3-gentoo-dist, ~amd64, 17.1/desktop/plasma/systemd/merged-usr
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400 |
|
Back to top |
|
|
|