Hi I wrote the kickstart file for centos 7. It works great but in some machines because of partitioning 2 disk drives which should be determined like sda and sdb I have issues USB boot drive is overridden and interrupt the installation.

example: PC1

installation is disk loaded like :
sda - crutial 1TB
sdb - crutial 2TB
sdc - USB boot drive

kickstart want format a parted sda and sdb and successfully instaled


instalation is disk loaded like :
sda - USB boot drive
sdb - crutial 1TB
sdc - crutial 2TB

kickstart wants format a parted sda, sdb, and kickstart formatted boot drive 

Is here any possibility of how to exclude a USB drive from partitioning?

1 Answer 1


One way to solve this is to network boot (PXE); this lowers the odds of a stray USB device complicating the disk layout. However, sda sdb are not stable and may change around (or not be present) at the whims of the BIOS or who knows what, even if a USB device is not present.

Another, more complicated, way is to build the kickstart configuration from within the kickstart configuration by means of a %pre script; the output of the script is %include-ed into the configuration:

%include /tmp/ks-custom


function commify { local IFS=,; echo "$*"; }

# figure out what disks to use
declare -a drives
pushd /sys/block
test -e sda && for x in sd*
    # TODO determine if disk is usable, if so put on drives array

# emit kickstart configuration
if ((${#drives[@]})); then
    cat <<EOF >>/tmp/ks-custom
ignoredisk --only-use=$(commify ${drives[@]})
# TODO other kickstart partition commands, if need be

  • Thank you unfortunately I cant use PXE, I will try %pre script
    – gertz
    Commented Jul 28, 2022 at 7:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .