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

**URL:** <https://forums.rockylinux.org/t/rocky-linux-8-custom-iso-install-from-usb-consistently-brings-up-dracut-emergency-shell/13292>\
**Category:** Rocky Linux Help & Support\
**Tags:** dell, rocky-linux-8\
**Created:** [March 21, 2024, 8:27pm UTC](https://forums.rockylinux.org/t/rocky-linux-8-custom-iso-install-from-usb-consistently-brings-up-dracut-emergency-shell/13292 "2024-03-21T20:27:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhbigler](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jhbigler](https://forums.rockylinux.org/u/jhbigler)\
**Post date:** [March 21, 2024, 8:27pm UTC](https://forums.rockylinux.org/t/rocky-linux-8-custom-iso-install-from-usb-consistently-brings-up-dracut-emergency-shell/13292/1 "2024-03-21T20:27:14Z")

</div>

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 🙂 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).

 ![Dracut Error](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/2X/e/e06075a77d2dd731337c1f7a4150c0c7e430ff25.jpeg)

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

```auto
#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!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [May 20, 2024, 8:28pm UTC](https://forums.rockylinux.org/t/rocky-linux-8-custom-iso-install-from-usb-consistently-brings-up-dracut-emergency-shell/13292/2 "2024-05-20T20:28:14Z")

</div>

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