Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

cannot boot debian [SOLVED]

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
iccid
Posts: 17
Joined: 2021-09-29 14:30

cannot boot debian [SOLVED]

#1 Post by iccid »

hello users,
I cannot boot debian testing. Here is my partition table:

disk 1
/dev/nvme0n1p1 ntfs Recovery 521MB
/dev/nvme0n1p2 fat32 /boot/efi 100MB
/dev/nvme0n1p3 ntfs Windows 10 232,28GB

disk 2
/dev/nvme1n1p1 fat32 /boot/efi 512MB
/dev/nvme1n1p2 ext4 / Debian 1,82TB

It is a dual system with Windows/Debian and I cannot boot none of them.

First thing I have tried is to modifiy /etc/grub.d/40_custom:
set gfxpayload=1920x1080x24

menuentry'Linux Debian Testing'{
insmod gzio
insmod part_gpt
insmod ext4
set root=(hd1,2)
linux /boot/vmlinuz-5.18.0-3-amd64 quiet splash
initrd /boot/initrd.img-5.18.0-3-amd64
}

menuentry'Windows 10'{
insmod part_msdos
insmod ntfs
set root=(hd0,3)
chainloader +1
}

Then I typed:
# update-grub

I have verified that lines in 40_custom are in /boot/grub/grub.cfg

I have also followed what is described in wiki.debian.org to reinstall grub from a chroot using debian installer in rescue mode.
So far I always get the grub commandline at boot. This is what I have to type to boot debian manually:

> set root=(hd1,2)
> linux /boot/vmlinuz-5.18.0-3-amd64 root=/dev/nvme1n2p2 quiet splash
> initrd /boot/initrd.img-5.18.0-3-amd64
> boot

Any help will be appreciated.
Last edited by iccid on 2022-08-25 14:32, edited 1 time in total.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: cannot boot debian

#2 Post by Head_on_a_Stick »

iccid wrote: 2022-08-18 08:55/dev/nvme0n1p2 fat32 /boot/efi 100MB
[snip]
/dev/nvme1n1p1 fat32 /boot/efi 512MB
Two partitions cannot both be mounted under /boot/efi/.

Please post the output of

Code: Select all

lsblk -f
blkid
efibootmgr -uv
Why don't you just share the Windows EFI system partition with Debian? /dev/nvme1n1p1 is unnecessary.
deadbang

iccid
Posts: 17
Joined: 2021-09-29 14:30

Re: cannot boot debian

#3 Post by iccid »

Thank you for your reply.
lsblk -f

NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
sda
nvme0n1
|-nvme0n1p1 ntfs Recuperacion 3612BBB512BB7907
|-nvme0n1p2 vfat FAT32 FEA9-4C7D 66.1M 31% /boot/efi
`-nvme0n1p3 ntfs 7A64AA0E64A9CD67
nvme1n1
|-nvme1n1p1 vfat FAT32 7EC6-6BDD
`-nvme1n1p2 ext4 1.0 5ee2e893-2c97-4109-b228-55ffce9d2c85 1.7T 2% /

efibootmgr -uv

BootCurrent: 0003
Timeout: 1 seconds
BootOrder: 0003,0001,0007,0008,0006,0002,0004,0005
Boot0000* Windows Boot Manager HD(2,GPT,0e184784-e1c3-4c9e-b114-39ee4cc23371,0x105000,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)䥗䑎坏S
Boot0001* Windows Boot Manager HD(2,GPT,0e184784-e1c3-4c9e-b114-39ee4cc23371,0x105000,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)
Boot0002* UEFI:CD/DVD Drive BBS(129,,0x0)
Boot0003* neon HD(1,GPT,9805748b-d399-486a-914e-384fac52d819,0x800,0x100000)/File(\EFI\NEON\SHIMX64.EFI)
Boot0004* UEFI:Removable Device BBS(130,,0x0)
Boot0005* UEFI:Network Device BBS(131,,0x0)
Boot0006 debian HD(2,GPT,0e184784-e1c3-4c9e-b114-39ee4cc23371,0x105000,0x32000)/File(\EFI\DEBIAN\SHIMX64.EFI)
Boot0007* UEFI OS HD(1,GPT,9805748b-d399-486a-914e-384fac52d819,0x800,0x100000)/File(\EFI\BOOT\BOOTX64.EFI)
Boot0008* debian HD(1,GPT,9805748b-d399-486a-914e-384fac52d819,0x800,0x100000)/File(\EFI\DEBIAN\SHIMX64.EFI)

blkid

/dev/nvme0n1p3: BLOCK_SIZE="512" UUID="7A64AA0E64A9CD67" TYPE="ntfs" PARTUUID="f81a155d-b1e1-4a82-b34d-805b31a312f4"
/dev/nvme0n1p1: LABEL="Recuperacion" BLOCK_SIZE="512" UUID="3612BBB512BB7907" TYPE="ntfs" PARTUUID="473449b6-c6a4-4042-85e8-d10fc97d0422"
/dev/nvme0n1p2: UUID="FEA9-4C7D" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="0e184784-e1c3-4c9e-b114-39ee4cc23371"
/dev/nvme1n1p2: UUID="5ee2e893-2c97-4109-b228-55ffce9d2c85" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="Debian Linux" PARTUUID="22f263d0-95a8-4f94-906c-64e9ee86cffa"
/dev/nvme1n1p1: UUID="7EC6-6BDD" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="9805748b-d399-486a-914e-384fac52d819"

I did not know about the two partitions under /boot/efi, thanks. Please tell me if I can rid out of a partition. I add to the overall picture: I bought my laptop with dual Windows/KDE Neon, now I erased Neon and installed Testing. Could I have two Grub which are interfering each other ? This could explain why my configuration work appears useless...My last attempt was to activate OS Prober, with again no result.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: cannot boot debian

#4 Post by Head_on_a_Stick »

Looks like the Neon boot entry is still there.

Remove it with

Code: Select all

# efibootmgr -b 3 -B
Entries 0001 & 0008 are also superfluous and so can be removed.

Then set Debian as first in the boot order:

Code: Select all

# efibootmgr -o 6,0,7
And reboot.

Note that /dev/nvme1n1p1 is not being used as /boot/efi/ so it should be safe to delete. Not sure what you would do with the 512MiB free space though...
deadbang

iccid
Posts: 17
Joined: 2021-09-29 14:30

Re: cannot boot debian

#5 Post by iccid »

Thank you. I have done what you told me:

efibootmgr -o 6,0,7

BootCurrent: 0007
Timeout: 1 seconds
BootOrder: 0006,0000,0007
Boot0000* Windows Boot Manager
Boot0001* UEFI:CD/DVD Drive
Boot0002* UEFI:Removable Device
Boot0003* UEFI:Network Device
Boot0004* UEFI:Removable Device
Boot0005* UEFI:Network Device
Boot0006 debian
Boot0007* UEFI OS
Boot0008* debian

but again I have got the grub commandline. Please note that it says:

GNU GRUB Version 2.04

but look at what is in my debian:

apt show grub2

Package: grub2
Version: 2.06-3
Priority: optional
Section: admin
Maintainer: GRUB Maintainers <pkg-grub-devel@alioth-lists.debian.net>
Installed-Size: 12.3 kB
Depends: grub-pc (= 2.06-3), grub-common (= 2.06-3)
Homepage: https://www.gnu.org/software/grub/
Tag: admin::boot, role::dummy
Download-Size: 2360 B
APT-Sources: http://ftp.it.debian.org/debian testing/main amd64 Packages
Description: GRand Unified Bootloader, version 2 (dummy package)
This is a dummy transitional package to handle GRUB 2 upgrades. It can be
safely removed.

I suspect there is another GRUB somewhere which is taking control at boot. What do you think?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: cannot boot debian

#6 Post by Head_on_a_Stick »

I think your UEFI firmware is a pile of crap. This is quite normal, sadly.

Try

Code: Select all

# dpkg-reconfigure grub-efi-amd64
And pick the "force extra installation to EFI removable loader location" option.
deadbang

iccid
Posts: 17
Joined: 2021-09-29 14:30

Re: cannot boot debian

#7 Post by iccid »

This is what the system says

# dpkg-reconfigure grub-efi-amd64

Installing for x86_64-efi platform.
Installation finished. No error reported.
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-5.18.0-3-amd64
Found initrd image: /boot/initrd.img-5.18.0-3-amd64
Found linux image: /boot/vmlinuz-5.10.0-16-amd64
Found initrd image: /boot/initrd.img-5.10.0-16-amd64
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
Processing triggers for shim-signed:amd64 (1.38+15.4-7) ...

After reboot I have got the sadly familiar grub comandline again...I assume you don't think there is another grub somewhere and you think the culprit is the quality of EFI firmware. Consider that this firmware was working good with Neon...I cannot believe I cannot boot in any way...this is the first time in 20 years! My feeeling is that we configure the debian grub, and another grub shows up at boot...vanishing everything we have done...

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: cannot boot debian

#8 Post by Head_on_a_Stick »

Did you select the removable loader location option?

We can also try it manually:

Code: Select all

# cp /boot/efi/EFI/debian/shimx64.efi /boot/efi/EFI/Boot/bootx64.efi
# cp /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/Boot/
# debconf-set-selections <<<"grub-efi-amd64 grub2/force_efi_extra_removable boolean true"
This operation should replace /boot/efi/EFI/Boot/bootx64.efi (which is being booted by your firmware) with Debian's versions.
deadbang

iccid
Posts: 17
Joined: 2021-09-29 14:30

Re: cannot boot debian

#9 Post by iccid »

Thank you for your patience.
Yes, I did select removable location option and also typed your commands manually. No good news howevar.

here is my current situation after manual booting:

root@hermes:~# efibootmgr -uv
BootCurrent: 0007
Timeout: 1 seconds
BootOrder: 0007,0000,0008,0006,0001,0002,0003
Boot0000* Windows Boot Manager HD(2,GPT,0e184784-e1c3-4c9e-b114-39ee4cc23371,0x105000,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)䥗䑎坏S
Boot0001* UEFI:CD/DVD Drive BBS(129,,0x0)
Boot0002* UEFI:Removable Device BBS(130,,0x0)
Boot0003* UEFI:Network Device BBS(131,,0x0)
Boot0004* UEFI:Removable Device BBS(130,,0x0)
Boot0005* UEFI:Network Device BBS(131,,0x0)
Boot0006 debian HD(2,GPT,0e184784-e1c3-4c9e-b114-39ee4cc23371,0x105000,0x32000)/File(\EFI\DEBIAN\SHIMX64.EFI)
Boot0007* UEFI OS HD(1,GPT,9805748b-d399-486a-914e-384fac52d819,0x800,0x100000)/File(\EFI\BOOT\BOOTX64.EFI)
Boot0008* debian HD(1,GPT,9805748b-d399-486a-914e-384fac52d819,0x800,0x100000)/File(\EFI\DEBIAN\SHIMX64.EFI)

Do you get any clue from this ?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: cannot boot debian

#10 Post by Head_on_a_Stick »

I didn't notice the PARTUUID for Boot0007 — it's pointing to /dev/nvme1n1p1 rather than /boot/efi/ (which is mounted under /dev/nvme0n1p2).

So try deleting /dev/nvme1n1p1 and also remove Boot0007 (if you can). My ThinkPad will remember & recreate deleted boot entries if the EFI loader is still present on the ESP, which can be quite annoying, perhaps your firmware is similar.

Try to set Boot0006 as first in the boot order. If that doesn't work this should create a new entry for /boot/efi/EFI/Boot/bootx64.efi and place it top of the boot order:

Code: Select all

# efibootmgr --create --label 'Debian (bootx64.efi)' --disk /dev/nvme0n1 --part 2 --loader '/EFI/Boot/bootx64.efi'
deadbang

iccid
Posts: 17
Joined: 2021-09-29 14:30

Re: cannot boot debian

#11 Post by iccid »

I have deleted /dev/nvme1n1 and removed Boot0007. Now my laptop for the first time rebooted...Windows! which was second in the boot order. Ok, that is not quite successful, but just a start... I have noticed that no menu was displayed to choose an OS.
Now my problem is: how can I boot Debian in order to try your last hint? I cannot do manually any more!

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: cannot boot debian

#12 Post by Head_on_a_Stick »

Check the firmware ("BIOS") for a boot menu to select individual NVRAM entries.

The efibootmgr command can be run from any live ISO booted in UEFI mode but it looks like your firmware isn't co-operating.

I would now try deleting entries 0, 7 & 8 and see if Boot0006 will then work if it's set by itself in the boot order:

Code: Select all

efibootmgr -o 6
deadbang

iccid
Posts: 17
Joined: 2021-09-29 14:30

Re: cannot boot debian

#13 Post by iccid »

Well, your idea on BIOS was a really good one! I entered BIOS settings: in Boot/UEFI NVME Drive BBS Priorities there is a menu with two entries:

Boot option #1 here I can select from menu Debian or Windows: selecting Windows, will boot Windows, selecting Debian will boot Debian

Boot option #2 [Disabled]

Option 2 is disabled and I cannot change that in BIOS.

If booting Debian this is what I get:

efibootmgr -uv
BootCurrent: 0006
Timeout: 1 seconds
BootOrder: 0006,0000
Boot0000 Windows Boot Manager HD(2,GPT,0e184784-e1c3-4c9e-b114-39ee4cc23371,0x105000,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)䥗䑎坏S
Boot0004* UEFI:Removable Device BBS(130,,0x0)
Boot0005* UEFI:Network Device BBS(131,,0x0)
Boot0006* debian HD(2,GPT,0e184784-e1c3-4c9e-b114-39ee4cc23371,0x105000,0x32000)/File(\EFI\DEBIAN\SHIMX64.EFI)
Boot0008* debian HD(1,GPT,9805748b-d399-486a-914e-384fac52d819,0x800,0x100000)/File(\EFI\DEBIAN\SHIMX64.EFI)

While booting Debian I am also able to see a menu with 3 entries:
Debian
Advanced options for debian/gnu linux
UEFI

Summing up and thanks to your idea now I can select OS to boot from BIOS. The only missing piece is a start menu to choose an OS...Any genial idea to progress further?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: cannot boot debian

#14 Post by Head_on_a_Stick »

You need to enable os-prober for it to be able to add a GRUB menuentry for Windows.

https://wiki.debian.org/Grub#Dual_Boot
deadbang

iccid
Posts: 17
Joined: 2021-09-29 14:30

Re: cannot boot debian - SOLVED

#15 Post by iccid »

OS prober this time worked as expected and added Windows entry at boot: now everything is in place and I can choose which OS to be booted from a menu.
Here is my current situation:

efibootmgr -uv
BootCurrent: 0006
Timeout: 1 seconds
BootOrder: 0006,0000,0001,0002,0003
Boot0000 Windows Boot Manager HD(2,GPT,0e184784-e1c3-4c9e-b114-39ee4cc23371,0x105000,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)䥗䑎坏S
Boot0001* UEFI:CD/DVD Drive BBS(129,,0x0)
Boot0002* UEFI:Removable Device BBS(130,,0x0)
Boot0003* UEFI:Network Device BBS(131,,0x0)
Boot0006* debian HD(2,GPT,0e184784-e1c3-4c9e-b114-39ee4cc23371,0x105000,0x32000)/File(\EFI\DEBIAN\SHIMX64.EFI)

I have deleted non-used entries. I have verified that I do not need 40_custom extra lines and deleted them.
I must thank Head_on_a_Stick for his patience and perseverance: I could not have been successful without your big help.
I hope this thread will help others with problems with UEFI firmware.

Post Reply