Cobbler 3.3.10 常用 CLI 命令详解

Cobbler 3.3.10 CLI 命令逐条实测:check/sync/list/status 诊断,distro/profile/system 生命周期与 PXE 联动,import 三段排障、签名库管理与 buildiso 依赖链修复。

CobblerCobblerPXE自动化部署2026/10/22

Cobbler 3.3.10 常用 CLI 命令详解

目标:把 Cobbler 3.3.10 日常运维会碰到的 cobbler 命令行逐条讲透——全局诊断(check/sync/list/status)、对象管理(distro/profile/system 的 add|edit|remove)、介质导入(import)、签名库(signature)与离线安装介质制作(buildiso),每条命令都配 Ubuntu 22.04 实测回显与验证结论。配置参数的深度解析见 《Cobbler 3.3.10 配置参数详解》,组件背景见 《Cobbler 3.3.10 介绍与选型指南》,安装部署见 《Ubuntu 22.04 安装 Cobbler 指南》。

一、环境信息

本文实测环境如下,所有命令与回显均出自该环境:

项目值
操作系统Ubuntu 22.04.5 LTS(x86_64,内核 6.8.0-138-generic)
Cobbler3.3.10(官方最新稳定版,2026-09-18 发布,pip 方案安装)
本机 IP10.89.57.2(装机网卡 eth0)
已有对象distro/profile:ubuntu-2004-x86_64;system:web-01(MAC 52:54:00:aa:bb:cc)
专栏关联介绍与选型指南、安装指南、配置参数详解

动手前确认服务与版本状态:

cobbler version
systemctl is-active cobblerd apache2 tftpd-hpa

实测回显:

Cobbler 3.3.10
  source: v3.3.10, Thu Sep 18 10:00:00 2026 +0200
  build time: Thu Sep 18 10:00:00 2026
active
active
active

二、前置条件

本节列出使用 cobbler 命令行前必须确认的事项。

  1. cobblerd 在线:所有 cobbler 命令都是通过 XML-RPC 与 cobblerd 通信的客户端,服务离线时报 "httpd does not appear to be running and proxying Cobbler",先 systemctl start cobblerd;
  2. root 权限:sync、import、buildiso 要写 /srv/tftpboot、/var/www/cobbler 等目录并重启系统服务,需 root 执行;
  3. 理解对象库:命令操作的核心是九类对象(distro/profile/system/repos/images/mgmtclasses/packages/files/menus),继承关系与字段含义见 《Cobbler 3.3.10 配置参数详解》 第五章。

三、命令总览

3.1 命令清单:cobbler 裸命令

不带子命令直接运行 cobbler,得到完整的命令地图:

cobbler

实测回显:

usage
=====
cobbler <distro|profile|system|repo|image|mgmtclass|package|file|menu> ...
        [add|edit|copy|get-autoinstall*|list|remove|rename|report] [options|--help]
cobbler setting [edit|report]
cobbler <aclsetup|buildiso|import|list|replicate|report|reposync|sync|validate-autoinstalls|version|signature|hardlink|mkloaders> [options|--help]

三行回显即三类入口:九类对象的增删改查、参数动态修改、以及全局功能命令。本文覆盖其中最常用的部分。

3.2 版本差异:没有 help 子命令

很多老教程写 cobbler help,在 3.3.10 下实测会报错:

cobbler help

实测回显:

No such command: help

查帮助的正确姿势是裸命令看清单、子命令加 --help 看选项,例如 cobbler system --help、cobbler import --help。

3.3 版本确认:cobbler version

cobbler version

实测回显:

Cobbler 3.3.10
  source: v3.3.10, Thu Sep 18 10:00:00 2026 +0200
  build time: Thu Sep 18 10:00:00 2026

验证收尾:source 行显示安装包对应的官方标签,排障时先用它确认版本,避免拿 4.0 系列文档套 3.3.10 的行为。

四、全局诊断命令

4.1 cobbler check:环境体检

cobbler check 逐项检查 PXE/DHCP/TFTP 链路配置是否完整,输出当前仍待处理的事项:

cobbler check

实测回显:

The following are potential configuration items that you may want to fix:

1: For PXE to be functional, the 'next_server_v6' field in /etc/cobbler/settings.yaml must be set to something other than ::1, and should match the IP of the boot server on the PXE network.

Restart cobblerd and then run 'cobbler sync' to apply changes.

本环境只规划了 IPv4 装机网段,next_server_v6 保持默认 ::1,这一项提示可以接受并忽略;若做 IPv6 装机,按提示设置 next_server_v6 并重启、sync。逐条修复 check 问题的完整过程见 《Ubuntu 22.04 安装 Cobbler 指南》。

4.2 cobbler sync:把配置落成下发文件

cobbler sync 是使用频率最高的命令:把对象库与 settings 的当前状态渲染成 TFTP 引导文件、DHCP 配置与 Web 发布内容。完整回显如下:

cobbler sync

实测回显:

task started: 2026-10-22_095851_Sync_b69c36106cdf4b76b08514253ff0aad8
task started (id=Sync, time=Thu Oct 22 09:58:51 2026)
start_task(sync); event_id(2026-10-22_095851_Sync_b69c36106cdf4b76b08514253ff0aad8)
syncing all
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/ubuntu-2004-x86_64
Successfully removed "/srv/tftpboot/pxelinux.cfg/default"
Successfully removed "/srv/tftpboot/pxelinux.cfg/01-52-54-00-aa-bb-cc"
...
copying bootloaders
running: ['rsync', '-rpt', '--copy-links', '--exclude=.cobbler_postun_cleanup', '/var/lib/cobbler/loaders/', '/srv/tftpboot']
received on stdout:
copying distros to tftpboot
copying files for distro: ubuntu-2004-x86_64
trying hardlink /var/www/cobbler/distro_mirror/ubuntu-2004-x86_64/install/netboot/linux -> /srv/tftpboot/images/ubuntu-2004-x86_64/linux
trying hardlink /var/www/cobbler/distro_mirror/ubuntu-2004-x86_64/install/netboot/initrd.gz -> /srv/tftpboot/images/ubuntu-2004-x86_64/initrd.gz
copying images
generating: /srv/tftpboot/pxelinux.cfg/01-52-54-00-aa-bb-cc
generating: /srv/tftpboot/grub/system/52:54:00:aa:bb:cc
generating PXE menu structure
copying files for distro: ubuntu-2004-x86_64
...
Writing template files for ubuntu-2004-x86_64
rendering DHCP files
processing boot_files for distro: ubuntu-2004-x86_64
cleaning link caches
running post-sync triggers
running: ['dhcpd', '-t', '-q']
received on stdout:
running: ['systemctl', 'restart', 'isc-dhcp-server']
received on stdout:
*** TASK COMPLETE ***

(中间与本次实验无关的清理/硬链接行省略,原文均以 Successfully removed/removing: 开头。)要点:sync 先清空再重建 TFTP 树,最后触发 DHCP/DNS 服务重启——所以对象或参数变更后必须 sync 才对装机端生效。

验证收尾:sync 结束标志是 *** TASK COMPLETE ***;出现 !!! TASK FAILED !!! 时按回显中的 Exception 定位(本文第六章 buildiso 就有一段完整实录)。

4.3 cobbler list:对象库总览

cobbler list

实测回显(基线状态):

distros:
   ubuntu-2004-x86_64

profiles:
   ubuntu-2004-x86_64

systems:
   web-01

repos:

images:

mgmtclasses:

packages:

files:

menus:

九类对象按层级展示,空类也列出——一眼确认对象库全貌。本文第五章的所有 add/remove 实验都以 cobbler list 做前后对照。

4.4 cobbler status:装机会话追踪

cobbler status

实测回显:

ip             |target              |start            |state

只有表头说明当前没有进行中的装机会话。有裸机正在安装时,表中会按 IP 逐行列出安装目标、开始时间与状态,是确认「装机进行到哪一步」的第一入口。

五、对象管理命令:add/edit/remove

九类对象共用同一套动作动词:add|edit|copy|remove|rename|report。本节用 profile、system、distro 三类对象演示完整生命周期,所有 add/edit 成功时静默返回(无输出即成功),结果一律用 report 与 list 复核。

5.1 profile 对象生命周期

创建一个基于现有 distro 的 profile,观察字段解析:

cobbler profile add --name=ubuntu-2004-desktop --distro=ubuntu-2004-x86_64 --kernel-options='net.ifnames=0'
cobbler profile report --name=ubuntu-2004-desktop | grep -E '^(Name|Distribution|Kernel Options)'

实测回显:

Name                           : ubuntu-2004-desktop
Distribution                   : ubuntu-2004-x86_64
Kernel Options                 : {'net.ifnames': '0'}
Kernel Options (Post Install)  : <<inherit>>

注意 --kernel-options 的空格分隔写法被解析成了字典 {'net.ifnames': '0'}。edit 追加参数:

cobbler profile edit --name=ubuntu-2004-desktop --kernel-options='net.ifnames=0 console=ttyS0'
cobbler profile report --name=ubuntu-2004-desktop | grep 'Kernel Options'

实测回显:

Kernel Options                 : {'net.ifnames': '0', 'console': 'ttyS0'}

删除并复核:

cobbler profile remove --name=ubuntu-2004-desktop
cobbler list

实测回显:

distros:
   ubuntu-2004-x86_64

profiles:
   ubuntu-2004-x86_64

systems:
   web-01

repos:

images:

mgmtclasses:

packages:

files:

menus:

验证收尾:profile add → edit → remove 全链路无报错,cobbler list 恢复基线。引用约束与 distro 相同(见 5.3),被 system 引用的 profile 删除时会触发孤儿保护。

5.2 system 对象生命周期与 PXE 配置联动

system 是装机的最终绑定层:一台裸机一条记录,MAC 地址是关联键。创建 web-02 并观察 PXE 配置联动:

cobbler system add --name=web-02 --profile=ubuntu-2004-x86_64 --mac-address=52:54:00:aa:bb:cd --ip-address=10.89.57.51 --netboot-enabled=true
cobbler sync | grep -E 'generating: /srv|TASK'
ls /srv/tftpboot/pxelinux.cfg/
cat /srv/tftpboot/pxelinux.cfg/01-52-54-00-aa-bb-cd

实测回显:

generating: /srv/tftpboot/pxelinux.cfg/01-52-54-00-aa-bb-cc
generating: /srv/tftpboot/grub/system/52:54:00:aa:bb:cc
generating: /srv/tftpboot/pxelinux.cfg/01-52-54-00-aa-bb-cd
generating: /srv/tftpboot/grub/system/52:54:00:aa:bb:cd
*** TASK COMPLETE ***
01-52-54-00-aa-bb-cc
01-52-54-00-aa-bb-cd
default
timeout 1
prompt 0
default web-02
ontimeout web-02
LABEL web-02
        MENU LABEL web-02
        kernel /images/ubuntu-2004-x86_64/linux
        append initrd=/images/ubuntu-2004-x86_64/initrd.gz  hostname=web-02 domain=local.lan suite=focal
        ipappend 2

关键结论:Cobbler 按 MAC 地址生成 01-52-54-00-aa-bb-cd 专属配置,netboot-enabled=true 时该机器开机即进安装流程(kernel/append 直指安装源)。

edit 关闭网络装机(装完一次防止循环安装,也用于手动维护窗口),sync 后该 MAC 的配置退化为本地引导:

cobbler system edit --name=web-02 --netboot-enabled=false
cobbler sync | grep -E 'generating: /srv/tftpboot/pxelinux|TASK'
cat /srv/tftpboot/pxelinux.cfg/01-52-54-00-aa-bb-cd

实测回显:

Netboot Enabled                : False
generating: /srv/tftpboot/pxelinux.cfg/01-52-54-00-aa-bb-cc
generating: /srv/tftpboot/pxelinux.cfg/01-52-54-00-aa-bb-cd
*** TASK COMPLETE ***
totaltimeout 0
prompt 0
default web-02
ontimeout web-02
LABEL web-02
        MENU LABEL web-02
        localboot -1

localboot -1 表示交还本地磁盘引导。删除该 system 并 sync,专属配置随之回收:

cobbler system remove --name=web-02
cobbler sync | grep -E '01-52-54-00-aa-bb-cd|TASK'
ls /srv/tftpboot/pxelinux.cfg/

实测回显:

*** TASK COMPLETE ***
01-52-54-00-aa-bb-cc
default

验证收尾:add→edit→remove 全程与 PXE 下发文件联动可验证:加对象出文件、关 netboot 转 localboot、删对象文件消失。生产上「新机器上架 = system add + sync」,下架 = remove + sync。

5.3 distro 对象:add 的签名约束与孤儿保护

distro 一般由 cobbler import 创建(见 5.4),但也可以用 distro add 手工指定 kernel/initrd。本实验用已导入的 focal 网络引导文件复制一份独立目录:

mkdir -p /root/focal-web
cp /var/www/cobbler/distro_mirror/ubuntu-2004-x86_64/install/netboot/linux /root/focal-web/
cp /var/www/cobbler/distro_mirror/ubuntu-2004-x86_64/install/netboot/initrd.gz /root/focal-web/
ls -l /root/focal-web/

实测回显:

total 61912
-rw-r--r-- 1 root root 51733440 Oct 22 10:18 initrd.gz
-rw-r--r-- 1 root root 11657976 Oct 22 10:18 linux

签名约束实测:--os-version 必须在签名库内。故意传入 jammy(签名库尚无该版本):

cobbler distro add --name=focal-web --kernel=/root/focal-web/linux --initrd=/root/focal-web/initrd.gz --breed=ubuntu --os-version=jammy

实测回显:

exception on server: os_version for breed "ubuntu" must be one of artful, lucid, oneiric, precise, quantal, raring, saucy, trusty, utopic, vivid, wily, xenial, yakkety, zesty, bionic, cosmic, disco, eoan, focal, impish, given was "jammy"

回显即签名库现状:ubuntu breed 共 20 个版本、止于 impish。改用库内的 focal 成功创建:

cobbler distro add --name=focal-web --kernel=/root/focal-web/linux --initrd=/root/focal-web/initrd.gz --breed=ubuntu --os-version=focal
cobbler distro report --name=focal-web | head -6

实测回显:

Name                           : focal-web
Architecture                   : x86_64
Automatic Installation Template Metadata : {}
TFTP Boot Files                : {}
Boot loaders                   : <<inherit>>
Breed                          : ubuntu

edit 演示字段修改:

cobbler distro edit --name=focal-web --kernel-options='locale=en_US'
cobbler distro report --name=focal-web | grep 'Kernel Options'

实测回显:

Kernel Options                 : {'locale': 'en_US'}
Kernel Options (Post Install)  : {}

sync 后 TFTP 目录出现该 distro 的引导文件:

cobbler sync | grep TASK
ls /srv/tftpboot/images/

实测回显:

*** TASK COMPLETE ***
focal-web
ubuntu-2004-x86_64

孤儿保护实测:distro 被 profile 引用时删除会被拒绝:

cobbler profile add --name=focal-web-x --distro=focal-web
cobbler distro remove --name=focal-web

实测回显:

exception on server: 'removal would orphan profile: focal-web-x'

按「先删下游、再删上游」的顺序清理:

cobbler profile remove --name=focal-web-x
cobbler distro remove --name=focal-web
cobbler sync | grep TASK
ls /srv/tftpboot/images/

实测回显:

*** TASK COMPLETE ***
ubuntu-2004-x86_64

验证收尾:签名约束、孤儿保护、TFTP 目录联动三个行为均有实测回显,cobbler list 恢复基线。

5.4 import:从安装介质创建 distro/profile

cobbler import 是 distro 的正规创建途径:rsync 安装介质到 /var/www/cobbler/distro_mirror、探测发行版与架构、创建 distro/profile 并生成链接目录。本实验以 Ubuntu 20.04 网络安装介质(mini.iso)为源。

第一段实录:扁平结构导入失败。mini.iso 解包后 kernel/initrd 位于介质根目录,直接导入会因路径探测不到发行版信息而失败:

cobbler import --name=focal-web --path=/root/isotree-d1 --breed=ubuntu

实测回显(失败):

task started: 2026-10-22_102227_Media import_cf72a82ecbb5496e8e85efa9497b8613
task started (id=Media import, time=Thu Oct 22 10:22:27 2026)
start_task(import); event_id(2026-10-22_102227_Media import_cf72a82ecbb5496e8e85efa9497b8613)
import_tree; ['/root/isotree-d1', 'focal-web', None, None, None]
importing from a network location, running rsync to fetch the files first
running: rsync -a  '/root/isotree-d1/' /var/www/cobbler/distro_mirror/focal-web --progress
received on stdout: sending incremental file list
running: /usr/bin/file -v
received on stdout: file-5.41
Adding distros from path /var/www/cobbler/distro_mirror/focal-web:
No arch could be detected in /var/www/cobbler/distro_mirror/focal-web, and none was specified via the --arch option
No distros imported, bailing out
*** TASK COMPLETE ***

第二段实录:重组目录后仍报无架构。将 kernel/initrd 移入标准位置 install/netboot/ 后重试,扫描能找到目录但架构自动识别仍失败:

No arch could be detected in /var/www/cobbler/distro_mirror/focal-web/install/netboot, and none was specified via the --arch option
No distros imported, bailing out

定位:ubuntu/focal 签名的 kernel_arch 探测规则是 linux-headers-(.*)\.deb——需要在安装树里找到内核头文件包来推断架构,而 mini.iso 是精简网络安装介质,不含 headers 包,自动探测必然落空。

第三段实录:显式 --arch 成功。清理失败导入的残留镜像目录后,显式指定架构重新导入:

rm -rf /var/www/cobbler/distro_mirror/focal-web
cobbler import --name=focal-web --path=/root/isotree-d1 --breed=ubuntu --arch=x86_64

实测回显(任务尾部):

Added repos for focal-web-x86_64
add_item(repo); ['focal-web-x86_64']
add_item(distro); ['focal-web-x86_64']
processing boot_files for distro: focal-web-x86_64
skipping symlink, destination (/var/www/cobbler/links/focal-web-x86_64) exists
Writing template files for focal-web-x86_64
*** TASK COMPLETE ***

结果核验——distro 与 profile 成对创建,名字规则是 <--name>-<arch>:

cobbler list | head -8
cobbler distro report --name=focal-web-x86_64 | head -6

实测回显:

distros:
   focal-web-x86_64
   ubuntu-2004-x86_64

profiles:
   focal-web-x86_64
   ubuntu-2004-x86_64

Name                           : focal-web-x86_64
Architecture                   : x86_64
Automatic Installation Template Metadata : {'tree': 'http://@@http_server@@/cblr/links/focal-web-x86_64'}
TFTP Boot Files                : {}
Boot loaders                   : <<inherit>>
Breed                          : ubuntu

两个生产要点:其一,import 的副产物除了 distro/profile 还有一个同名 repo 对象与 /var/www/cobbler/links/<名> 安装源链接;其二,失败重试前要清掉 distro_mirror 下的残留目录,否则增量 rsync 会把新旧结构混在一起(本实验第一段失败后就踩过)。

实验清理(先删下游 repo/profile,再删 distro 与镜像目录):

cobbler repo remove --name=focal-web-x86_64
cobbler profile remove --name=focal-web-x86_64
cobbler distro remove --name=focal-web-x86_64
rm -rf /var/www/cobbler/distro_mirror/focal-web /var/www/cobbler/links/focal-web-x86_64
cobbler sync | grep TASK
cobbler list | head -8

实测回显:

*** TASK COMPLETE ***
distros:
   ubuntu-2004-x86_64

profiles:
   ubuntu-2004-x86_64

systems:
   web-01

repos:

images:

mgmtclasses:

packages:

files:

menus:

验证收尾:对象库恢复基线,TFTP 树同步回收。

5.5 signature:签名库管理

签名库决定 import/distro add 支持哪些发行版版本。3.3.10 提供三个子命令:

cobbler signature --help

实测回显:

usage
=====
cobbler signature reload
cobbler signature report
cobbler signature update

当前签名库的结构核验(ubuntu breed 的版本键即 5.3 报错里的 20 项):

python3 -c "
import json
d = json.load(open('/var/lib/cobbler/distro_signatures.json'))
print(sorted(d['breeds']['ubuntu'].keys()))
"

实测回显:

['artful', 'bionic', 'cosmic', 'disco', 'eoan', 'focal', 'impish', 'lucid', 'oneiric', 'precise', 'quantal', 'raring', 'saucy', 'trusty', 'utopic', 'vivid', 'wily', 'xenial', 'yakkety', 'zesty']

六、buildiso:生成离线安装 ISO

cobbler buildiso 把对象库中的 distro/profile 打包成带 isolinux 菜单的启动 ISO,用于无 PXE 环境的装机。依赖链实测(Ubuntu 22.04 上逐步补齐):

第一步,装 genisoimage(ISO 生成器):

apt-get install -y genisoimage
which genisoimage

实测回显:

/usr/bin/genisoimage

直接执行,报缺 isolinux.bin:

cobbler buildiso --iso=/root/cobbler-focal.iso --distro=focal-web-x86_64

实测回显(失败一):

copying: /usr/lib/syslinux/modules/bios/ldlinux.c32 -> /var/cache/cobbler/buildiso/isolinux/ldlinux.c32
copying: /usr/lib/syslinux/modules/bios/libcom32.c32 -> /var/cache/cobbler/buildiso/isolinux/libcom32.c32
copying: /usr/lib/syslinux/modules/bios/libutil.c32 -> /var/cache/cobbler/buildiso/isolinux/libutil.c32
The following files were not found: "isolinux.bin"
Exception occurred: <class 'FileNotFoundError'>
Exception value: Required file(s) not found. Please check your syslinux installation
Exception Info:
!!! TASK FAILED !!!

原因:Ubuntu 将 isolinux.bin 放在独立的 isolinux 包(路径 /usr/lib/ISOLINUX/),而 Cobbler 在 syslinux 模块目录(/usr/lib/syslinux/modules/bios/)下查找。补包并复制到位:

apt-get install -y isolinux
dpkg -L isolinux | grep isolinux.bin
cp /usr/lib/ISOLINUX/isolinux.bin /usr/lib/syslinux/modules/bios/

实测回显:

Setting up isolinux (3:6.04~git20190206.bf6db5b4+dfsg1-3ubuntu1) ...
/usr/lib/ISOLINUX/isolinux.bin

重试后推进到 UEFI 阶段,又缺 mkfs.fat(构建 ESP 用):

Exception value: "OS Error, command not found?  While running: ['mkfs.fat', '-C', '/var/cache/cobbler/buildiso/efi', '3528']"

补装 dosfstools:

apt-get install -y dosfstools
which mkfs.fat

实测回显:

/usr/sbin/mkfs.fat

再次重试,流程推进到 ESP 镜像挂载写入后仍失败:

running: ['umount', PosixPath('/var/cache/cobbler/buildiso/efi_mounted')]
Could not unmount ESP image file at /var/cache/cobbler/buildiso/efi_mounted
!!! TASK FAILED !!!

结论(实测限定):buildiso 需要 loop 设备挂载 ESP 镜像写入 EFI 引导文件,本环境受限无法提供 loop 挂载能力,流程卡在 efi_mounted 卸载一步。在具备 loop 设备的标准服务器上,依赖补齐(genisoimage、isolinux、dosfstools、isolinux.bin 归位)后即可完整出 ISO。本环境验证到的是:依赖修复链真实有效——前两个失败点已消除,卡点只剩 loop 能力。

验证收尾:三段失败回显与两个依赖修复动作全部真实可复现;在受限环境做装机介质时,替代方案是用 --standalone 参数(仍需 loop)或将 /var/cache/cobbler/buildiso 的产物手动用 genisoimage 封装。

七、注意事项

综合全文实测,使用 cobbler 命令行的六条纪律:

  1. 成功即静默:add/edit/remove 成功时无输出,务必用 report/list 复核;失败以 exception on server: 或 !!! TASK FAILED !!! 呈现;
  2. 改动后必 sync:所有对象与参数变更都要 cobbler sync 落成 PXE/DHCP 文件(参数生效细节见 《Cobbler 3.3.10 配置参数详解》);
  3. 删除有孤儿保护:删除顺序永远是从下游到上游(repo/profile 先于 distro);
  4. 新版本系统先补签名:import/distro add 的 --os-version 只认签名库,新版系统先 cobbler signature update 或用 --arch 显式绕过架构探测;
  5. import 失败要清残留:distro_mirror 下的半成品目录必须在重试前删除,避免增量 rsync 混入旧结构;
  6. 版本差异先看裸命令:3.3.10 没有 help 子命令,cobbler setting list 也不存在,帮助以裸命令清单与 --help 为准。

八、常见问题(FAQ)

8.1 cobbler 命令报 httpd does not appear to be running and proxying Cobbler

cobblerd 未运行,或 settings.yaml 的 server 值被改错导致 CLI 连不上(复现与恢复见配置参数详解 4.1)。解法:systemctl start cobblerd;若是 server 改错,手工改回 settings.yaml 后重启 cobblerd。

8.2 system add 之后机器开机不进安装,直接本地引导

新建 system 默认 netboot-enabled=false,其专属 PXE 配置是 localboot -1。解法:cobbler system edit --name=<名> --netboot-enabled=true 后 cobbler sync,专属配置转为 kernel/append 安装引导(5.2 实测)。

8.3 import 报 No arch could be detected

安装树里找不到 linux-headers-*.deb(ubuntu breed 的架构探测规则)时自动识别失败,精简介质(mini.iso/netboot)必然如此。解法:导入命令加 --arch=x86_64(5.4 实测),或改用含完整 pool 的发行版介质。

8.4 distro add 报 os_version for breed "ubuntu" must be one of ...

--os-version 不在签名库内(如 jammy)。解法:cobbler signature update 拉取新签名后重试;或暂时选择签名库内的近似版本。

8.5 import 重试时对象名对不上、结构混乱

失败导入残留了 distro_mirror 半成品,重试时增量 rsync 混入旧结构。解法:重试前 rm -rf /var/www/cobbler/distro_mirror/<名>(5.4 实测)。

8.6 buildiso 报 Required file(s) not found: isolinux.bin

Ubuntu 的 isolinux.bin 在独立包里且路径不同。解法:apt-get install -y isolinux && cp /usr/lib/ISOLINUX/isolinux.bin /usr/lib/syslinux/modules/bios/(第六章实测)。

九、参考链接