How to force kickstart to automatically install to hard drive device

Latest response

We are attempting to create a custom RHEL7.9 ISO that automates the installation on our servers. All the servers are Lenovo ST250's. The intention is to have no user input when the kickstarted installation runs -- just put the install DVD in the drive, boot, and walk away -- so it needs to automatically determine the device to install to. The issue is that we currently accomplish this by telling the kickstart to install to sda (ignoredisk --only-use=sda), and sda seems to randomly bounce between the hard disk and the tape drive in these machines, so the load randomly fails. The fact that this happens is well documented, but we don't know a way around it.

How can we, in a totally automated way, ensure in our kickstart that we are installing to the one and only hard drive in the machine, and not some other storage device like a tape drive?

Responses

If the tape drive relies on a kernel module, suppressing the module load should prevent it from appearing as /dev/sda or /dev/sdb. Of course, this wouldn't account for any additional drives that happen to be plugged in (note that, depending on the kickstart, ignoredisk --only-use=sda has the potential to wipe out devices such as USB drives).

If the kernel module can indeed be handled using an installer boot arg, a %post script may be needed to fix the GRUB2 (or extlinux) config file to ensure the module isn't excluded from the installed system.

If the hard drive is always in the same slot, you can have it look for disk/by-path/pci-0000:..... instead of /dev/sda. I ended up having to do this for similar reasons. The line would be: ignoredisk --only-use=disk/by-path/pci-0000:.... You'll have to look at ones you've already set up to determine the right pci path name.