首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Ubuntu22.04.1自动安装云-config失败

Ubuntu22.04.1自动安装云-config失败
EN

Ask Ubuntu用户
提问于 2022-10-15 13:47:22
回答 1查看 955关注 0票数 0

我目前有一个问题,通过云-init安装Ubuntu22.04。服务器有两个硬盘。在第二个硬盘上应该有一个/data分区,但目前,安装无法工作。错误消息,有人知道存储配置有什么问题吗?

代码语言:javascript
运行
复制
#cloud-config
autoinstall:
  version: 1
  apt:
    geoip: true
    preserve_sources_list: false
    primary:
    - arches: [amd64, i386]
      uri: http://de.archive.ubuntu.com/ubuntu
    - arches: [default]
      uri: http://ports.ubuntu.com/ubuntu-ports
  users:
  - default
  - name: ubuntu
    passwd: "$6$rmFIz9Pdwb1$jsUGBTC46WkdnwLos4/6TqNnZaEdR7mV/XFfcvsnQXNKqgt.oZ2HTvboeZNP/qcNQXQqKkKnAU5i0Dh4GeAwA0"
    shell: /bin/bash
    lock-passwd: false
    ssh_pwauth: True
    chpasswd: { expire: False }
    sudo: ALL=(ALL) NOPASSWD:ALL
    groups: users, admin
  identity:
    hostname: ubuntu2204
    username: ubuntu
    password: "$6$rmFIz9Pdwb1$jsUGBTC46WkdnwLos4/6TqNnZaEdR7mV/XFfcvsnQXNKqgt.oZ2HTvboeZNP/qcNQXQqKkKnAU5i0Dh4GeAwA0"
  ssh:
    allow-pw: true
    install-server: true
  user-data:
    disable_root: false
    timezone: Europe/Berlin
  locale: de_DE
  keyboard:
    layout: de
  storage:
    config:
      - type: disk
        id: disk0
        grub_device: true
        wipe: superblock
        path: /dev/sda
        ptable: gpt
        match:
          size: largest
      - type: disk
        id: disk1
        path: /dev/sdb
        ptable: gpt
        match:
         size: smallest
      - type: partition
        id: boot-partition
        flag: boot
        device: disk0
        size: 500M
        number: 1
      - type: partition
        id: root-partition
        device: disk0
        number: 2
        size: -1
        wipe: superblock
      - type: partition
        id: data-partition
        number: 1
        device: disk1
        size: -1
      - id: boot-partition-fs
        type: format
        fstype: ext4
        volume: boot-partition
      - id: root-partition-fs
        type: format
        fstype: ext4
        volume: root-partition
      - id: data-partition-fs
        type: format
        fstype: ext4
        volume: data-partition
      - id: boot-partition-fs-mount
        type: mount
        path: /boot
        device: boot-partition-fs
      - id: root-partition-fs-mount
        type: mount
        path: /
        device: root-partition-fs
      - id: data-partition-fs-mount
        type: mount
        path: /data
        device: data-partition-fs
  late-commands:
    - echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu
EN

回答 1

Ask Ubuntu用户

发布于 2022-10-20 23:23:33

根据您的配置,它显示您正在安装到基于BIOS的设备上。我尝试使用您的存储配置,并得到以下错误。要查看此错误消息,我在安装程序环境中打开一个终端并运行journalctl

代码语言:javascript
运行
复制
Stderr: Installing for i386-pc platform.
        grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
        grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
        grub-install: error: will not proceed with blocklists.

错误告诉您,您正在使用GPT布局安装到基于BIOS的设备上,而不是创建一个bios_grub分区。这不管用。

引用https://help.ubuntu.com/community/Grub2/Installing

在GPT ()磁盘上安装GRUB2需要一个推荐大小至少1 MiB的专用BIOS引导分区。..。必须用bios_grub标志标识它。

您可以将其作为第一个分区添加到存储配置中。

代码语言:javascript
运行
复制
      - type: partition
        device: disk0
        size: 4194304
        flag: bios_grub
        number: 14
        preserve: false
        grub_device: false
        id: partition-14
票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1435565

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档