error: file '/grub2/i386-pc/normal.mod' not found after software update (openSUSE 13.2)

Dear folks,

after an normal software update in openSUSE 13.2 (on January 4, 2016 or so) the boot crashes. It does not boot after switching on the computer. After «Grub Loading …» it immediately goes into grub rescue while having printed before the message «error file /boot/grub2/i386-pc/normal.mod not found».

Reading in documentations and manuals I followed https://en.opensuse.org/SDB:Repair_MBR_after_Windows_install to let grub2-mkconfig get the configuration right or if unsuccessful to reinstall the boot manager. So I did:


# fdisk --list
Device         Start        End    Sectors   Size Type
/dev/sda1       xxxx     xxxxxx     xxxxxx   156M EFI System 
/dev/sda2     xxxxxx  xxxxxxxxx  xxxxxxxxx     2G Microsoft basic data
/dev/sda3  xxxxxxxxx xxxxxxxxxx xxxxxxxxxx    20G Microsoft basic data
/dev/sda4 xxxxxxxxxx xxxxxxxxxx   xxxxxxxx 909.4G Microsoft basic data

So I figured boot to be on /dev/sda1 and /root is on /dev/sda3


rescue# mount /dev/sda3 /mnt
rescue# mount /dev/sda1 /mnt/boot/efi # is on separate partition
rescue# mount --bind /dev /mnt/dev
rescue# mount --bind /proc /mnt/proc
rescue# mount --bind /sys /mnt/sys
rescue# mkdir /mnt/mounts # exists
rescue# mount --rbind /mounts /mnt/mounts
rescue# chroot /mnt # switch to /mnt but as a root environment


chroot# grub2-mkconfig -o /boot/grub2/grub.cfg 

… did not resolve the boot failure … so I did the install procedure:


chroot# grub2-install --verbose /dev/sda
installing for x86_64-efi platform.
...
grub2-install: info: executing modeprobe -q efivars.
grub2-install: info: executing efibootmgr -c -d /dev/sda -p 1 -w -L opensuse -l \EFI\opensuse\grubx64.efi.
requested operation failed: staus=8 000000000000002
installation finished. No error reported

This did not resolve the boot failure. Although it summarizes to have not found errors, the system does not boot and reports again «error: file ‘/grub2/i386-pc/normal.mod’ not found». So I guess the grub2-install cannot finish somehow «executing efibootmgr…», right?

But what can I do?
(1) start the LiveDVD with internet connection to hopefully resolve the boot failure by mounting and chroot and a subsequent zypper update on the broken system
(2) what logs would give further information?
(3) Do you have a third idea to fix the problem?
(4) When I have boot on /dev/sda1 is it correct to do grub2-install /dev/sda or must it be grub2-install /dev/sda1 or does grub2 figure this out by itself automatically?

Many thanks for your help in advance
Regards Infinite_Dao

Error message at boot means you are booting in legacy BIOS mode, not in EFI mode. Another “interesting” point is efibootmgr failure. 2 == EFI_INVALID_PARAMETER. For some reasons your firmware refuses to set variables.

Please show “efibootmgr -v” output.

Here it is:


efibootmgr --version # -V
version 0.6.0
efibootmgr --verbose # -v
BootCurrent: 0003
BootOrder: 0003,0001,0002,0000
Boot0000* Network Boot: Atheros Boot Agent    BIOS(80,0,18)........................R....................
Boot0001* Interal HDD : ST1000LM024 HN-M101MBB    BIOS(2,500,18)................-...........A................
Boot0002* SATA ODD    : Optiarc DVD RW AD-7740H   BIOS(3,500,18)................-...........A......#.........
Boot0003* EFI DVD/CDROM ACPI(a0341d0,0)PCI(1f,2)03120a00020000000000CD-ROM(1,380,22d77f)RC

I also realized that during the rescue-mount-procedure that the mount complained when I was mounting the /boot/efi:


mount /dev/sda1 /mnt/boot/efi
#  [312.050704] FAT-fs (sda1): volume was not properly unmounted. Some data may be corrupt. Please run fsck.

So I did also:


umount /dev/sda1
fsck -a /dev/sda1 # -a automatically repair
fsck-info: fsck from util-linux 2.25.1
fsck-info: CP437: Invalid argument
fsck-info: fsck.fat 3.0.26 (2014-03-07)
fsck-info: 0x25: Dirty byte is set. FS was not properly unmounted some data may be corrupt.
fsck-info: automatically removing dirty byte.
fsck-info: Performing changes.
fsck-info: /dev/sda1: 3 files, 32/39891 clusters

Then I performed again «grub2-install --verbose /dev/sda» but the boot failure remains still the same.

This does not list any EFI boot items except CD-ROM at all.

Then I performed again «grub2-install --verbose /dev/sda» but the boot failure remains still the same.

Error is unrelated to ESP. It looks like problem with NVRAM where EFI variables are stored. Try contacting vendor of your motherboard if it is possible to recover it (may be reinitialize).

I’m a bit lost in understanding what you mean by “Try contacting vendor of your motherboard if it is possible to recover it (may be reinitialize)” ?

The problem appears to be in your EFI BIOS the only people that can address that are those that made the motherboard. It may require reinitializing the BIOS and that is beyond what any here can help with only the people that made the mother board can know exactly what is needed.

Can you please elaborate more on your conclusion? What is the relation of …


grub2-install: info: executing efibootmgr -c -d /dev/sda -p 1 -w -L opensuse -l \EFI\opensuse\grubx64.efi. 
requested operation failed: staus=8 000000000000002

… to “2 == EFI_INVALID_PARAMETER” and your following conclusion “For some reasons your firmware refuses to set variables”.
Is it a code line of some sort in a boot related program?
Or do you mean the 000000000000002 stuff to indicate as 2 == EFI_INVALID_PARAMETER?

And what suggests exactly to be to “look like problem with NVRAM where EFI variables are stored” ? The above “requested operation failed: staus=8 000000000000002” ?

«may be reinitialize» what exactly can I try to reinitialize? I’m no expert on that topic, that’s why I’m asking, to understand.

Thank you for your understanding

Let’s try it from different side. In what mode was your system installed (BIOS or EFI)? Could you show output of

grep LOADER_TYPE /etc/sysconfig/bootloader

on your root filesystem?

I seem to be having a very similar problem. On an old BIOS-booting (i.e., non-UEFI boot) laptop, after an update, I get this error at boot time:

GRUB loading.
Welcome to GRUB!

error: file ‘/boot/grub2/i386-pc/gettext.mod’ not found.
Entering rescue mode...
grub rescue>

Based on /var/log/zypp/history, the previous grub2 in use was 2.02~beta2-20-10-1 from the 13.2-non-oss repository, which was working fine. This was updated to 2.02~beta2-20.13.1 (also from 13.2-non-oss) and that’s when it stopped working.

Could it be that this update, possibly tested on UEFI systems more than BIOS, is deleting files that non-UEFI-booting machines still need…?

It’s a different file in my case than Infinite_Dao, he’s missing normal.mod and I’m missing gettext.mod, but otherwise our situations appear entirely similar.

I have access to the file system through a 13.2 LiveUSB, any suggestions on what I should do next?

Check if file is actually present on disk. Check modification time - does it match time when grub2 was updated? Check that you have enough space in /boot/grub2.

File is indeed gone. Gigabytes of available space there (it’s a / partition, only /home is separate).

That folder (/boot/grub2/i386-pc) contains 223 files, namely a modinfo.sh and 222 others that all end on .mod (one of those is normal.mod, the one that Infinite_Dao is missing).

Does it exist in /usr/lib/grub2/i386-pc? Is it listed in moddep.lst (in either of directories)?

It’s there in /usr/lib/grub2/i386-pc. It is also listed in moddep.lst in that directory. There is no file called moddep.lst in /boot/grub2/i386-pc.

I couldn’t resist doing the blunt thing i.e. just copy the file from /usr/lib/grub2/i386-pc to /boot/grub2/i386-pc and reboot, here’s what I get:

  Booting ‘openSUSE’

error: can't find command ‘’.
error: can't find command ‘’.
error: can't find command ‘search’.
error: can't find command ‘echo’.
error: can't find command ‘linux’.
error: can't find command ‘echo’.
error: can't find command ‘initrd’.

Press any key to continue...

  Failed to boot both default and fallback entries.

Press any key to continue...

From there, if I press a key I get the text-mode Grub menu with the familiar entries (openSUSE + advanced options → recovery mode), but anything I pick from there gives me the same errors again.

I’m (obviously) not familiar with reinstalling / repairing grub, so far I’ve always been lucky enough with YaST doing this for me. If you could talk me through making this thing bootable again, that would be fantastic…


grep LOADER_TYPE /etc/sysconfig/bootloader
LOADER_TYPE="grub2"

I also checked zyppers log history files. The date the update was done was the January the 3rd:


grep --line-number '2016-01-03'  /var/log/zypp/history
 2016-01-03 18:59:45|install|k3b|2.0.80+git20160102.1831-2.1|x86_64|root@linux-kw7v.site|packman_opensuse_13.1|d4f4c00b4cde6e990685f86926197eccfdd245536f8947192e5bb67371c899d5|
2016-01-03 18:59:47|install|k3b-lang|2.0.80+git20160102.1831-2.1|noarch|root@linux-kw7v.site|packman_opensuse_13.1|a24cb23e4d1bc0a00955e638d0d8d78c5a0f940354422a8c04570cae9563d65d|
2016-01-03 18:59:47|install|k3b-codecs|2.0.80+git20160102.1831-2.1|x86_64|root@linux-kw7v.site|packman_opensuse_13.1|1a9bdb90a5ab4c077ba1fb752b542876f0b14adec5dd7ca9994893e0c6983c58|
2016-01-03 18:59:49|install|grub2|2.02~beta2-20.14.2|x86_64||repo-update|300bcfc02d5f99e5fb51c5eb43c7d8bfe67823c2586a9ecd479b99d69e81da68|

So I guess the update to grub2 to 2.02~beta2-20.14.2 may have issued the problems.

Infinite_Dao, apologies for hijacking your thread, that was not my intention. It appeared to me that our problems are very similar, that is why I posted here, it would probably have been wiser for me to start a separate thread. Sorry for that.

Arvidjaar, if you are still reading, I would suggest you assist Infinite_Dao first. Let me know if I should move my questions to a new thread, if that is easier.

Well I find you decision reasonable based on you boot failures and would probably have acted in the same way :wink:

Something went seriously wrong during GRUB installation. You need to reinstall it. I assume you are booting from live media, then do


mount /dev/your-root-device /mnt
mount /dev/your-boot-device /mnt/boot
mount --bind /sys /mnt/sys
mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
chroot /mnt
update-bootloader --reinit

then verify that /boot/grub2/i386-pc contains all the *.mod and *lst files that are present in /usr/lib/grub2/i386-pc.

If you can boot your system, just run update-bootloader. Adjust device names as needed.

So you did not use EFI boot in tthe first place and your attempt to reinstall GRUB while booting in EFI just confused everyone. So do the same checks on your system and if /boot/grub2/i386-pc is incomplete, try the same steps to reinstall it.

So I guess the update to grub2 to 2.02~beta2-20.14.2 may have issued the problems.

Probably.

Back up and running now, thanks arvidjaar!

This did work to :slight_smile: Thanks arvidjaar. BUT, and here it comes: after booting normally into user login an error message came up:


Subprocess failed. Error: RPM failed: error: unpacking of archive failed on file /usr/lib64/efi/grub.efi;5693fe76: cpio: symlink
error: grub2-x86_64-efi-2.02~beta2-20.14.2.x86_64: install failed
error: grub2-x86_64-efi-2.02~beta2-20.13.1.x86_64: erase skipped

I guess it was issued from the former software upgrade. So I checked all installed grub2 packages to be at the same version and did upgrade them manually:


zypper update grub2-x86_64-efi grub2-snapper-plugin
zypper install --force grub2-i386-pc

All fine so far and here comes the BUT-part after rebooting, again back to square zero: it does not boot but goes immediately into grub2 rescue mode. This time it does not find another *.mod file (I don’t remember).

I had to do the fix again with update-bootloader --reinit and everything seemed OK from within the terminal on Live-DVD, but now it halts during the process of a normal boot:


systemd-journald [140]: [/etc/systemd/journald.conf: 24] Failed to
[drm:cpt_set_fifo_underrun_reporting]*ERROR* uncleared pch fifo underrun on pch transcoder A
[drm:cpt_serr_int_handler] *ERROR* PCH transcoder A FIFO underrun

… :-(. I also noticed that the boot menu has changed: it does not start automatically after some seconds (I know I can change that in YAST but it let me wonder a bit)

Above boot error messages seem a kernel issue, as far as I googled around, but strange is, that one booting did work normally and the subsequent (after my manually done updates) does not. I did not do any further updates in between. Or maybe the software update that issued the boot failure caused more problems than just the boot stuff.

May be I need to switch to another thread …

Thanks so far.

UPDATE: it boots again.

After digging in systemlogs (problems started at 2016-01-03) …


journalctl --catalog --since 2016-01-03 --output short  > ~/journalctl2016-x_2016-01-03.log

… I saw a lot of hard drive inconsistencies:


kernel: EXT4-fs error (device sda3): ext4_mb_generate_buddy:757: group 145, block bitmap and bg descriptor inconsistent: 6671 vs 6672 free clusters
kernel: JBD2: Spotted dirty metadata buffer (dev = sda3, blocknr = 0). There's a risk of filesystem corruption in case of system crash.

… so I thought, well let’s repair it first, and this eventually helped to let the system boot again, I did:


# start with LiveDVD, open terminal (super-user?)
e2fsck -f /dev/sda3 # force disk check
e2fsckinfo: e2fsck 1.42.12 (29-Aug-2014)
e2fsckinfo: Pass 1: Checking inodes, blocks, and sizes
e2fsckinfo: Running additional passes to resolve blocks claimed by more than one inode...
e2fsckinfo: Pass 1B: Rescanning for multiply-claimed blocks
e2fsckinfo: Multiply-claimed block(s) in inode 132614: 665600
e2fsckinfo: Multiply-claimed block(s) in inode 132617: 665601 665602
e2fsckinfo: Multiply-claimed block(s) in inode 132618: 665603 665604
e2fsckinfo: Multiply-claimed block(s) in inode 132619: 665605 665606
e2fsckinfo: Multiply-claimed block(s) in inode 132620: 665607 665608
e2fsckinfo: Multiply-claimed block(s) in inode 132621: 665609
e2fsckinfo: Multiply-claimed block(s) in inode 132858: 665610
e2fsckinfo: Multiply-claimed block(s) in inode 132864: 665611 665612 665613
e2fsckinfo: Multiply-claimed block(s) in inode 143046: 665600
e2fsckinfo: Multiply-claimed block(s) in inode 143799: 665601 665602
e2fsckinfo: Multiply-claimed block(s) in inode 143816: 665603
e2fsckinfo: Multiply-claimed block(s) in inode 146159: 665604 665605
e2fsckinfo: Multiply-claimed block(s) in inode 146202: 665606 665607 665608 665609
e2fsckinfo: Multiply-claimed block(s) in inode 146620: 665610
e2fsckinfo: Multiply-claimed block(s) in inode 146621: 665611
e2fsckinfo: Multiply-claimed block(s) in inode 148113: 665612 665613
e2fsckinfo: Multiply-claimed block(s) in inode 1188941: 4065648 …]
e2fsckinfo: Pass 1C: Scanning directories for inodes with multiply-claimed blocks
e2fsckinfo: Pass 1D: Reconciling multiply-claimed blocks
e2fsckinfo: (There are 17 inodes containing multiply-claimed blocks.)
e2fsckinfo: File /boot/grub2/x86_64-efi/read.mod (inode #132614, mod time Fri Jan  8 21:07:48 2016)
e2fsckinfo:   has 1 multiply-claimed block(s), shared with 1 file(s):
e2fsckinfo:         /boot/grub2/i386-pc/vga_text.mod (inode #143046, mod time Mon Jan 11 20:41:34 2016)
e2fsckinfo: Clone multiply-claimed blocks<y>? yes
e2fsckinfo: File /boot/grub2/x86_64-efi/terminal.mod (inode #132617, mod time Fri Jan  8 21:07:48 2016)
e2fsckinfo:   has 2 multiply-claimed block(s), shared with 1 file(s):
e2fsckinfo:         /boot/grub2/i386-pc/ufs2.mod (inode #143799, mod time Mon Jan 11 20:41:34 2016)
e2fsckinfo: Clone multiply-claimed blocks<y>? yes
e2fsckinfo: File /boot/grub2/x86_64-efi/search_label.mod (inode #132618, mod time Fri Jan  8 21:07:48 2016)
e2fsckinfo:   has 2 multiply-claimed block(s), shared with 2 file(s):
e2fsckinfo:         /boot/grub2/i386-pc/pata.mod (inode #146159, mod time Mon Jan 11 20:41:35 2016)
e2fsckinfo:         /boot/grub2/i386-pc/chain.mod (inode #143816, mod time Mon Jan 11 20:41:34 2016)
e2fsckinfo: Clone multiply-claimed blocks<y>? yes
e2fsckinfo: File /boot/grub2/x86_64-efi/hfspluscomp.mod (inode #132619, mod time Fri Jan  8 21:07:48 2016)
e2fsckinfo:   has 2 multiply-claimed block(s), shared with 2 file(s):
e2fsckinfo:         /boot/grub2/i386-pc/file.mod (inode #146202, mod time Mon Jan 11 20:41:35 2016)
e2fsckinfo:         /boot/grub2/i386-pc/pata.mod (inode #146159, mod time Mon Jan 11 20:41:35 2016)
e2fsckinfo: Clone multiply-claimed blocks<y>? yes
e2fsckinfo: File /boot/grub2/x86_64-efi/minix3_be.mod (inode #132620, mod time Fri Jan  8 21:07:48 2016)
e2fsckinfo:   has 2 multiply-claimed block(s), shared with 1 file(s):
e2fsckinfo:         /boot/grub2/i386-pc/file.mod (inode #146202, mod time Mon Jan 11 20:41:35 2016)
e2fsckinfo: Clone multiply-claimed blocks<y>? yes
e2fsckinfo: File /boot/grub2/x86_64-efi/password.mod (inode #132621, mod time Fri Jan  8 21:07:48 2016)
e2fsckinfo:   has 1 multiply-claimed block(s), shared with 1 file(s):
e2fsckinfo:         /boot/grub2/i386-pc/file.mod (inode #146202, mod time Mon Jan 11 20:41:35 2016)
e2fsckinfo: Clone multiply-claimed blocks<y>? yes
e2fsckinfo: File /boot/grub2/x86_64-efi/part_dvh.mod (inode #132858, mod time Fri Jan  8 21:07:52 2016)
e2fsckinfo:   has 1 multiply-claimed block(s), shared with 1 file(s):
e2fsckinfo:         /boot/grub2/i386-pc/xnu_uuid_test.mod (inode #146620, mod time Mon Jan 11 20:41:35 2016)
e2fsckinfo: Clone multiply-claimed blocks<y>? yes
e2fsckinfo: File /boot/grub2/x86_64-efi/gettext.mod (inode #132864, mod time Fri Jan  8 21:07:52 2016)
e2fsckinfo:   has 3 multiply-claimed block(s), shared with 2 file(s):
e2fsckinfo:         /boot/grub2/i386-pc/gzio.mod (inode #148113, mod time Mon Jan 11 20:41:35 2016)
e2fsckinfo:         /boot/grub2/i386-pc/cbtime.mod (inode #146621, mod time Mon Jan 11 20:41:35 2016)
e2fsckinfo: Clone multiply-claimed blocks<y>? yes
e2fsckinfo: File /boot/grub2/i386-pc/vga_text.mod (inode #143046, mod time Mon Jan 11 20:41:34 2016)
e2fsckinfo:   has 1 multiply-claimed block(s), shared with 1 file(s):
e2fsckinfo:         /boot/grub2/x86_64-efi/read.mod (inode #132614, mod time Fri Jan  8 21:07:48 2016)
e2fsckinfo: Multiply-claimed blocks already reassigned or cloned.
e2fsckinfo: File /boot/grub2/i386-pc/ufs2.mod (inode #143799, mod time Mon Jan 11 20:41:34 2016)
e2fsckinfo:   has 2 multiply-claimed block(s), shared with 1 file(s):
e2fsckinfo:         /boot/grub2/x86_64-efi/terminal.mod (inode #132617, mod time Fri Jan  8 21:07:48 2016)
e2fsckinfo: Multiply-claimed blocks already reassigned or cloned.
e2fsckinfo: File /boot/grub2/i386-pc/chain.mod (inode #143816, mod time Mon Jan 11 20:41:34 2016)
e2fsckinfo:   has 1 multiply-claimed block(s), shared with 1 file(s):
e2fsckinfo:         /boot/grub2/x86_64-efi/search_label.mod (inode #132618, mod time Fri Jan  8 21:07:48 2016)
e2fsckinfo: Multiply-claimed blocks already reassigned or cloned.
e2fsckinfo: File /boot/grub2/i386-pc/pata.mod (inode #146159, mod time Mon Jan 11 20:41:35 2016)
e2fsckinfo:   has 2 multiply-claimed block(s), shared with 2 file(s):
e2fsckinfo:         /boot/grub2/x86_64-efi/hfspluscomp.mod (inode #132619, mod time Fri Jan  8 21:07:48 2016)
e2fsckinfo:         /boot/grub2/x86_64-efi/search_label.mod (inode #132618, mod time Fri Jan  8 21:07:48 2016)
e2fsckinfo: Multiply-claimed blocks already reassigned or cloned.
e2fsckinfo: File /boot/grub2/i386-pc/file.mod (inode #146202, mod time Mon Jan 11 20:41:35 2016)
e2fsckinfo:   has 4 multiply-claimed block(s), shared with 3 file(s):
e2fsckinfo:         /boot/grub2/x86_64-efi/password.mod (inode #132621, mod time Fri Jan  8 21:07:48 2016)
e2fsckinfo:         /boot/grub2/x86_64-efi/minix3_be.mod (inode #132620, mod time Fri Jan  8 21:07:48 2016)
e2fsckinfo:         /boot/grub2/x86_64-efi/hfspluscomp.mod (inode #132619, mod time Fri Jan  8 21:07:48 2016)
e2fsckinfo: Multiply-claimed blocks already reassigned or cloned.
e2fsckinfo: File /boot/grub2/i386-pc/xnu_uuid_test.mod (inode #146620, mod time Mon Jan 11 20:41:35 2016)
e2fsckinfo:   has 1 multiply-claimed block(s), shared with 1 file(s):
e2fsckinfo:         /boot/grub2/x86_64-efi/part_dvh.mod (inode #132858, mod time Fri Jan  8 21:07:52 2016)
e2fsckinfo: Multiply-claimed blocks already reassigned or cloned.
e2fsckinfo: File /boot/grub2/i386-pc/cbtime.mod (inode #146621, mod time Mon Jan 11 20:41:35 2016)
e2fsckinfo:   has 1 multiply-claimed block(s), shared with 1 file(s):
e2fsckinfo:         /boot/grub2/x86_64-efi/gettext.mod (inode #132864, mod time Fri Jan  8 21:07:52 2016)
e2fsckinfo: Multiply-claimed blocks already reassigned or cloned.
e2fsckinfo: File /boot/grub2/i386-pc/gzio.mod (inode #148113, mod time Mon Jan 11 20:41:35 2016)
e2fsckinfo:   has 2 multiply-claimed block(s), shared with 1 file(s):
e2fsckinfo:         /boot/grub2/x86_64-efi/gettext.mod (inode #132864, mod time Fri Jan  8 21:07:52 2016)
e2fsckinfo: Multiply-claimed blocks already reassigned or cloned.
e2fsckinfo: File /var/log/pbl.log (inode #1188941, mod time Mon Jan 11 20:41:53 2016)
e2fsckinfo:   has 16 multiply-claimed block(s), shared with 0 file(s):
e2fsckinfo: Clone multiply-claimed blocks<y>? yes
e2fsckinfo: Pass 2: Checking directory structure
e2fsckinfo: Entry 'messages20160103.txt' in /var/log (1182255) has deleted/unused inode 1187789.  Clear<y>? yes
e2fsckinfo: Entry '.cache' in /etc/lvm/cache (1189296) has deleted/unused inode 1187786.  Clear<y>? yes
e2fsckinfo: Entry 'chain.mod' in /boot/grub2/x86_64-efi (131916) has deleted/unused inode 131455.  Clear<y>? yes
e2fsckinfo: Entry 'datehook.mod' in /boot/grub2/x86_64-efi (131916) has deleted/unused inode 131573.  Clear<y>? yes
e2fsckinfo: Entry 'ls.mod' in /boot/grub2/x86_64-efi (131916) has deleted/unused inode 131599.  Clear<y>? yes
e2fsckinfo: Entry 'keystatus.mod' in /boot/grub2/x86_64-efi (131916) has deleted/unused inode 131878.  Clear<y>? yes
e2fsckinfo: Entry 'command.lst' in /boot/grub2/x86_64-efi (131916) has deleted/unused inode 133318.  Clear<y>? yes
e2fsckinfo: Entry 'parttool.lst' in /boot/grub2/x86_64-efi (131916) has deleted/unused inode 134900.  Clear<y>? yes
e2fsckinfo: Entry 'modinfo.sh' in /boot/grub2/x86_64-efi (131916) has deleted/unused inode 134907.  Clear<y>? yes
e2fsckinfo: Entry 'mdraid09_be.mod' in /boot/grub2/x86_64-efi (131916) has deleted/unused inode 133123.  Clear<y>? yes
e2fsckinfo: Entry 'part_bsd.mod' in /boot/grub2/x86_64-efi (131916) has deleted/unused inode 133150.  Clear<y>? yes
e2fsckinfo: Entry 'uhci.mod' in /boot/grub2/x86_64-efi (131916) has deleted/unused inode 133194.  Clear<y>? yes
e2fsckinfo: Entry 'fs.lst' in /boot/grub2/x86_64-efi (131916) has deleted/unused inode 134898.  Clear<y>? yes
e2fsckinfo: Entry 'partmap.lst' in /boot/grub2/x86_64-efi (131916) has deleted/unused inode 134899.  Clear<y>? yes
e2fsckinfo: Entry 'video.lst' in /boot/grub2/x86_64-efi (131916) has deleted/unused inode 134902.  Clear<y>? yes
e2fsckinfo: Entry 'crypto.lst' in /boot/grub2/x86_64-efi (131916) has deleted/unused inode 134903.  Clear<y>? yes
e2fsckinfo: Entry 'terminal.lst' in /boot/grub2/x86_64-efi (131916) has deleted/unused inode 134904.  Clear<y>? yes
e2fsckinfo: Pass 3: Checking directory connectivity
e2fsckinfo: Pass 4: Checking reference counts
e2fsckinfo: Unattached inode 135058
e2fsckinfo: Connect to /lost+found<y>? yes
e2fsckinfo: Inode 135058 ref count is 2, should be 1.  Fix<y>? yes
e2fsckinfo: Unattached inode 135062
e2fsckinfo: Connect to /lost+found<y>? yes
e2fsckinfo: Inode 135062 ref count is 2, should be 1.  Fix<y>? yes
e2fsckinfo: Unattached inode 135063
e2fsckinfo: Connect to /lost+found<y>? yes
e2fsckinfo: Inode 135063 ref count is 2, should be 1.  Fix<y>? yes
e2fsckinfo: Unattached inode 135064
e2fsckinfo: Connect to /lost+found<y>? yes
e2fsckinfo: Inode 135064 ref count is 2, should be 1.  Fix<y>? yes
e2fsckinfo: Unattached inode 135291
e2fsckinfo: Connect to /lost+found<y>? yes
e2fsckinfo: Inode 135291 ref count is 2, should be 1.  Fix<y>? yes
e2fsckinfo: Unattached inode 135293
e2fsckinfo: Connect to /lost+found<y>? yes
e2fsckinfo: Inode 135293 ref count is 2, should be 1.  Fix<y>? yes
e2fsckinfo: Unattached inode 135294
e2fsckinfo: Connect to /lost+found<y>? yes
e2fsckinfo: Inode 135294 ref count is 2, should be 1.  Fix<y>? yes
e2fsckinfo: Unattached inode 135297
e2fsckinfo: Connect to /lost+found<y>? yes
e2fsckinfo: Inode 135297 ref count is 2, should be 1.  Fix<y>? yes
e2fsckinfo: Unattached inode 135328
e2fsckinfo: Connect to /lost+found<y>? yes
e2fsckinfo: Inode 135328 ref count is 2, should be 1.  Fix<y>? yes
e2fsckinfo: Inode 394017 ref count is 15, should be 16.  Fix<y>? yes
e2fsckinfo: Unattached inode 1191829
e2fsckinfo: Connect to /lost+found<y>? yes
e2fsckinfo: Inode 1191829 ref count is 2, should be 1.  Fix<y>? yes
e2fsckinfo: Pass 5: Checking group summary information
e2fsckinfo: Block bitmap differences:  …]
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free blocks count wrong for group #0 (10562, counted=10540).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free blocks count wrong for group #1 (2222, counted=2093).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free blocks count wrong for group #2 (13040, counted=12980).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free blocks count wrong for group #3 (22077, counted=21389).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free blocks count wrong for group #14 (9703, counted=10066).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free blocks count wrong for group #17 (876, counted=1588).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free blocks count wrong for group #20 (30714, counted=29745).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free blocks count wrong for group #48 (11018, counted=11013).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free blocks count wrong for group #49 (12002, counted=16523).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free blocks count wrong for group #56 (15861, counted=16126).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free blocks count wrong for group #79 (15388, counted=15448).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free blocks count wrong for group #123 (6208, counted=9940).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free blocks count wrong for group #145 (6673, counted=6710).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free blocks count wrong for group #148 (32157, counted=32158).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free blocks count wrong (2808310, counted=2816128).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Inode bitmap differences:  +135058 +(135062--135064) +135291 +(135293--135294) +135297 +135328
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free inodes count wrong for group #16 (381, counted=372).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free inodes count wrong for group #18 (5903, counted=5904).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free inodes count wrong for group #48 (3372, counted=3365).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Directories count wrong for group #48 (721, counted=726).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free inodes count wrong for group #65 (1, counted=2).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free inodes count wrong for group #145 (856, counted=855).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: Free inodes count wrong (1064329, counted=1064314).
e2fsckinfo: Fix<y>? yes
e2fsckinfo: /dev/sda3: ***** FILE SYSTEM WAS MODIFIED *****
e2fsckinfo: /dev/sda3: 248966/1313280 files (0.3% non-contiguous), 2426752/5242880 blocks

The interesting part was that many difficulties were detected in the directories related to grub2 in /boot.

I wonder how can such inconsistencies on the hard drive happen or be prevented or avoided, perhaps automatically?