Ubuntu 22.04 cloud-config 自动安装配置不适用于文件系统

Ubuntu 22.04 cloud-config 自动安装配置不适用于文件系统

在 Ubuntu 22.04 下,我尝试使用以下内容进行自动安装,但它一直说“自动安装配置没有创建所需的引导加载程序分区”。

 2024-04-16 00:25:19,018 DEBUG subiquity.models.subiquity:256 model mirror for install stage is configured, to go {'filesystem'}
 2024-04-16 00:25:19,018 DEBUG root:30 start: subiquity/Filesystem/apply_autoinstall_config:
 2024-04-16 00:25:19,019 DEBUG root:30 start: subiquity/Filesystem/apply_autoinstall_config/convert_autoinstall_config:
 2024-04-16 00:25:19,021 DEBUG root:30 finish: subiquity/Filesystem/apply_autoinstall_config/convert_autoinstall_config: SUCCESS:
 2024-04-16 00:25:19,022 ERROR root:30 finish: subiquity/Filesystem/apply_autoinstall_config: FAIL: autoinstall config did not create needed bootloader partition
 2024-04-16 00:25:19,022 ERROR root:30 finish: subiquity/apply_autoinstall_config: FAIL: autoinstall config did not create needed bootloader partition
 2024-04-16 00:25:19,023 ERROR subiquity.server.server:415 top level error
 Traceback (most recent call last):
   File "/snap/subiquity/5495/lib/python3.10/site-packages/subiquity/server/server.py", line 696, in start
     await self.apply_autoinstall_config()
   File "/snap/subiquity/5495/lib/python3.10/site-packages/subiquitycore/context.py", line 149, in decorated_async
     return await meth(self, **kw)
   File "/snap/subiquity/5495/lib/python3.10/site-packages/subiquity/server/server.py", line 466, in apply_autoinstall_config
     await controller.apply_autoinstall_config()
   File "/snap/subiquity/5495/lib/python3.10/site-packages/subiquitycore/context.py", line 149, in decorated_async
     return await meth(self, **kw)
   File "/snap/subiquity/5495/lib/python3.10/site-packages/subiquity/server/controllers/filesystem.py", line 496, in apply_autoinstall_config
     raise Exception(
 Exception: autoinstall config did not create needed bootloader partition

我需要做什么才能安装 UEFI 引导加载程序?

storage:
    config:
    - { ptable: gpt, path: /dev/sda, wipe: superblock-recursive, preserve: false, grub_device: true, type: disk, id: disk-sda }
    - { type: partition, wipe: superblock, preserve: false, number: 1, device: disk-sda, flag: boot, size: 1074M, id: partition-0 }
    - { type: format, fstype: fat32, volume: partition-0, id: format-0 }
    - { type: mount, path: /boot/efi, device: format-0, id: mount-0 }
    - { type: disk, path: /dev/sdb, wipe: superblock, preserve: false, grub_device: false, id: disk-sdb }
    - { type: lvm_volgroup, name: vg00, devices: [disk-sdb], id: lvm_volgroup-0 }
    - { type: lvm_partition, volgroup: lvm_volgroup-0, name: lvroot, size: 500G, id: lvm_partition-0 }
    - { type: format, fstype: ext4, volume: lvm_partition-0, id: format-2 }
    - { type: mount, path: /, device: format-2, id: mount-2 }
    - { type: lvm_partition, volgroup: lvm_volgroup-0, name: lvvar, size: 50G, id: lvm_partition-1 }
    - { type: format, fstype: ext4, volume: lvm_partition-1, id: format-3 }
    - { type: mount, path: /var, device: format-3, id: mount-3 }
    - { type: lvm_partition, volgroup: lvm_volgroup-0, name: lvsnap, size: 50G, id: lvm_partition-2 }
    - { type: format, fstype: ext4, volume: lvm_partition-2, id: format-4 }
    - { type: mount, path: /snap, device: format-4, id: mount-4 }

答案1

我知道这听起来很奇怪,而且 ubuntu自动安装文档也不科廷文档提到这一点,但您需要添加grub_device: true到 EFI 分区。flag: boot仅此而已是不够的。如果我grub_device: true从自己的用户数据文件中删除,我会得到与您相同的错误。

storage:
  config:
  - { ptable: gpt, path: /dev/sda, wipe: superblock-recursive, preserve: false, grub_device: true, type: disk, id: disk-sda }
  - id: partition-0
    type: partition
    size: 1074M
    flag: boot
    device: disk-sda
    number: 1
    wipe: superblock
    preserve: false
    grub_device: true
  - etc...

相关内容