0

I have a Samsung ATIV Book 9 with Windows 8 and over the time different Linux distributions. Lately, I switched from Debian 11 to SuSE Tumbleweed and now to Debian 12. Since this switch to Debian 12 I cannot boot from disk any more. When I change the Linux distribution/ version, I format and overwrite / and swap but keep all other partitions.

When I boot, the system tells me that it cannot find a system to boot and I should press to initiate the Windows Rescue system.

I then insert the Debian 12 installation medium (SD card), enter the grub command mode and enter the following code to boot the Linux system:

grub> set root=(hd0,5)
grub> linux /boot/vmlinuz-6.1.0-11-amd64 root=/dev/sda5
grub> initrd /boot/initrd.img-6.1.0-11-amd64
grub> boot

(How to boot from Grub Shell) That works but is tedious.

This is my partition table:

Device         Start       End   Sectors   Size Type
/dev/sda1       2048   1023999   1021952   499M Windows recovery environment
/dev/sda2    1024000   1638399    614400   300M Microsoft basic data
/dev/sda3    1638400   1900543    262144   128M Microsoft reserved
/dev/sda4    1900544 217001984 215101441 102.6G Microsoft basic data
/dev/sda5  217004032 278444031  61440000  29.3G EFI System
/dev/sda6  278444032 294828031  16384000   7.8G Linux swap
/dev/sda7  294828032 470757375 175929344  83.9G Linux home
/dev/sda8  470757377 498020352  27262976    13G Windows recovery environment
/dev/sda9  498020353 500117504   2097152     1G Windows recovery environment



Device         Start       End   Sectors Type-UUID                            UUID                                 Name                         Attrs
/dev/sda1       2048   1023999   1021952 DE94BBA4-06D1-4D40-A16A-BFD50179D6AC 1F2F0B2D-5B67-4F47-A273-FF56466FAA0E Basic data partition         RequiredPartition
/dev/sda2    1024000   1638399    614400 EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 B103ECB1-3B97-4DA6-B8F2-BAC85C20E16F EFI system partition         
/dev/sda3    1638400   1900543    262144 E3C9E316-0B5C-4DB8-817D-F92DF00215AE D0717FA8-DDAA-4966-8F76-53AB4571A31C Microsoft reserved partition 
/dev/sda4    1900544 217001984 215101441 EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 07973992-B738-46E4-8743-09032C2F0621 Basic data partition         
/dev/sda5  217004032 278444031  61440000 C12A7328-F81F-11D2-BA4B-00A0C93EC93B 58F769CE-1A2F-4266-AF6B-3F27A5EE053D Root                         LegacyBIOSBootable
/dev/sda6  278444032 294828031  16384000 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F D5E27C09-786F-46B9-81A8-BD15053043FC Swap                         
/dev/sda7  294828032 470757375 175929344 933AC7E1-2EB4-4F13-B844-0E14E2AEF915 65F8E696-9D05-4605-9B00-DE061A9A8ED5 Home                         
/dev/sda8  470757377 498020352  27262976 DE94BBA4-06D1-4D40-A16A-BFD50179D6AC 002EF7EB-5D99-4584-922A-34D7E1611290 Basic data partition         RequiredPartition
/dev/sda9  498020353 500117504   2097152 DE94BBA4-06D1-4D40-A16A-BFD50179D6AC B9FB900E-BA45-4D16-4173-636C65706975 Basic data partition         RequiredPartition

This is the output of sudo efibootmgr -v

BootCurrent: 0006
Timeout: 2 seconds
BootOrder: 0006,0007,0005,0000,0001,0002
Boot0000* opensuse-secureboot   VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0001* opensuse      VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0002* UEFI OS       VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0005* debian        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0006* UEFI: Generic STORAGE DEVICE 0819     PciRoot(0x0)/Pci(0x1d,0x0)/USB(1,0)/USB(8,0)/HD(1,MBR,0x23261683,0x11a4,0x4a20)..BO
Boot0007* Generic STORAGE DEVICE 0819   BBS(USB,,0x0)..BO

Does anyone have any idea what I could do to boot directly from HDD?

Thanks, Jan

[Update]

  1. Re-installed the debian OS incl. erasing /dev/sda2 (EFI)
  2. Ensured that in BIOS it only boots EFI
  3. Executed efibootmgr --remove-dups -> did not change anything
  4. Used efibootmgr -b [0|1|5] -B to delete some entries manually
  5. Created a new entry efibootmgr --create --disk /dev/sda --part 2 --label "GRUB2" --loader \\EFI\\debian\\grubx64.efi -> gave me a nice entry like Boot0000* GRUB2 HD(2,GPT,b103ecb1-3b97-4da6-b8f2-bac85c20e16f,0xfa000,0x96000)/File(\EFI\debian\grubx64.efi) --> after reboot it looked like Boot0000* GRUB2 VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb) => why does this happen?
  6. Create another entry "GRUB2 II" and did not reboot -> so you can see the difference to "GRUB2"

efibootmgr -v

BootCurrent: 0006
Timeout: 2 seconds
BootOrder: 0001,0006,0000,0005,0002
Boot0000* GRUB2 VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0001* GRUB2 II      HD(2,GPT,b103ecb1-3b97-4da6-b8f2-bac85c20e16f,0xfa000,0x96000)/File(\EFI\debian\grubx64.efi)
Boot0002* UEFI OS       VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0005* debian        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0006* UEFI: Generic STORAGE DEVICE 0819     PciRoot(0x0)/Pci(0x1d,0x0)/USB(1,0)/USB(8,0)/HD(1,MBR,0x23261683,0x11a4,0x4a20)..BO

I also noticed that the UUIDs shown by efibootmgr -v do not match the UUIDs presented by lsblk -o +partuuid (except for sdb (the SD that I use for booting) and the newly created entry):

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS PARTUUID
sda      8:0    0 238.5G  0 disk             
|-sda1   8:1    0   499M  0 part             1f2f0b2d-5b67-4f47-a273-ff56466faa0e
|-sda2   8:2    0   300M  0 part /boot/efi   b103ecb1-3b97-4da6-b8f2-bac85c20e16f
|-sda3   8:3    0   128M  0 part             d0717fa8-ddaa-4966-8f76-53ab4571a31c
|-sda4   8:4    0 102.6G  0 part             07973992-b738-46e4-8743-09032c2f0621
|-sda5   8:5    0  29.3G  0 part /           58f769ce-1a2f-4266-af6b-3f27a5ee053d
|-sda6   8:6    0   7.8G  0 part [SWAP]      d5e27c09-786f-46b9-81a8-bd15053043fc
|-sda7   8:7    0  83.9G  0 part /home       65f8e696-9d05-4605-9b00-de061a9a8ed5
|-sda8   8:8    0    13G  0 part             002ef7eb-5d99-4584-922a-34d7e1611290
`-sda9   8:9    0     1G  0 part             b9fb900e-ba45-4d16-4173-636c65706975
sdb      8:16   1  14.8G  0 disk             
|-sdb1   8:17   1   738M  0 part             23261683-01
`-sdb2   8:18   1   9.3M  0 part             23261683-02

sudo tree /boot/efi/

/boot/efi/
`-- EFI
    `-- debian
        |-- BOOTX64.CSV
        |-- fbx64.efi
        |-- grub.cfg
        |-- grubx64.efi
        `-- mmx64.efi

3 directories, 5 files

[Upadte 2]

/boot/efi shows the contents of /dev/sda2

$ mount
...
/dev/sda2 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
...

I use the installation medium to enter grub and then boot the system via grub command line as described here: How to boot from Grub Shell

$ sudo mount /dev/sda2 /mnt
$ sudo tree /mnt/
/mnt/
`-- EFI
    `-- debian
        |-- BOOTX64.CSV
        |-- fbx64.efi
        |-- grub.cfg
        |-- grubx64.efi
        `-- mmx64.efi

3 directories, 5 files

Here the output of lsblk

$ lsblk -o +partuuid,UUID
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS PARTUUID                             UUID
sda      8:0    0 238.5G  0 disk                                                  
|-sda1   8:1    0   499M  0 part             1f2f0b2d-5b67-4f47-a273-ff56466faa0e 825667F15667E3FF
|-sda2   8:2    0   300M  0 part /mnt        b103ecb1-3b97-4da6-b8f2-bac85c20e16f 604D-98BD
|                                /boot/efi                                        
|-sda3   8:3    0   128M  0 part             d0717fa8-ddaa-4966-8f76-53ab4571a31c 
|-sda4   8:4    0 102.6G  0 part             07973992-b738-46e4-8743-09032c2f0621 5EA66ADEA66AB5E5
|-sda5   8:5    0  29.3G  0 part /           58f769ce-1a2f-4266-af6b-3f27a5ee053d 8c520857-fa9a-4943-a92b-9aa16fb9075c
|-sda6   8:6    0   7.8G  0 part [SWAP]      d5e27c09-786f-46b9-81a8-bd15053043fc af973a94-fc1f-4797-a89c-fb4558d7609e
|-sda7   8:7    0  83.9G  0 part /home       65f8e696-9d05-4605-9b00-de061a9a8ed5 295faf9b-1536-4a9d-aa92-7cbb9d251312
|-sda8   8:8    0    13G  0 part             002ef7eb-5d99-4584-922a-34d7e1611290 74846D39846CFECC
`-sda9   8:9    0     1G  0 part             b9fb900e-ba45-4d16-4173-636c65706975 E06C-1BB1
sdb      8:16   1  14.8G  0 disk                                                  2023-06-10-10-25-55-00
|-sdb1   8:17   1   738M  0 part             23261683-01                          2023-06-10-10-25-55-00
`-sdb2   8:18   1   9.3M  0 part             23261683-02                          DEB0-0001

Even after re-installation of Debian the boot via EFI Boot Menu still does not succeed? —> correct

Are you sure the installation media has booted in UEFI Mode for the installation? (Disable "Legacy Boot" of removable media in BIOS, Check the output of efibootmgr -v whe booted in the installation media. – Qualified output states the desired UEFI boot mode).

$ efibootmgr -v
BootCurrent: 0006
Timeout: 2 seconds
BootOrder: 0005,0001,0006,0000,0002
Boot0000* GRUB2 VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0001* GRUB2 II      HD(2,GPT,b103ecb1-3b97-4da6-b8f2-bac85c20e16f,0xfa000,0x96000)/File(\EFI\debian\grubx64.efi)
Boot0002* UEFI OS       VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0005* debian        HD(2,GPT,b103ecb1-3b97-4da6-b8f2-bac85c20e16f,0xfa000,0x96000)/File(\EFI\debian\grubx64.efi)
Boot0006* UEFI: Generic STORAGE DEVICE 0819     PciRoot(0x0)/Pci(0x1d,0x0)/USB(1,0)/USB(8,0)/HD(1,MBR,0x23261683,0x11a4,0x4a20)..BO

I'll reboot and print the output of efibootmgr -v again. ...

$ efibootmgr -v
BootCurrent: 0006
Timeout: 2 seconds
BootOrder: 0006,0005,0000,0002
Boot0000* GRUB2 VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0002* UEFI OS       VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0005* debian        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0006* UEFI: Generic STORAGE DEVICE 0819     PciRoot(0x0)/Pci(0x14,0x0)/USB(13,0)/HD(1,MBR,0x23261683,0x11a4,0x4a20)..BO

The settings in the bios look as follows:

Secure Boot Control -> off
OS Mode Selection -> UEFI OS (alternative options would be |CSM OS| or |CSM and UEFI OS|) It could be that I had |CSM and UEFI OS| during installation. 
Fast BIOS Mode -> off
PXE OPROM -> off
15
  • Why do you have a 29.3 GB EFI partition? Is there something special to know about it? // Issue the command sudo efibootmgr -v and extend your question by the output.
    – dodrg
    Commented Aug 29, 2023 at 23:15
  • Thanks for the hint @dodrg . I have extended my post by the command you suggested. Interestingly, the KDE partition manager and the expert mode of fdisk identify /dev/sda2 as EFI partition and /dev/sda5 as linux root.
    – Jan
    Commented Aug 30, 2023 at 18:19
  • I booted Knoppix and used gdisk to change the types of partitions 2 and 5 to EFI and linux root, respectively. -> did not boot || Then I installed grub again with 'sudo grub-install /dev/sda' and 'sudo update-grub' -> still does not boot. Any other ideas?
    – Jan
    Commented Aug 30, 2023 at 21:19
  • You have duplicate entries in the EFI Boot Menu: Issue efibootmgr --remove-dups to eliminate them. // Do not mix Legacy and UEFI mode! As you've a GPT partition scheme you should decide to UEFI BIOS mode and also disable "USB Legacy boot" in BIOS. On GPT/EFI systems the bootmanagers reside in the EFI partition, not in some "hidden" areas before the partitions as in earlier times.
    – dodrg
    Commented Aug 31, 2023 at 21:35
  • Please check the content of the probably real EFI partition /dev/sda2.
    – dodrg
    Commented Aug 31, 2023 at 21:41

1 Answer 1

0

To summarize the progress in the comments some steps already done are mentioned here.
Perhaps you want to check the details to see any differences.


Please note that your provided link to "How to boot from Grub Shell" handles GRUB in Legacy Mode. This typically is not anymore the expected default for current installations. In general things work equal or similar, but some details are not true for GPT/EFI.

Especially at EFI handled systems the loader is not hidden in a not partitioned space at the beginning of the disk. Here Grub uses the EFI-Partition for its first part of the loader code.


PREREQUISITES:

Correct the Partition Types

Your partition types are not properly set.

a) It is not plausible why you have three "Microsoft Rescue Partitions".
=> Check them out and decide which is the real Microsoft Recovery Partition and what is the content of the the other two MS Recovery Partitions.
(That should be sorted out, but for the current problem this is not relevant).

b) Relevant for the problem are the partition types of sda2 and sda5. They should look like this:

$   sudo fdisk -l /dev/sda | grep -iE "(Sectors|sda[25])"
Device         Start       End   Sectors   Size Type
/dev/sda2    1024000   1638399    614400   300M EFI System
/dev/sda5  217004032 278444031  61440000  29.3G Linux filesystem
$  lsblk -o path,mountpoint,partflags,parttype,size,fstype,uuid /dev/sda{2,5}
PATH           MOUNTPOINT  PARTFLAGS PARTTYPE                                SIZE FSTYPE UUID
/dev/sda2      /boot/efi             c12a7328-f81f-11d2-ba4b-00a0c93ec93b    300M vfat   604D-98BD
/dev/sda5      /                     0fc63daf-8483-4772-8e79-3d69d8477de4   29.3G ext4   8c520857-fa9a-4943-a92b-9aa16fb9075c

Especially the PARTTYPE of the EFI-Partition sda2 is essential.
(This updated state has been approved by Jan.)

Partition types of interest at your disk:

fdisk   Partition                    GPT
Number  Type                         Type-UUID (=PARTTYPE)
------  ---------------------------  -------------------------------------
     1  EFI System                    C12A7328-F81F-11D2-BA4B-00A0C93EC93B
    10  Microsoft reserved            E3C9E316-0B5C-4DB8-817D-F92DF00215AE
    11  Microsoft basic data          EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
    14  Windows recovery environment  DE94BBA4-06D1-4D40-A16A-BFD50179D6AC
    19  Linux swap                    0657FD6D-A4AB-43C4-84E5-0933C84B4F4F
    20  Linux filesystem              0FC63DAF-8483-4772-8E79-3D69D8477DE4
------  ---------------------------  -------------------------------------

At this point your disks are in a state that should be ready for UEFI boot.

Enable Grub in EFI (REGULAR WAY)

There are two possibilities to enable Grub:

  1. Boot with a removable media into a Life Linux System, then prepare and chroot into your installation in /dev/sda5.

  2. You boot with a Life Linux System into GRUB, change to the Grub command line and start manually the Linux on /dev/sda5.

Both techniques result in you being in the active environment of your Linux on /dev/sda5, the system with the boot problems.

Check that your EFI System Partition is mounted at /boot/efi, i.e. by lsblk /dev/sda2.
Then install Grub by

update-grub
grub-install

Do not add any extra parameters! As it is an EFI and you are currently within the Linux to be updated, this should be enough.

The result:

  • The file /boot/grub/grub.cfg is updated to the current system settings (by update-grub)
  • The folder /boot/efi/EFI/debian and its content is created.
  • The EFI Boot Menu has an added entry calling Grub from the EFI System Partition. This new entry is set as the default to use at boot time.
  • The file /boot/efi/EFI/debian/grub.cfg should forwared to /dev/sda5/boot/grub/ (by the partitions UUID)
    search.fs_uuid 8c520857-fa9a-4943-a92b-9aa16fb9075c root hd0,gpt5 
    set prefix=($root)'/boot/grub'
    configfile $prefix/grub.cfg
    
  • Check the above and check that the reference exists: /dev/sda5/boot/grub/ with the ./grub.cfg inside and Grub's binaries in the sub-folder ./86_64-efi/
  • Also check efibootmgr -v for the new entry.

When the regular way failed:

Update Firmware

If this does not work, then the source of your problem is your UEFI Firmware.

  1. If you have the possibility to update the firmware, this would be the right moment.
  2. Then boot again via your external media and do again a update-grub && grub-install.
  3. Then check regular boot and EFI Menu entries.

When you have to live with a buggy Firmware:

Find the Path the UEFI Firmware accepts

I've seen a SONY VAIO originating from 2012 with a buggy firmware. It accepted nothing than an absolutely rudimentary UEFI setup. A dual boot Linux/Windows has been impossible.

Please note: As you boot manually via external Grub <sda2>/EFI/ is the same as /boot/efi/EFI/. Finally we want to manipulate the content of your EFI Partition <sda2>.

The defaults in an UEFI BIOS Boot should know the path

<boot-partition>/EFI/boot/bootx64.efi

The <boot-partition> is defined by the EFI System PARTTYPE for sda2 as we assured above.

So generate the proper content of /boot/efi/EFI/boot/

  1. Copy the content of /boot/efi/EFI/Debian/ into the new directory /boot/efi/EFI/boot/

  2. Copy the bootx64.efi from your Debian 12 installation media (I use the Debian 12 Live ISO):

    cp <Debian 12 Life Media>/EFI/boot/bootx64.efi` /boot/efi/EFI/boot/.
    

    Note that these *.efi on the installation media differ from those you find in <sda2>/EFI/Debian/.

  3. Set the EFI Menu entry:

    efibootmgr -c -l "\EFI\boot\bootx64.efi" -L "GRUB"
    
  4. Verify via efibootmgr -v:

    • The entry is correct
    • This entry is the first in the boot order
    • If a "next boot" value is set, this entry is the value of "next boot".
  5. Reboot the system without external boot media.

  6. Tell the results to see if we need a variation.

10
  • I did as you described. Change sda5's PARTTYPE from Linux Root to Linux Filesystem (0fc63daf-...). It is probably not the grub installation. I checked all files you list here and it looks reasonable (=the same as you describe here). I now used the supergrub2 to boot my system. When I select /dev/sda2 (the efi partition), it opens "my" grub and boots the system. What irritates me is the output of efibootmgr -v. When I install grub I get a nice looking entry with HD(2,GPT, ... but after reboot this entry had been changed to VenHw(99e275e7- ... Thanks for your continuous support @dodrg
    – Jan
    Commented Sep 5, 2023 at 20:00
  • Thanks for checking the sda5. The important information would be the PARTTYPE of sda2.
    – dodrg
    Commented Sep 6, 2023 at 23:03
  • As you have documented in your question, the EFI Boot Menu entry of OpenSuse also has the format you dislike: Boot0001* opensuse VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb) — So this format should do its job, if the parameters are fitting to it. So wie first have to find out if EFI accepts sda2 as EFI System Partition and then see what this "transformation" of original format changes. — Or (1) Did you do a BIOS Firmware Update since OpenSuse? (2) Did you "reset" or "delete" the EFI variables when changing to Debian 12? (not recommended with no need)
    – dodrg
    Commented Sep 6, 2023 at 23:10
  • Hi @dodrg , no, I did neither update the BIOS nor reset or delete any EFI variables. Do you know how I could find out if EFI accepts ` sda2 ` ?
    – Jan
    Commented Sep 8, 2023 at 6:19
  • EFI will accept sda2 if th partition type is "EFI System" = PARTTYPE C12A7328-F81F-11D2-BA4B-00A0C93EC93B. It also has to have a supported filesystem, typically FAT32 aka. VFAT. There must exist the correct files-structure that you already listed. => So the repeatedly asked question for the next step is the PARTTYPE of sda2.
    – dodrg
    Commented Sep 8, 2023 at 6:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .