You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu PXE启动报错:无法找到包含live文件系统的介质

Ubuntu PXE启动报错:无法找到包含live文件系统的介质

你这个问题我之前帮朋友排查过,核心原因是Ubuntu的Minimal Server是基于Live环境启动的,它需要明确知道去哪里加载filesystem.squashfs这个核心文件系统镜像,而你当前的PXE配置里没有指定这个路径,系统自然找不到;反观Debian的网络安装是直接从远程仓库拉取安装文件,不需要依赖本地的Live镜像,所以能正常启动。

下面给你两种可行的解决办法,选你顺手的来:

第一步:先确认Ubuntu镜像文件完整

首先得把Ubuntu Server Minimal ISO里的完整内容准备好,别只拷了vmlinuz和initrd:

  1. 把你的Ubuntu ISO文件挂载到服务器上:
    sudo mount -o loop /path/to/ubuntu-server-minimal.iso /mnt/ubuntu-live
    
  2. 把挂载后的casper目录内容复制到tftpboot对应路径,确保/tftpboot/ubuntu/casper/下有filesystem.squashfs这个文件:
    sudo cp -r /mnt/ubuntu-live/casper/* /tftpboot/ubuntu/casper/
    
  3. 卸载挂载点:
    sudo umount /mnt/ubuntu-live
    

方案一:用NFS共享Live镜像(推荐,速度稳定)

NFS是Linux环境下常用的文件共享方式,适合传输大文件:

  1. 先安装NFS服务:
    sudo apt install nfs-kernel-server
    
  2. 创建一个目录存放完整的Ubuntu Live内容:
    sudo mkdir -p /srv/nfs/ubuntu
    sudo cp -r /mnt/ubuntu-live/* /srv/nfs/ubuntu/
    
  3. 配置NFS共享,编辑/etc/exports文件,添加一行:
    /srv/nfs/ubuntu  192.168.1.0/24(ro,sync,no_subtree_check)
    
    这里的192.168.1.0/24换成你的局域网网段更安全;如果想允许所有客户端访问,就用*代替。
  4. 重启NFS服务让配置生效:
    sudo systemctl restart nfs-kernel-server
    
  5. 修改你的PXE配置文件/tftpboot/pxelinux.cfg/default,更新Ubuntu的启动参数:
    LABEL Ubuntu Server Minimal
        MENU LABEL Ubuntu
        KERNEL ubuntu/casper/vmlinuz
        APPEND vga=788 initrd=ubuntu/casper/initrd netboot=nfs nfsroot=<你的服务器IP>:/srv/nfs/ubuntu ip=dhcp
    
    把<你的服务器IP>换成你PXE服务器的实际IP地址。

方案二:用HTTP共享Live镜像(配置简单)

如果不想折腾NFS,用HTTP也可以:

  1. 安装Apache服务(Nginx也行,步骤类似):
    sudo apt install apache2
    
  2. 在Apache的网页根目录创建Ubuntu共享目录:
    sudo mkdir -p /var/www/html/ubuntu
    sudo cp -r /mnt/ubuntu-live/* /var/www/html/ubuntu/
    
  3. 确保Apache服务正常运行:
    sudo systemctl start apache2
    
  4. 修改PXE配置的Ubuntu部分:
    LABEL Ubuntu Server Minimal
        MENU LABEL Ubuntu
        KERNEL ubuntu/casper/vmlinuz
        APPEND vga=788 initrd=ubuntu/casper/initrd netboot=http http://<你的服务器IP>/ubuntu/ ip=dhcp
    

最后要注意的小细节

  • 检查服务器防火墙:NFS需要开放111、2049端口,HTTP开放80端口,TFTP开放69端口,确保客户端能访问这些服务;
  • 测试的时候可以在客户端ping一下服务器IP,确认网络连通性。

备注:内容来源于stack exchange,提问作者Clay2905

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.16 02:53:05