• 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.
  • 相关阅读:
    行业案例|指标中台如何助力银行业普惠金融可持续发展
    【8. 4位数码管TM1637】转载记录
    计算机毕业设计ssm+vue基本微信小程序的小学生兴趣延时班预约小程序
    jmeter单接口和多接口测试
    【图像处理与机器视觉】频率域滤波
    shell编程
    【CSS】div 盒子居中的常用方法
    18. “状态变化”模式 之State模式(状态模式)
    【接口测试】JMeter调用JS文件实现RSA加密
    DPO数据保护官 &&CISP-DSG注册数据安全治理专业人员
  • 原文地址:https://blog.csdn.net/taoxicun/article/details/126137747