Use first local disk in Kickstart

Latest response

Hi all,
Is there any option to force Kickstart installation on first local disk?

BR

Responses

I found the below:

%pre
#!/bin/sh
FirstDrive=`ls /dev/disk/by-path/*-scsi*:0 | grep -v usb`
echo "$FirstDrive"
echo "bootloader --location=mbr --boot-drive=$FirstDrive" > /tmp/part-include
echo "# Partition clearing information" >> /tmp/part-include
echo "clearpart --all --initlabel" >> /tmp/part-include
echo "# Disk partitioning information" >> /tmp/part-include
echo "part / --fstype xfs --ondisk=$FirstDrive --size=40960" >> /tmp/part-include
echo "part /boot --fstype xfs --ondisk=$FirstDrive --size=512" >> /tmp/part-include
echo "part /var --fstype xfs --ondisk=$FirstDrive --size=20480" >> /tmp/part-include
echo "part /u01 --fstype xfs --ondisk=$FirstDrive --size=170357" >> /tmp/part-include
echo "part /tmp --fstype xfs --ondisk=$FirstDrive --size=20480" >> /tmp/part-include
echo "part swap --fstype swap --ondisk=$FirstDrive --size=32768" >> /tmp/part-include
echo "part /boot/efi --fstype efi --ondisk=$FirstDrive --size=512 --fsoptions umask=0077,shortname=winnt" >> /tmp/part-include
%end
%include /tmp/part-include

If there is any better solution?

I think you can do:

ignoredisk --only-use=disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0

For most situations, using only "ignoredisk --only-use=sda" should work though but it's worth testing out. Example kickstart:

ignoredisk --only-use=disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0

# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'

# System language
lang en_US.UTF-8

# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0
# Partition clearing information
clearpart --all --initlabel --drives=disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0
# Disk partitioning information
part / --fstype="ext4" --ondisk=disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0 --size=2048 --grow