我一直在尝试让 Ubuntu 20.04 启动 PXE,并且遇到了与这里的其他人类似的问题。我找到了一些解决方案,包括添加ip=dhcp
到pxelinux.cfg/default
文件中的附加行,但它仍然拒绝启动。我已经包含了错误和我的菜单以供参考。非常感谢任何和所有帮助。
(initramfs) DHCPOFFER of 10.0.0.25 from 10.0.0.1
DHCPREQUEST for 10.0.0.25 on enp0s3 to 255.255.255.255 port 67 (xid=0x6cb408a3)
DHCPACK of 10.0.0.25 from 10.0.0.1 (xid=0xa308b46c)
bound to 10.0.0.25 -- renewal in 2557 seconds.
Begin: Running /scripts/casper-premount ... done
done.
Begin: Trying to netboot from 10.0.0.9:/netboot/ubuntu/20.04/server ... Begin: Trying nfsmount -o nolock -o ro 10.0.0.9:/netboot/ubuntu/20.04/server /cdrom ... done.
Unable to find a live file system on the network.
还有菜单:
default vesamenu.c32
prompt 0
timeout 300
ONTIMEOUT 1
menu title ########## OS Deploy ##########
label 1
menu label ^1) Ubuntu 20.04 Server
kernel ubuntu/20.04/server/casper/vmlinuz
initrd ubuntu/20.04/server/casper/initrd
append ip=dhcp boot=nfs nfsroot=10.0.0.9:/netboot/ubuntu/20.04/server ro nosplash ---
一切似乎都正常工作,直到 initramfs 挂载 nfs 共享(已导出并在网络上可用),此时它尝试挂载但未能挂载。
此外,我可以键入它打印到 stdout 的 nfsmount 命令,它会很好地挂载 nfs 共享,让我可以像我期望的那样浏览共享。
编辑:我已经取得了一些进展。设置 nfsboot=nfs 和 boot=casper 是不正确的。nfsboot
不应该存在,boot=casper
应该存在boot=nfs
。我已经在pxelinux.cfg/default
这里和我的 pxe 引导服务器上编辑了这两个文件。
我现在遇到了一个单独的问题,在 squashfs 中无法安装,如下所示:
[ 6.596619] /root/cdrom/casper/extras/modules.squashfs-generic: Can't open blockdev
mount: mounting /root/cdrom/casper/extras/modules.squashfs-generic on /root/usr/lib/modules failed: Invalid argument
mount: mounting /dev on /root/dev failed: no such file or directory
mount: mounting /dev on /root/dev failed: No such file or directory
done.
mount: mounting /run on /root/run failed: No such file or directory
run-init: can't execute '/sbin/init': No such file or directory
Target filesystem doesn't have requested /sbin/init.
run-init: can't execute '/sbin/init': No such file or directory
run-init: can't execute '/etc/init': No such file or directory
run-init: can't execute '/bin/init': No such file or directory
run-init: can't execute '/bin/sh': No such file or directory
run-init: can't execute '': No such file or directory
No init found. Try passing init= bootarg
从这个日志输出中,我假设作为根本原因的行是读取的行[ 6.596619] /root/cdrom/casper/extras/modules.squashfs-generic: Can't open blockdev
这条线告诉我 squashfs 没有正确安装,这导致了所有其他问题。所以我现在的问题是,如何让 squashfs 正确安装?