Grub_disk_native_sectors not found after upgrade Leap 15.3 to 15.4 (grub rescue mode)

Hej-hej,

after a system upgrade on March 8th 2023, with …

zypper --releasever=15.4 refresh
zypper --releasever=15.4 dup --auto-agree-with-licenses --download-in-advance --allow-vendor-change

… grub2 does not work in the beginning of a boot procedure and a message comes something like:

“error: "symbol 'grub_disk_native_sectors' not found" entering rescue mode” …
grub rescue> 

I have a CD of the boot tool Super Grub 2.0 and I only can boot using that at the moment, in that tool I can select the entry “Leap 15.4” and then it boots as expected.

I have no clear idea what grub commands I can savely apply or if I just can force a reinstall of some grub packages that can fix it. The boot file setup is nothing extraordinary.

Any help or useful idea of the right commands is much appreciated, thank you.
Kind Regards

Can your provide the output from:

fdisk -l

and from

grep -v '^#' /etc/sysconfig/bootloader

Here the output:

fdisk --list
Disk /dev/sda: 596.17 GiB, 640135028736 bytes, 1250263728 sectors
Disk model: SAMSUNG HM641JI 
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: dos
Disk identifier: 0x1f8d46a3

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sda1             2048     206847     204800   100M  7 HPFS/NTFS/exFAT
/dev/sda2           206848  170983423  170776576  81.4G  7 HPFS/NTFS/exFAT
/dev/sda3  *     170983424 1202378751 1031395328 491.8G  f W95 Ext'd (LBA)
/dev/sda4       1202378752 1250258943   47880192  22.8G 27 Hidden NTFS WinRE
/dev/sda5        170985472  257042431   86056960    41G  7 HPFS/NTFS/exFAT
/dev/sda6        257044480  273831935   16787456     8G 82 Linux swap / Solaris
/dev/sda7        273833984  379543551  105709568  50.4G 83 Linux
/dev/sda8        379545600 1202378751  822833152 392.4G 83 Linux

Partition table entries are not in disk order.


Disk /dev/zram0: 981 MiB, 1028653056 bytes, 251136 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram1: 981 MiB, 1028653056 bytes, 251136 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram2: 981 MiB, 1028653056 bytes, 251136 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram3: 981 MiB, 1028653056 bytes, 251136 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram4: 981 MiB, 1028653056 bytes, 251136 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram5: 981 MiB, 1028653056 bytes, 251136 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram6: 981 MiB, 1028653056 bytes, 251136 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram7: 981 MiB, 1028653056 bytes, 251136 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

and …

grep --invert-match '^#' /etc/sysconfig/bootloader

LOADER_TYPE="grub2"

LOADER_LOCATION=""

DEFAULT_APPEND="resume=/dev/disk/by-id/ata-SAMSUNG_HM641JI_S26XJ9BB745271-part6 splash=silent quiet showopts"

DEFAULT_VGA="0x317"

FAILSAFE_APPEND="showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe"

FAILSAFE_VGA="0x317"

XEN_KERNEL_APPEND="resume=/dev/disk/by-id/ata-SAMSUNG_HM641JI_S26XJ9BB745271-part6 splash=silent quiet showopts"

XEN_APPEND=""

XEN_VGA="0x317"
CYCLE_DETECTION="no"

CYCLE_NEXT_ENTRY="1"

SECURE_BOOT="no"

TRUSTED_BOOT="no"

UPDATE_NVRAM="yes"

I’m not sure what is wrong. So I am going to do some guessing.

My guess: the bootloader is installed in your boot partition, rather than in the MBR. And you have an older grub installed in the MBR which depends on something no longer installed.

My suggestion:

Use Yast Bootloader

Check where it says grub is installed. If I’m right and you are booting from a partition, then check the box to install generic boot code in the MBR.

You can quit without saving the change (maybe it is “Abort”), if something doesn’t look right. In that case, make notes about what doesn’t look right.

Right. I had to check two things, now it works as expected—what I did was in the YAST bootloader , then the first tab (Boot Code Options) to check:

Boot Load Location

  • [x] Write to Master Boot Record

and

  • [x] Write generic Boot Code to MBR

… and then confirm OK.

Thank you for redirecting me towards the solution
Kind Regards

1 Like

The are mutually exclusive. You cannot write both grub and generic boot code to the same place.

Yes, I noticed that. Hopefully, Yast knows how to deal with that mistaken choice. In any case, his last post seems to indicate that it is working.

Alright—well from my user perspective checkboxes (the design of that dialogue) are not mutually exclusive :grin:

Now I set it anew and tested, and it works as well — the first tab Boot Code Options I have set :

Boot Load Location

  • [x] write to logical partition (/dev/sda7)
  • [ ] write to extended partition (/dev/sda3)
  • [x] write to Master Boot Record (/dev/sda)

and below that

  • [ ] write generic Boot Cod to MBR

Just to notice the question relating “Hopefully, Yast knows how to deal with that mistaken choice”: In the very first try, I added only the checkbox for generic [x] write generic Boot Cod to MBR and left out the other above Boot Load Location option [ ] write to Master Boot Record (/dev/sda) then the boot haltered with a black screen at the very beginning and nothing happend

Grub _

Then I did check both of these MBR options, as described above, and it appeared working. Perhaps there is a mistake of designing the dialogue like that, from a philosophical point of view or so. Anyway it is working, and that’s the point.

Is this setting now the correct one, also in the long run for the future?

If it is working, then it should be okay.

Yes, Yast allows you to set both even though that doesn’t make sense. I presume that the Yast team know how to deal with that.

There’s actually no need to have both “write to logical partition” and “write to MBR”. The write to the MBR already does what you need. But it is harmless to do both. So just leave it as it is.

No, it is not. For every location grub2-install is invoked and every time it creates new /boot/grub2/i386-pc/core.img (“stage1.5”). If embedding is not possible for several locations, then this core.img will be valid only for the last location and previous locations will be referencing deleted files. Which may appear to work until space is reused. It was actually relatively common problem in the past, when YaST by default installed in all possible locations.

In general, it is best to avoid multiple install locations.