Score:0

Ubuntu autoinstall failing when creating partitions

dk flag

I have a problem with autoinstall. The config loads correctly, but when trying to create the partitions it fails. I'm running everything in a virtual machine before testing it on the live system.

My config looks like this:

#cloud-config
autoinstall:
  version: 1
  identity:
    hostname: <redacted>
    password: "<redacted>"
    username: <redacted>
  locale: <redacted>
  keyboard:
    layout: <redacted>
  ssh:
    install-server: true
    authorized-keys:
      - "<redacted>"
    allow-pw: false
  drivers:
    install: true
  timezone: <redacted>
  storage:
    swap:
      size: 0
    config:
      - type: disk
        match: 
          size: smallest
        id: hdd0
        ptable: gpt
        grub_device: true
      - type: partition
        number: 1
        id: boot-part
        device: hdd0
        size: 2G
        flag: boot
      - type: partition
        number: 2
        id: root-part
        device: hdd0
        size: -1
      - type: format
        id: boot-format
        volume: boot-part
        fstype: ext4
        label: BOOT
      - type: format
        id: root-format
        volume: root-part
        fstype: ext4
        label: ROOT
      - type: mount
        id: root-mount
        device: root-format
        path: /
      - type: mount
        id: boot-mount
        device: boot-format
        path: /boot
      - type: disk
        match: 
          size: largest
        id: hdd1
        ptable: gpt
      - type: partition
        number: 1
        id: storage-part
        device: hdd1
        size: 100%
      - type: format
        id: storage-format
        volume: storage-part
        fstype: ext4
        label: STORAGE
      - type: mount
        id: storage-mount
        device: storage-format
        path: /mnt/storage

Here's a screenshot from the crash dump (since I can't copy text from my VM).

Why do sgdisk fail with the message "Could not create partition 1 from 2048 to 4196351"? Is my config bad, or what's causing it to misbehave?

Score:0
cw flag

as I understand the Autoinstall Docs, you should set the size to -1 instead of 100% if you want the partition to fill up the rest of the disk. You did that in the root disk properly, but not in the storage-part Partition

But the error itself looks like your HHD0 is not even 2GB in Size.

Also, you normally have a bios_grub Partition of 1M before your Boot Partition.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.