
我正在學習 cloud-config-ish 自動安裝工具次要地位我一直遇到自動安裝有效的問題,但它不會遵循我對該storage:
部分的配置。
這是我的自動安裝設定(使用者名稱、主機名稱、密碼雜湊和 SSH 金鑰除外):
#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
正如您從本節中看到的storage:
,我放入了一些分割區(所有 GPT,此版本中沒有 MBR!):
- FAT32 UEFI 系統分割區位於
/boot/efi
- ext2
/boot
分割區 - 交換分割區
- ZFS 意圖日誌的佔位符分割區(稍後在自動安裝後新增)
- XFS 根分割區
Ubuntu 自動安裝程式似乎通過了驗證,因為我得到了進行自動安裝是/否的信息,它運行了,最後我有了一個安裝了 ZFS 的可啟動系統以及所有內容。但是,它忽略了我的分區方案而只是建立一個 FAT32 EFI 分割區和一個 Ext4 根分割區。誰能告訴我我在這裡做錯了什麼,或是我如何追蹤為什麼它正在驗證,但忽略我的storage:
配置?
答案1
自動安裝文件的文件不是很好
任何一個:
使用佈局:直接並讓它自動嘗試找出您的分區應該是什麼或使用您想要的設定進行配置:部分
如果您在儲存部分中同時進行佈局和配置...它將僅使用佈局並忽略配置部分