Server-Autoinstallation und Partitionen

Server-Autoinstallation und Partitionen

Ich lerne das Cloud-Config-ähnliche Autoinstall-Tool kennenUnterordnungund ich stoße immer wieder auf das Problem, dass die automatische Installation zwar funktioniert, aber nicht meiner Konfiguration für den storage:Abschnitt folgt.

Hier ist meine Autoinstall-Konfiguration (mit Ausnahme von Benutzername, Hostname, Passwort-Hash und SSH-Schlüssel):

#cloud-config
autoinstall:
  version: 1
  locale: en_US.UTF-8
  refresh-installer: { update: yes } # Check for updated installer
  storage:
    # ESP + boot + swap + zil placeholder + root
    layout: { name: direct }
    config:
      - type: disk
        match:      # select largest ssd...
          size: largest
          ssd: true
        id: ssd0    # ...and call it ssd0
        ptable: gpt # use gpt partitions on ssd0
        wipe: superblock
      - type: partition # create partitions on ssd0
        number: 1
        id: efi-partition
        device: ssd0
        size: 256M
        flag: boot        # uefi partition needs boot flag
        grub_device: true # and must be the grub device?
      - type: partition
        number: 2
        id: boot-partition
        device: ssd0
        size: 768M
      - type: partition
        number: 3
        id: swap-partition
        device: ssd0
        size: 128G
        flag: swap
      - type: partition
        number: 4
        id: zil-partition
        device: ssd0
        size: 128G
      - type: partition
        number: 5
        id: root-partition
        device: ssd0
        size: 256G
      - type: format # format partitions on ssd0
        id: efi-format
        volume: efi-partition
        fstype: fat32 # ESP gets FAT32
        label: ESP
      - type: format
        id: boot-format
        volume: boot-partition
        fstype: ext4
        label: BOOT
      - type: format
        id: swap-format
        volume: swap-partition
        fstype: swap # swap
        label: SWAP
        flag: swap
      - type: format
        id: root-format
        volume: root-partition
        fstype: xfs # / (root) gets ext4, xfs, btrfs
        label: ROOT
      - type: mount # mount formatted partitions on ssd0
        id: root-mount # / (root) gets mounted first
        device: root-format
        path: /
      - type: mount
        id: boot-mount # /boot gets mounted next
        device: boot-format
        path: /boot
      - type: mount
        id: efi-mount # /boot/efi gets mounted next
        device: efi-format
        path: /boot/efi
  identity:
    hostname: foo
    username: bar
    password: $6$<snip>
  ssh:
    install-server: true
    allow-pw: false
    authorized-keys:
      - ssh-rsa AAAA<snip>
  packages:
    - build-essential
    - git
    - python3-pip
    - tasksel
    - zfsutils-linux

Wie Sie dem storage:Abschnitt entnehmen können, füge ich einige Partitionen ein (alle GPT, kein MBR in diesem Build!):

  • eine FAT32 UEFI Systempartition unter/boot/efi
  • eine ext2- /bootPartition
  • eine Swap-Partition
  • eine Platzhalterpartition für ein ZFS-Intent-Log (wird später nach der automatischen Installation hinzugefügt)
  • eine XFS-Root-Partition

Der Ubuntu-Autoinstaller scheint die Prüfung zu bestehen, da ich die Antwort „Mit Autoinstall fortfahren – Ja/Nein“ erhalte, er ausgeführt wird und ich am Ende ein bootfähiges System mit installiertem ZFS und allem habe.Allerdings ignoriert es mein Partitionsschemaund erstellt stattdessen einfach eine FAT32 EFI-Partition und eine Ext4-Root-Partition. Kann mir jemand sagen, was ich hier falsch mache oder wie ich es herausfinden kann?WarumEs validiert, ignoriert aber meine storage:Konfiguration?

Antwort1

Die Dokumentation für die Autoinstall-Datei ist nicht besonders gut

ENTWEDER:

Verwenden Sie layout: direct und lassen Sie es automatisch versuchen, herauszufinden, wie Ihre Partitionierung aussehen soll, ODER erstellen Sie einen config:-Abschnitt mit Ihrem gewünschten Setup

Wenn Sie sowohl Layout als auch Konfiguration im Speicherbereich vornehmen, wird nur das Layout verwendet und der Konfigurationsbereich ignoriert.

verwandte Informationen