Article 4WXHW No Grub to launch my new Debian 10 with LUKS&LVM (UEFI)

No Grub to launch my new Debian 10 with LUKS&LVM (UEFI)

by
l0f4r0
from LinuxQuestions.org on (#4WXHW)
Hi,

I have a recent Lenovo ThinkPad X390 with Windows pre-installed.

Some months ago, I installed Debian 9 Stretch on it and upgraded it some time after to Debian 10 Buster. No particular issue so far, Debian was working as expected in dual-boot with Windows.
But following a power hardware issue, I sent my laptop back to Lenovo for reparation.
They gave it back to me last week but with a cleared SSD (only pre-installed Windows 10 on it).

It was no big deal since I wanted to reinstall my Debian (directly to version 10, not 9) and, above all, I wanted now to encrypt my whole disk with LUKS and LVM (LVM is contained inside the LUKS container, not the contrary, so there is only 1 password).

So I made a bootable Debian 10 USB key and installed a new fresh Debian again in dual-boot.
First I created a new partition on my SSD to leave Windows alone and then I did my best to configure LUKS and LVM via the Debian installer (4 logical volumes for /, /home, /var and swap). I created a 300MB /boot partition outside LUKS to be more compatible with Grub.

Everything went well except I can't boot easily on my fresh-new Debian, I don't even see Grub. Windows is launched automatically.
My only solution is to launch a rEFInd USB key, boot on it and select either "Boot EFI\Boot\grubx64.efi from SYSTEM" or "Boot EFI\debian\grubx64.efi from SYSTEM" (among 6 options, see below) in order to launch my Debian. It's not very handy but it seems to indicate I'm not very far from the solution because everything works fine after that (it proves that my Linux is well installed)...

The following didn't resolve anything even if command outputs were encouraging (those commands have been entered after booting on Debian via rEFInd):

Code:apt install --reinstall grub-efi
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 2560 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 grub-efi amd64 2.02+dfsg1-20 [2560 B]
Fetched 2560 B in 0s (94.6 kB/s)
(Reading database ... 102187 files and directories currently installed.)
Preparing to unpack .../grub-efi_2.02+dfsg1-20_amd64.deb ...
Unpacking grub-efi (2.02+dfsg1-20) over (2.02+dfsg1-20) ...
Setting up grub-efi (2.02+dfsg1-20) ...

grub-install /dev/nvme0n1
Installing for x86_64-efi platform.
Installation finished. No error reported.

update-grub
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.19.0-6-amd64
Found initrd image: /boot/initrd.img-4.19.0-6-amd64
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
doneSome useful details:

Code:uname -a
Linux ikki 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux

lsblk -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE
NAME FSTYPE LABEL MOUNTPOINT SIZE
sda iso9660 rEFInd_0.11.4 29,9G
nvme0n1 477G
a"a"nvme0n1p1 vfat SYSTEM /boot/efi 260M
a"a"nvme0n1p2 16M
a"a"nvme0n1p3 ntfs Windows 122,1G
a"a"nvme0n1p4 ntfs WinRE_DRV 1000M
a"a"nvme0n1p5 ext4 /boot 300M
a""a"nvme0n1p6 crypto_LUKS 353,3G
a""a"nvme0n1p6_crypt LVM2_member 353,3G
a"a"myLvmGroup-myLvmSwap swap [SWAP] 14,9G
a"a"myLvmGroup-myLvmVar ext4 var /var 18,6G
a"a"myLvmGroup-myLvmRoot ext4 racine / 74,5G
a""a"myLvmGroup-myLvmHome ext4 home /home 186,3G

fdisk -l
Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: SAMSUNG MZVLB512HAJQ-000L7
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 534527 532480 260M EFI System
/dev/nvme0n1p2 534528 567295 32768 16M Microsoft reserved
/dev/nvme0n1p3 567296 256567295 256000000 122.1G Microsoft basic data
/dev/nvme0n1p4 998166528 1000214527 2048000 1000M Windows recovery environment
/dev/nvme0n1p5 256567296 257181695 614400 300M Linux filesystem
/dev/nvme0n1p6 257181696 998166527 740984832 353.3G Linux filesystemQuote:
UEFI BIOS version : N2JET83W (1.61)
UEFI BIOS Date : 2019-11-22
Embedded Controller Version : N2JHT32W (1.16)
ME Firmware Version : 12.0.40.1433
UEFI Secure Boot : Off (just to allow my rEFInd bootable USB key to be launched properly. When my issue will be resolved, I will certainly reactivate UEFI Secure Boot since I've been told that Debian 10 now deals with it appropriately)
UEFI Only - No CSM support
Default booting on SSD first
rEFInd choices and results:

Quote:
rEFInd (0.11.4):
  • Boot Microsoft EFI boot from SYSTEM (--> it launches Windows OK)
  • Boot EFI\Boot\grubx64.efi from SYSTEM (--> it launches Grub 2.02 where I can choose "Debian GNU/Linux" and access my Debian eventually)
  • Boot EFI\Boot\LenovoBT.EFI from SYSTEM (--> it gives me a fatal error "ASSERT c:\code\efi\source\edk2\ShellPkg\Application\Shell\ShellParametersProtocol.c(368): !EFI_ERROR (Status)")
  • Boot EFI\debian\grubx64.efi from SYSTEM (--> it launches Grub 2.02 where I can choose "Debian GNU/Linux" and access my Debian eventually)
  • Boot failback boot loader from SYSTEM (--> it reboots my laptop and launches Windows)
  • Boot vmlinuz-4.19.0-6-amd64 from boot (--> I get an ash shell BusyBox v1.30.1 with a "(initramfs)" prompt and I don't know what I'm supposed to do...)
I have the feeling I have too many .efi files, don't I have?
Could someone give me some hints in order to have Grub displaying itself after powering on my laptop so I can easily choose to launch Debian or Windows?
Please be explicit as I'm not really used to booting processes, especially in UEFI/GPT mode... ;)

Many thanks in advance! :)latest?d=yIl2AUoC8zA latest?i=f5AdLXb1GhE:xX_IEKvbP5E:F7zBnMy latest?i=f5AdLXb1GhE:xX_IEKvbP5E:V_sGLiP latest?d=qj6IDK7rITs latest?i=f5AdLXb1GhE:xX_IEKvbP5E:gIN9vFwf5AdLXb1GhE
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments