如何修复 lxc launch Failed getting root disk: No root device could be found
问题:
尝试使用类似这样的命令启动 lxc 容器时
fix_lxc_launch.sh
lxc launch ubuntu:22.04 mycontainer你看到以下错误消息:
lxc_launch_error.txt
Creating mycontainer
Error: Failed instance creation: Failed creating instance record: Failed initialising instance: Failed getting root disk: No root device could be found解决方案
你没有正确初始化 LXD 存储。运行
lxd_init.sh
lxd init以配置 lxd 的存储。对于除性能关键型生产设置外的大多数设置,我建议使用 dir 存储后端,因为它不需要任何进一步配置。你可以将所有其他选项保留为默认值。
lxd_init_example.txt
Name of the storage backend to use (zfs, btrfs, ceph, cephobject, dir, lvm) [default=zfs]: dirIf this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow