Re: CentOS 8 Kickstart Questions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Gunnar,

+++ Gunnar Niels [27/05/20 13:39 -0400]:
Hello,

I'm experimenting setting up a home CentOS 8 server with ~7 SATA
drives and would like to be able to insert a pen drive with an iso and
have it automatically install non-interactively. I've been trying to
craft my own iso with an embedded ks file that I've generated, and
I've read the docs but they leave a lot of questions remaining:


Not tested in a while with kickstart, but information could still be
helpful (inline)

[Password Generation]
I'm trying to generate the hashed password to set in the kickstart, ex:

rootpw --iscrypted {{ root_pass_hash }}

I've read from a few sources that this can be generated via python
using the following:

python -c "import crypt; print(crypt.crypt('{{ root_password }}'))"

I'm using: "auth --passalgo=sha256 --useshadow" in my ks file, but in
my testing, the password I hashed is rejected. I'm assuming this is
because of some passalgo mismatch. I've also seen that the "auth"
keyword has been deprecated with RHEL8 (and I assume CentOS 8 as
well). What's the best way for me to generate a password and configure
the auth configuration so that the hash methods match?

If you don't mind on storing it in the kickstart, pregenerate it, or
even put something basic and then reconfigure in %post


[OS Disk Selection]
As mentioned, I will have 7 or 8 drives hooked up. One is a pendrive I
would like to use as the OS disk, and the others will be standard HDDs
over SATA. Inspecting the kickstarts that are generated after I
manually run through the GUI installer, I usually see an "ignoredisk
--only-use=/dev/sdX" statement in the kickstart, but I have no idea
which sdX disk will actually be my pendrive? What is the best practice
here so that I always select the same disk? I've seen some indication
there is a /dev/disk/by-partuuid I could potentially use, but that
would require me to set up partition tables for each of the drives and
therefore generate partuuids ahead of time. Any recommendations?

You can do disk partitioning with a script

Use %pre to define the partitioning, so that you can use your custom
script to find out UID, connection type, size, $whatever, then, include
that file:


#Partitionning
zerombr


%include /tmp/part-include



and then:

%pre
#!/bin/sh

#Remove swapping just in case was in use
swapoff -a
echo "Remove previous LV"
for VG in `LANG=C lvm vgscan 2>&1 |grep "Found volume group"|awk '{print $4}'|tr -d "\""`
do
        lvm lvchange -ff -a n /dev/$VG/*
        lvm vgremove -ff $VG
done
for PV in `LANG=C lvm pvscan 2>&1 |grep PV|awk '{print $2}'`
do
        lvm pvremove -y -ff $PV
done

#Get number of drives and sizes
set $(list-harddrives)
let numd=$#/2 # Número de discos
d1=$1 # First disk device
S1=$2 # Firt disk size

DISK=$d1

echo "clearpart --drives=$DISK --all --initlabel" >> /tmp/part-include

echo "part /boot --fstype ext3 --size=100 --ondisk=$DISK" >> /tmp/part-include
echo "part pv.100000 --size=1 --grow --ondisk=$DISK" >>  /tmp/part-include
echo "volgroup myvg --pesize=32768 pv.100000" >> /tmp/part-include
echo "logvol swap --fstype swap --name=Swap --vgname=myvg --size=2047" >> /tmp/part-include
echo "logvol  / --fstype ext4 --name=root --vgname=myvg --size=2048" >> /tmp/part-include
echo "logvol /home --fstype ext4 --size=1000 --name=home --vgname=myvg" >> /tmp/part-include
echo "logvol /tmp --fstype ext4 --size=2048 --name=tmp --vgname=myvg" >> /tmp/part-include
echo "logvol /usr --fstype ext4 --size=3000 --name=usr --vgname=myvg" >> /tmp/part-include
echo "logvol /opt --fstype ext4 --size=8192 --name=opt --vgname=myvg" >> /tmp/part-include




[graphical vs. text vs. cli?]
For an unattended installation, does it matter which of the above I
actually specify?

Cli, uses less RAM so it starts faster


I will probably have some more questions as I dig into it, but rather
than overwhelm I'll leave my questions at that for now.

Thank you!
GN

_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list

--

Pablo Iranzo Gómez (Pablo.Iranzo@xxxxxxxxxx)          GnuPG: 0x5BD8E1E4
Senior Software Engineer - Solutions Engineering           iranzo @ IRC
RHC{A,SS,DS,VA,E,SA,SP,AOSP}, JBCAA        #110-215-852    RHCA Level V

Blog: https://iranzo.github.io                     https://citellus.org
Telegram: https://t.me/iranzo                   https://t.me/redken_bot

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list

[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux