• Why does PXE boot with grub2 and UEFI fails with error “File not found“ ?


    环境

    • Red Hat Enterprise Linux 7
    • Red Hat Enterprise Linux 8

    问题

    Installation of UEFI system using PXE boot with grub2 bootloader grubx64.efi fails with error File not found.

    1. error: ../../grub-core/net/tftp.c:281:File not found.
    2. error: ../../grub-core/loader/i386/efi/linux.c:93:you need to load the kernel first.
    3. Press any key to continue..._

    决议

    This error indicates that the grub bootloader was able to load the grub configuration file but it has not found either the kernel or the initramfs files paths which are defined in it.

    Verify the tree of the tftp home directory which is usually /var/lib/tftpboot to check the path of the kernel and the intramfs files with respect to the tftp home directory.

    1. # tree /var/lib/tftpboot/
    2. /var/lib/tftpboot/
    3. └── uefi
    4. ├── grub.cfg
    5. ├── grubx64.efi
    6. ├── images
    7. │ ├── initrd.img
    8. │ └── vmlinuz
    9. └── shimx64.efi
    10. # ls -lanR uefi/
    11. uefi/:
    12. total 3412
    13. drwxr-xr-x. 3 0 0 74 Jul 28 11:28 .
    14. drwxr-xr-x. 4 0 0 33 Jul 28 11:27 ..
    15. -rw-r--r--. 1 0 0 1503 Jul 28 11:28 grub.cfg
    16. -r-xr-xr-x. 1 0 0 2285512 Jul 28 11:28 grubx64.efi
    17. drwxr-xr-x. 2 0 0 39 Jul 28 11:27 images
    18. -r-xr-xr-x. 1 0 0 1202928 Jul 28 11:28 shimx64.efi
    19. uefi/images:
    20. total 83556
    21. drwxr-xr-x. 2 0 0 39 Jul 28 11:27 .
    22. drwxr-xr-x. 3 0 0 74 Jul 28 11:28 ..
    23. -rw-r--r--. 1 0 0 75530980 Jul 28 11:27 initrd.img
    24. -rwxr-xr-x. 1 0 0 10026352 Jul 28 11:27 vmlinuz

    In the above example the path for vmlinuz file relative to tftp home directory is uefi/images/vmlinuz and the path of the initramfs file with respect to tftp home directory is uefi/images/initrd.img. Setting these appropriate paths grub should be able to find the paths and start the installation.

    1. menuentry 'PXE Install Red Hat Enterprise Linux 8.4' --class fedora --class gnu-linux --class gnu --class os {
    2. linuxefi uefi/images/vmlinuz inst.stage2=http:///
    3. initrdefi uefi/images/initrd.img
    4. }

    根源

    • The grub bootloader for UEFI for UEFI based systems grubx64.efi takes the arguments for filepaths with relative to the tftp home directory.
  • 相关阅读:
    微服务初始和Nacos安装
    Go常见错误第12篇:冗余的嵌套代码
    极智AI | 讲解 TensorRT 显式batch 和 隐式batch
    风景区服务热线系统:智能化时代的旅游新选择
    QML元素定位器:Row、Colum、Grid、Flow、定位器嵌套以及Repeater用法
    【FusionInsight 迁移】HBase从C50迁移到6.5.1(03)6.5.1上准备Loader
    9.8day58 单调栈
    3D建模基础教程:编辑多边形功能命令快捷方式
    背诵不等于理解,深度解析大模型背后的知识储存与提取
    露点温度介绍
  • 原文地址:https://blog.csdn.net/taoxicun/article/details/126137747