0

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

PC2

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?

gertz
  • 3
  • 1

1 Answers1

0

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

%pre

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

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

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

%end
thrig
  • 1,676
  • 11
  • 9