LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Debian installation on EFI system (https://www.linuxquestions.org/questions/linux-newbie-8/debian-installation-on-efi-system-4175712740/)

cristi92b 05-28-2022 05:26 PM

Debian installation on EFI system
 
Hello,

I installed Debian 11.3 on an HP 250 G6 notebook (erase disk -> default partition table) using the graphical installer (not Calamares) from a bootable debian "netinst" USB drive created using dd, but the installer failed to install GRUB.

Code:

root@debian-hp:~# fdisk -l
Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: WDC WD5000LPCX-6
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 1AF41D5B-2B0F-409E-A9B5-136B84A26955

Device        Start      End  Sectors  Size Type
/dev/sda1      2048  1050623  1048576  512M EFI System
/dev/sda2    1050624 974772223 973721600 464.3G Linux filesystem
/dev/sda3  974772224 976771071  1998848  976M Linux swap

The installer was complaining about EFI variables so I "chrooted" into the installed system using "recovery mode" and I installed efivars:

Code:

# apt install efivar
Then I reinstalled GRUB and it worked without errors. However, now I can only boot the system using the "Boot from EFI file" option in BIOS because of the EFI boot order:

Code:

root@debian-hp:~# efibootmgr
Timeout: 0 seconds
BootOrder: 0002,0003,2001,2002,0001,2004
Boot0001* Notebook Hard Drive - WDC WD5000LPCX-60VHAT0
Boot0002* ubuntu
Boot0003* debian
Boot2001* EFI USB Device
Boot2002* EFI DVD/CDROM

I tried to change the order using the following command but nothing changes:
Code:

root@debian-hp:~# efibootmgr -o 0003,0002,2001,2002,0001,2004
Invalid BootOrder order entry value0003,0002,2001,2002,0001,2004
                                                              ^
efibootmgr: entry 2004 does not exist
root@debian-hp:~# efibootmgr -o 0003,0002,2001,2002,0001
Could not set BootOrder: Interrupted system call
root@debian-hp:~# efibootmgr -o 0003,2001,2002,0001
Skipping unreadable variable "Boot0001": Interrupted system call
Skipping unreadable variable "Boot0002": Interrupted system call
Skipping unreadable variable "Boot0003": Interrupted system call
Skipping unreadable variable "Boot2001": Interrupted system call
Skipping unreadable variable "Boot2002": Interrupted system call
Invalid BootOrder order entry value0003
                                    ^
efibootmgr: entry 0003 does not exist

Could you please help me change the EFI priority or remove "ubuntu" option from the list so that my notebook will automatically load Debian GRUB bootloader on startup?

colorpurple21859 05-28-2022 06:38 PM

Boot into the system with the "boot from file" option, make sure sda1 is mounted to /boot/efi
Run as root
Code:

grub-install
update-grub

If this doesn't work you may have to change the boot order in the firmware/bios settings

cristi92b 05-28-2022 06:46 PM

The /dev/sda1 partition is already mounted to /boot/efi :

Code:

root@debian-hp:~# cat /etc/mtab
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,nosuid,relatime,size=1895660k,nr_inodes=473915,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,nodev,noexec,relatime,size=386216k,mode=755 0 0
/dev/sda2 / ext4 rw,relatime,errors=remount-ro 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
efivarfs /sys/firmware/efi/efivars efivarfs rw,nosuid,nodev,noexec,relatime 0 0
none /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13188 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime,pagesize=2M 0 0
mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
tracefs /sys/kernel/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0
/dev/sda1 /boot/efi vfat rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=386212k,nr_inodes=96553,mode=700,uid=1000,gid=1000 0 0
gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0

When I try to install GRUB:
Code:

root@debian-hp:~# grub-install
Installing for x86_64-efi platform.
grub-install: warning: Cannot set EFI variable BootOrder.
grub-install: warning: efivarfs_set_variable: writing to fd 7 failed: Interrupted system call.
grub-install: warning: _efi_set_variable_mode: ops->set_variable() failed: Interrupted system call.
grub-install: error: failed to register the EFI boot entry: Interrupted system call.

I changed the UEFI boot order in BIOS and now it works, thank you very much!

Code:

root@debian-hp:~# efibootmgr
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0003,3003,0002,2001,2002,0001,2004
Boot0001* Notebook Hard Drive - WDC WD5000LPCX-60VHAT0
Boot0002* ubuntu
Boot0003* debian
Boot2001* EFI USB Device
Boot2002* EFI DVD/CDROM
Boot3003* Internal Hard Disk or Solid State Disk

Do you know how I can remove the "ubuntu" entry from the list?

mrmazda 05-28-2022 09:20 PM

man efibootmgr
efibootmgr -b 2 -B


All times are GMT -5. The time now is 07:02 AM.