Skip to content

Conversation

@jinkkkang
Copy link

Recently, I encountered some issues with GRUB boot failure on Linux systems. Upon investigation, it was found that the ext4 fs of the system was abnormal, causing the ext2 module of GRUB to read empty file contents. Therefore, a verification of file size was added

error: ../../grub-core/loader/i386/pc/linux.c:170:invalid magic number.
error :
../../grub-core/loader/i386/pc/linux.c:418:you need to load the kernel
first.

grub> hexdump /boot/vmlinuz-5.10.134-17.2.a18.x86_64
grub>
grub> cat /boot/vmlinuz-5.10.134-17.2 a18 x86_64
grub>

Verifying the file size in advance may make it easier to identify the true cause of the problem

@lsandov1
Copy link
Contributor

@jinkkkang this is a good fix. Make sure you include the log with and without this patch so we can see the benefit.

Do you mind sending this to upstream GRUB and to Fedora dist-git repository?

Let me know if need help.

@jinkkkang
Copy link
Author

@jinkkkang this is a good fix. Make sure you include the log with and without this patch so we can see the benefit.

Hi, Leonardo,Thank you for your reply,I don't have the log for this patch, and I can't install the grub with the patch into the system, because as soon as the kernel mounts this partition, it will automatically fix fs issue.

 kernel: EXT4-fs (vde1): mounted filesystem with ordered data mode. Opts: (null)
 kernel: EXT4-fs (vde1): recovery complete
 kernel: EXT4-fs (vde1): 102 orphan inodes deleted
 kernel: EXT4-fs warning (device vdd1): htree_dirblock_to_tree:1045: inode #2: lblock 0: comm bash: error -5 reading directory block
 kernel: EXT4-fs warning (device vdd1): htree_dirblock_to_tree:1045: inode #2: lblock 0: comm bash: error -5 reading directory block

The log without this patch is as follows

error: ../../grub-core/loader/i386/pc/linux.c:170:invalid magic number.
error :
../../grub-core/loader/i386/pc/linux.c:418:you need to load the kernel
first.
grub>

Do you mind sending this to upstream GRUB and to Fedora dist-git repository?
Let me know if need help.

I have no experience submitting code to the grub upstream. I have tried to look up relevant email configurations, etc. If you have any guidance on this, could you please send it to me? I would be very grateful. Is there more information about the Fedora dist-git repository? I am not familiar with it, including how to submit code to it. deeply grateful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants