• 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.
  • 相关阅读:
    【C++面向对象侯捷】10.扩展补充:类模板,函数模板,及其他
    利用Python提取将Excel/PDF文件数据
    双极性SPWM、单极性SPWM和单极倍频SPWM的仿真结果对比
    深度学习系列——“试错”发展直觉
    [附源码]计算机毕业设计springboot居家养老服务系统小程序
    软件工程笔记001
    力扣:90. 子集 II(Python3)
    一文彻底理解什么是同步和异步!
    华为云计算之物理节点CNA安装教程
    [loj3834] [IOI2022] 最罕见的昆虫 - 交互 - 二分
  • 原文地址:https://blog.csdn.net/taoxicun/article/details/126137747