Hey I have what I hope is a quick question. I’m building a kickstart file, and am a little confused with how to configure the disk. I know I need
ignoredisk --only-use=disk/by-path/pci-0000:00:1f.2-ata-1
zerombr
clearpart --all --initlabel --drives=disk/by-path/pci-0000:00:1f.2-ata-1 --disklabel gpt
but I’m looking to use UEFI which, according to RH kickstart generator, “Cannot be used with automatic partitioning at the same time” - so I can’t use reqpart?
Is the following sufficient for the boot, swap, and volume partitions and then two logical volumes (for home and everything else)?
part /boot/efi --fstype="efi" --size=512
part /boot --fstype="ext4" --size=512
part swap --hibernation --fstype=swap
part pv.01 --size=1 --grow
volgroup VolGroup00 pv.01
logvol /home --fstype ext4 --name=home --vgname=VolGroup00 --size=10240
logvol / --fstype ext4 --name=rootsys --vgname=VolGroup00 --size=10240 --grow
Do I need the line bootloader --location=? If so is it bootloader --location=gpt rather than mbr?
Full file is provided here for reference.
kickstart.ks
# ============================================================================
# AlmaLinux 10.2 — "minimal" profile — palanaeum (Supermicro X10SLM+-F)
#
# Security posture:
# * root account locked (no password, no login) — `rootpw --lock`
# * one admin user in wheel, SSH public-key only, password locked
# * sshd: no root login, no password auth (drop-in below)
# * SELinux enforcing, firewalld on, only ssh open until Ansible runs
#
# ============================================================================
# System language
lang en_CA.UTF-8
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# Time
timezone America/Edmonton --utc
timesource --ntp-server=time.nrc.ca
timesource --ntp-server=time.chu.nrc.ca
# No GUI Installer and do not configure the X Window System
text
skipx
# Reboot after install, disable the Setup Agent on first boot
reboot
firstboot --disable
# ---- Network -----------------------------------------------------------------
network --activate --device=0c:c4:7a:4b:3d:4e --hostname=palanaeum.lan --bootproto=static --ip=10.0.1.3 --netmask=255.255.255.128 --gateway=10.0.1.1 --nameserver=10.0.1.1 --onboot=on
network --activate --device=0c:c4:7a:4b:3d:4f --hostname=palanaeum-storage.lan --bootproto=static --ip=10.0.1.4 --netmask=255.255.255.128 --gateway=10.0.1.1 --nameserver=10.0.1.1 --onboot=on
# ---- Storage -----------------------------------------------------------------
# The X10SLM+-F chipset (C224) SATA controller is PCI 0000:00:1f.2; the SSD is
# on port 1.
ignoredisk --only-use=disk/by-path/pci-0000:00:1f.2-ata-1
# This command is required when performing an unattended installation on a system with previously
# initialized disks.
zerombr
# Clear all partitions and set as gpt
clearpart --all --drives=disk/by-path/pci-0000:00:1f.2-ata-1 --disklabel gpt
part /boot/efi --fstype="efi" --size=512
part /boot --fstype="ext4" --size=512
part swap --hibernation --fstype=swap
part pv.01 --size=1 --grow
volgroup VolGroup00 pv.01
logvol /home --fstype ext4 --name=home --vgname=VolGroup00 --size=10240
logvol / --fstype ext4 --name=rootsys --vgname=VolGroup00 --size=10240 --grow
bootloader --location=mbr
# ---- Security ----------------------------------------------------------------
# lock root user
rootpw --lock
# Admin user: password locked => key-only over SSH.
user --name=philip --groups=wheel --lock --gecos="Philip"
sshkey --username=philip "ssh-ed25519 {KEY} philip@palanaeum"
# Start SELinux and firewalld
selinux --enforcing
firewall --enabled --ssh
services --enabled=sshd,chronyd,NetworkManager,firewalld,cockpit.socket
# ---- Packages ----------------------------------------------------------------
# add base repositories with mirrors
repo --name="almalinux10-baseos" --mirrorlist="https://mirrors.almalinux.org/mirrorlist/10/baseos"
repo --name="almalinux10-appstream" --mirrorlist="https://mirrors.almalinux.org/mirrorlist/10/appstream"
# add epel repo (10.2 not default 10.3 which is ahead of distro) with mirrors
repo --name="epel10-everything" --mirrorlist="https://mirrors.fedoraproject.org/mirrorlist?repo=epel-10.2&arch=x86_64"
# add CRB with mirrors
repo --name="CRB" --mirrorlist="https://mirrors.almalinux.org/mirrorlist/10/crb/"
# Other repos
repo --name=rpmfusion-free --mirrorlist="https://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-44&arch=x86_64"
repo --name=rpmfusion-free-updates --mirrorlist="https://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-updates-released-44&arch=x86_64" --cost=0
repo --name=rpmfusion-nonfree --mirrorlist="https://mirrors.rpmfusion.org/mirrorlist?repo=nonfree-fedora-44&arch=x86_64"
repo --name=rpmfusion-nonfree-updates --mirrorlist="https://mirrors.rpmfusion.org/mirrorlist?repo=nonfree-fedora-updates-released-44&arch=x86_64" --cost=0
%packages --ignoremissing
@^minimal-environment
@headless-management
python3
git-core
tar
chrony
tuned
ipmitool
smartmontools
lm_sensors
%end
# Disable kdump by default, frees up some memory
%addon com_redhat_kdump --disable
%end
# ---- Post --------------------------------------------------------------------
%post --log=/root/ks-post.log
set -euxo pipefail
# sshd hardening drop-in (Ansible manages the same file afterwards).
cat > /etc/ssh/sshd_config.d/50-homelab.conf <<'SSHD'
PermitRootLogin no
PasswordAuthentication no
KbdInteractiveAuthentication no
ChallengeResponseAuthentication no
PubkeyAuthentication yes
PermitEmptyPasswords no
X11Forwarding no
AllowAgentForwarding no
AllowTcpForwarding yes
MaxAuthTries 4
LoginGraceTime 30
ClientAliveInterval 300
ClientAliveCountMax 2
AllowGroups wheel
SSHD
chmod 0600 /etc/ssh/sshd_config.d/50-homelab.conf
# Console auto-login and getty on the IPMI serial console for emergencies only.
systemctl enable serial-getty@ttyS1.service || true
# Tuned profile for a storage server.
systemctl enable tuned
tuned-adm profile throughput-performance || true
# Marker for Ansible.
install -d /etc/homelab
echo "kickstart=palanaeum.ks $(date -Is)" > /etc/homelab/provisioned
%end