LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-28-2022, 05:26 PM   #1
cristi92b
Member
 
Registered: May 2011
Posts: 94

Rep: Reputation: Disabled
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?

Last edited by cristi92b; 05-28-2022 at 06:02 PM.
 
Old 05-28-2022, 06:38 PM   #2
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,354

Rep: Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590
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

Last edited by colorpurple21859; 05-28-2022 at 06:40 PM.
 
Old 05-28-2022, 06:46 PM   #3
cristi92b
Member
 
Registered: May 2011
Posts: 94

Original Poster
Rep: Reputation: Disabled
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?

Last edited by cristi92b; 05-28-2022 at 07:10 PM.
 
Old 05-28-2022, 09:20 PM   #4
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,817
Blog Entries: 1

Rep: Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068
man efibootmgr
efibootmgr -b 2 -B
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is efi - operating system? is efi shell - operarting system? xcom2021 Linux - Newbie 1 10-06-2021 06:36 AM
EFI System Partition: Using it as /boot versus /boot/efi MirceaKitsune Linux - General 4 04-06-2021 11:07 AM
[SOLVED] Ooooy. EFI boot mmx64.efi.efi not found bulgin Linux - Newbie 12 12-20-2018 11:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration