Rocky Linux 8 custom ISO install from USB consistently brings up dracut emergency shell

Hello,

I will confess that I’m not even sure this is the best place to post such a question, and I’m also probably in over my head :slight_smile: If this is the completely wrong place to ask this question please point me in the right direction.

I am trying to create custom bootable Rocky Linux ISO’s that pre-packages software we create, amongst others. I am able to install beautifully on VirtualBox (which simulates a CD install I believe). On a Dell r640 using a USB install (that I burn using rufus in DD mode), kickstart runs just fine with no errors that I can tell. The issue arises after kickstart reboots the system at the end - the server is dropped into an emergency shell because it can’t find the device by uuid (from an fstab file kickstart generates).

Interestingly, when I do ‘ls /dev/disk’, there is no ‘by-uuid’ directory like I would expect! It’s as if it refuses to see the virtual drive that I have set up on the dell.

This happens with either UEFI or BIOS. Just to see if this might be a hardware issue, I tried the same install to another Dell r640, to the same effect, so I think hardware problems are not likely. Because of this, I feel like I am missing something in the kickstart that would allow this to work… I just have no idea what it is I need to do.

Here is the kickstart - some irrelevant sections have been omitted

#Use text mode install
text
# Do not configure any X Window system
skipx

# System and Language settings
lang en_US.UTF-8
keyboard us
timezone UTC

# Security settings
selinux --enforcing

firewall --enabled --ssh --http --port=123:udp --port=443:tcp --port=8080:tcp --port=8443:tcp --port=8140:tcp

rootpw --iscrypted <REDACT>
logging --level=info

#reboot after installation and eject media
reboot --eject


%include /tmp/ks_include

%packages
@core
-cockpit
chrony
puppet-agent
git-core
jq
yq
traceroute
dnf-automatic
tcpdump
grub2-efi-x64
bc
dos2unix
tuna
tuned
tuned-profiles-realtime
pciutils
jemalloc
%end

%pre --log=/root/ks-pre.log
set -x

#!/bin/sh

# Check for potential USB drive installation
install_drive=$(grep /run/install/repo /proc/mounts | awk '{print $1}' | sed -r -n 's/.*\/([a-z]+)[0-9]*$/\1/p')
if [ -z "$install_drive" ]; then
  install_drive=" "
fi

#Need to accomodate up to 2 drives
#But not the usb :)
drives=( $( list-harddrives | grep -v "^$install_drive" | sort -n -k2 | awk '{ print $1 }' ) )

largest_drive="${drives[${#drives[@]}-1]}"
os_drive="${largest_drive}"
data_directory="/opt/data"
data_partition=''

clearpart="clearpart --drives='${os_drive}' --initlabel --all"

if [[ "1" -lt "${#drives[@]}" ]]; then
  os_drive="${drives[${#drives[@]}-2]}"
  clearpart="clearpart --drives='${os_drive},${largest_drive}' --initlabel --all"
  data_partition="part ${data_directory} --fstype ext4 --size=1024 --grow --ondisk='${largest_drive}' --label=DATA"
fi

#Detect if this is a USB install
efi_portion=''
if [ -d /sys/firmware/efi ] ; then
  efi_portion="part /boot/efi --fstype=efi --grow --maxsize=200 --size=20 --ondisk='${os_drive}'"
fi

file=/tmp/ks_include

cat << EOF > $file

bootloader --location=mbr --driveorder="${os_drive}"

${clearpart}
zerombr
${efi_portion}
part /boot --fstype ext3 --label=BOOT --size=1024 --ondisk="${os_drive}" --asprimary
part swap --recommended --label=SWAP --ondisk="${os_drive}" --asprimary
part / --fstype ext4 --label=ROOT --size=1024 --grow --ondisk="${os_drive}" --asprimary
${data_partition}

EOF

%end

# ------------------ NO CHROOT
%post --interpreter='/usr/bin/sh' --erroronfail --nochroot

# -------- FILE TRANSFER
cp --verbose --force --recursive /run/install/repo/files/* /mnt/sysimage

%end

Again, this works flawlessly on Virtualbox, but not a USB install. I feel like I am overlooking obvious but it eludes me. Anyone have ideas?

Big thanks!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.