Centos 8 kickstart partition failure

Issues related to applications and software problems and general support
Post Reply
brianr4k
Posts: 8
Joined: 2017/03/11 01:23:59

Centos 8 kickstart partition failure

Post by brianr4k » 2021/07/23 00:17:23

This is something that has been bothering me for ages. I'm able to do everything I want in a kickstart file EXCEPT create partitions. I keep telling myself this has got to be simple and I'm just missing something obvious.

First, this is for small (20GB) virtual machines only. Do NOT want logical volumes (I have my reasons). These machines do not last: They're created, played with for a couple of weeks and deleted. I have monkeyed around with countless options off and on for many months. Here is the last attempt:

clearpart --linux --drives=sda --initlabel
part /boot --fstype=xfs --asprimary --size=1024
part / --fstype=xfs --asprimary --size=17408 --grow
part swap --recommended --hibernation

My (perhaps erroneous) expectation is that these would be created and the installation would proceed.

In every single case, the install jumps to the GUI with the storage icon taunting, "kickstart insufficient". Wading through the log files is hopeless as there are a couple of thousand lines and I have no clue what I'm looking for or how to interpret it. Although I was a wizard with AT&T System 5 Unix (before you all were born!) I'm pretty much a rookie when it comes to this.

Any suggestions would be greatly appreciated!

Brian

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Centos 8 kickstart partition failure

Post by jlehtone » 2021/07/23 06:52:03

Is the device-name really "sda" in VM?


What I have done is first run one interactive install.
Then, read the kickstart file from the machine; installer saves a copy in /root/.
That copy contains also the choices that were made interactively.
That I used as base for my kickstart files.
Might take some iteration to hone the details.


You don't actually need separate /boot -- the / is not hidden in LV or encrypted volume.


[EDIT] Extract from /root/anaconda-ks.cfg of CentOS Linux 8 system; libvirt/KVM with UEFI and all interactive:

Code: Select all

# Disk partitioning information
part swap --fstype="swap" --ondisk=vda --size=2048
part / --fstype="ext4" --ondisk=vda --size=17830
part /boot/efi --fstype="efi" --ondisk=vda --size=600 --fsoptions="umask=0077,shortname=winnt"

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Centos 8 kickstart partition failure

Post by TrevorH » 2021/07/23 09:57:58

The documentation for --hibernate says it wants to create swap that is the --recommended size plus the size of RAM. For a machine with <= 2GB the recommended size is twice RAM which would mean that it might potentially want to allocate 6GB swap on a machine with 2GB. For one with <= 4GB it wants to add RAM size to recommended swap size which is again the size of RAM so a 4GB VM would want to allocate 8GB swap.

So 17GB + 1GB = 18GB but the swap allocation for a 2GB RAM VM will then add 6GB more to that. Same applies only worse if you have 4GB RAM.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

brianr4k
Posts: 8
Joined: 2017/03/11 01:23:59

Re: Centos 8 kickstart partition failure

Post by brianr4k » 2021/07/24 18:12:57

Thanks, jlehtone. I have done this process many times. Did it another dozen times after your suggestions and figured out my issue.

Seems there is no sane mathematical formula that the installer uses for partition sizes. Or at least none I can determine. For example, a /boot size of 1GB translates to 1,024K every time. But a swap size of 2GB translates to 2,048K sometimes, and 2,079K other times. And no matter what GB size you pick for a root partition, it is generally 2K less that what a GBx1,024 calculation would give you.

That's what was tripping me up: I'd do the math consistently myself, and the installer just didn't like it. Fortunately these are all playtime images so I'll just do fixed disk sizes.

Thanks for the pointers!

Brian

Post Reply