1

Goal:

Install OS onto smallest available drive, using EFI, and using LVM

Problem:

Currently get a fatal error early in partitioning validation due to not creating needed bootloader partition

I've been poring over the documentation for AutoInstall & Curtin, as well as doing a lot of web searches for example cases, but so far I've had no luck getting the following partitioning to work.

Each time I try, I end up with an early fatal failure in the build due to the error message:

Error Message:

autoinstall config did not create needed bootloader partition

AutoInstall/Curtin partitioning code

  storage:
    config:
      - type: disk                   # Always install OS on our smallest disk
        match:
          size: smallest
        id: os-drive
        ptable: gpt
        wipe: superblock-recursive
        preserve: false
        name: ''
        grub_device: false
      - type: partition             # EFI partition /boot/efi
        number: 1
        id: efi-partition
        device: os-drive
        size: 256M
        flag: boot
        grub_device: true
      - type: format                # EFI partition format rules
        id: efi-format
        volume: efi-partition
        fstype: fat32
        label: ESP
      - path: /boot/efi             # EFI partition mount rules
        device: efi-format
        type: mount
        id: mount-efi
      - type: partition             # BOOT partition /boot
        number: 2
        id: boot-partition
        device: os-drive
        size: 1G
        grub_device: false
      - type: format                # BOOT partition format rules  
        id: boot-format
        volume: boot-partition
        fstype: ext4
        label: BOOT
      - path: /boot                 # BOOT partition mount rules
        device: boot-format
        type: mount
        id: mount-boot
      - type: partition             # LVM partition (PV)
        number: 3
        id: lvm-partition
        device: os-drive
        size: -1
        grub_device: false
      - name: system                # LVM VG (system)
        devices:
        - lvm-partition
        preserve: false
        type: lvm_volgroup
        id: lvm_volgroup-0
      - name: root                  # LVM LV (root)
        volgroup: lvm_volgroup-0
        size: 16G
        wipe: superblock
        preserve: false
        type: lvm_partition
        id: lvm_partition-root
      - fstype: xfs                 # LVM LV root - format rules
        volume: lvm_partition-root
        preserve: false
        type: format
        id: format-root
      - path: /                     # LVM LV root - mount rules
        device: format-root
        type: mount
        id: mount-root
    swap:
      swap: 0
  version: 1
  • Your config worked for me with the Ubuntu 22.04 server installer on a EFI based machine, but gives that error on a BIOS based machine. Are you certain you are installing on an EFI based target? The preferred way to confirm is to open a shell in the installer and check if `/sys/firmware/efi` exists. – Andrew Lowther Jul 22 '22 at 21:48

1 Answers1

1

In case anyone else lands here looking for a solution to this problem, here it is.

In order to pass the "needs bootloader partition" check, you must have one of the following present in your user-data storage section:

BIOS

  • A storage definition of type "disk" with grub_device: true

UEFI

  • A storage definition of type "partition" with grub_device: true
  • A filesystem defined for the above definition (typically fat32)
  • A definition of type "mount" for the above definition with a path of '/boot/efi'
C. Taylor
  • 111
  • 2