Kickstart clearpart --initlabel

I’m confused about the --initlabel option for the clearpart command in kickstart.

Pykickstart documentation says (source):

Initializes the disk label to the default for your architecture. This is only meaningful in combination with the ‘–all’ option.

RHEL documentation says (source):

Initializes a disk (or disks) by creating a default disk label for all disks in their respective architecture that have been designated for formatting. Because --initlabel can see all disks, it is important to ensure only those drives that are to be formatted are connected. Disks cleared by clearpart will have the label created even in case the --initlabel is not used.

By default I’ve been using “–all --initlabel --disklabel=gpt”. And until now my setup was always that everything could get formated en re-initialised so I never had to think about that.

But now I have a case where there is a sdc disk that should remain untouched while I freshly re-install AlmaLinux on sda and sdb.

So I’m changing the --all to --drives=sda,sdb but I’m not sure that the --initlabel will not touch my sdc? And should I still add --initlabel, because the pykickstart documentation says I should only use it with --all?

Can you be interactive during install?

I have often removed/commented out all partitioning instructions from kickstart. That forces the installer to ask when run.

Didn’t think about that yet, but sounds like a good idea in these edge cases where you don’t want to take any risks. Thanks @jlehtone !

Still want to learn the ins and outs about that clearpart command, so hopefully someone can educate me :nerd_face:

ignoredisk --only-use=sda

additionally add the ignoredisk statement

You surely know that the installer does always store the made choices into /root/anaconda-ks.cfg, so you can check how it did record your kickstart&interactive things?

Thanks a lot everyone for all the suggestions!