Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
Vaardigheden in dit hoofdstuk
- RHEL installeren met de hand en met een Kickstart-bestand
Plan the installation
Decide the basics before you boot the installer. Then the installation is fast and the result fits its job.
| Question | Typical answer for a server |
|---|---|
| Installation image | The DVD/full ISO (works offline) or the boot ISO (gets packages from the network) |
| Hardware | 2 CPUs, 2 GiB RAM or more, 20 GiB disk or more; UEFI firmware |
| Software | Minimal Install or Server (no desktop) |
| Disk layout | Automatic LVM, or /boot + LVM with /, /var, /home, swap |
| Network | Fixed address and host name for servers |
| Accounts | root locked, one admin user in wheel with an SSH key |
| Registration | Activation key, so updates work at once |
Install interactively with Anaconda
Anaconda shows an Installation Summary hub. Every item with a warning sign must be done before Begin Installation works.
- Boot from the ISO and choose Install Red Hat Enterprise Linux 10.
- Choose the language.
- In the summary, set:
- Installation Destination: the disk, and Automatic or Custom partitioning.
- Network & Host Name: turn the card on, set the host name, and (with Configure…) a fixed address.
- Software Selection: for example Minimal Install.
- Time & Date: the time zone, NTP on.
- Root Account: lock it, or set a strong password.
- User Creation: an admin user, with Add administrative privileges (puts the user in
wheel). - Connect to Red Hat: register with an account or an activation key.
- Click Begin Installation, wait, then Reboot System.
After the first boot, check the system:
Notitie
Anaconda writes the answers of this installation into /root/anaconda-ks.cfg. It is the best start for your own Kickstart file.
Read a Kickstart file
A Kickstart file has commands (one per line), then sections that start with % and end with %end.
# --- installation source and basics ---
text
lang en_US.UTF-8
keyboard --vckeymap=us
timezone Asia/Riyadh --utc
network --bootproto=static --device=enp1s0 --ip=192.168.122.30 --netmask=255.255.255.0 --gateway=192.168.122.1 --nameserver=192.168.122.1 --hostname=web1.example.com --activate
rhsm --organization=12345678 --activation-key=web-servers
# --- accounts ---
rootpw --lock
user --name=admin --groups=wheel --iscrypted --password=$6$rounds=4096$Xy1...$k3...
sshkey --username=admin "ssh-ed25519 AAAAC3Nza...k9 admin@laptop"
# --- disks ---
ignoredisk --only-use=vda
zerombr
clearpart --all --initlabel
autopart --type=lvm
# --- security and services ---
selinux --enforcing
firewall --enabled --service=ssh,http
services --enabled=chronyd,httpd
reboot
%packages
@^minimal-environment
httpd
vim-enhanced
-cockpit
%end
%post --log=/root/ks-post.log
echo "Installed by Kickstart on $(date +%F)" > /etc/motd
%end| Part | What it does |
|---|---|
text | Run the installer in text mode (no graphics) |
network … | Address, host name; --activate uses it already during the installation |
rhsm | Register with an activation key during the installation |
rootpw --lock / user … / sshkey … | Accounts and SSH keys |
ignoredisk, zerombr, clearpart, autopart | Use only vda, wipe it, make an automatic LVM layout |
%packages | Package groups (@^environment, @group), packages, -name to leave one out |
%pre / %post | Shell scripts before / after the installation |
reboot | Reboot at the end without asking |
Make a password hash for --iscrypted:
openssl passwd -6
Password:
$6$Xy1...$k3...Let op
A Kickstart file with clearpart --all wipes the disk without asking. Use ignoredisk --only-use= so it never touches other disks.
Lay out the disks yourself
Instead of autopart, list every partition and logical volume with sizes.
zerombr
clearpart --all --initlabel --drives=vda
part /boot/efi --fstype=efi --size=600
part /boot --fstype=xfs --size=1024
part pv.01 --size=1 --grow
volgroup rhel pv.01
logvol / --vgname=rhel --name=root --fstype=xfs --size=10240
logvol /var --vgname=rhel --name=var --fstype=xfs --size=4096
logvol swap --vgname=rhel --name=swap --size=2048--grow makes the partition use all free space. Sizes are in MiB.
Check the file before you use it
ksvalidator (package pykickstart) finds syntax errors in seconds — much faster than a failed installation.
dnf install pykickstart
ksvalidator ks-web.cfg
ksvalidator -v RHEL10 ks-web.cfg
ksverdiff -f RHEL9 -t RHEL10ksverdiff lists the Kickstart commands that changed between two versions.
Op het werk
Red Hat also offers a Kickstart Generator web tool on the Customer Portal, and the Hybrid Cloud Console can build installation images with your settings inside.
Start an installation with Kickstart
Put the file on a web server (or the ISO, or a USB stick) and tell the installer where it is with the boot option inst.ks=.
dnf install httpd
cp ks-web.cfg /var/www/html/
restorecon -v /var/www/html/ks-web.cfg
systemctl enable --now httpd
firewall-cmd --add-service=http --permanent ; firewall-cmd --reload
curl -s http://192.168.122.1/ks-web.cfg | head -3At the boot menu of the ISO, press e (UEFI) or Tab (BIOS) and add:
inst.ks=http://192.168.122.1/ks-web.cfgFor a virtual machine, virt-install can do it all in one command:
virt-install --name web1 --memory 2048 --vcpus 2 --disk size=20 \
--location /var/lib/libvirt/images/rhel-10.0-x86_64-dvd.iso \
--os-variant rhel10.0 --network network=default \
--initrd-inject /root/ks-web.cfg --extra-args "inst.ks=file:/ks-web.cfg console=ttyS0" \
--graphics none| Source of the file | Boot option |
|---|---|
| Web server | inst.ks=http://server/path/ks.cfg |
| NFS | inst.ks=nfs:server:/path/ks.cfg |
| Disk / USB with a label | inst.ks=hd:LABEL=KS:/ks.cfg |
| Injected into the initrd | inst.ks=file:/ks.cfg |