Using Kickstart post to copy files from USB to HDD

Latest response

kickstart post errorHi Folks,

Am struggling with using %post to copy files from my USB build media to the HDD on my RHEL server I am building

Using my kickstart build process, I have created a folder at the root of the drive called build-media and in there are some zip files and RPM's that I want to copy to the HDD on the RHEL server at /buildmedia, the issue I am having is that during the installation, the %post process is complaining that the file system is read only, I think the issue is that in my post command it is trying to create folders on the read-only USB and not the actual target HDD.

Any pointers??

When the server boots off of the USB, sda is assigned to the USB and sdb is assigned to the servers HDD

%post --erroronfail --log=/root/ks-post.log
mkdir /mnt/buildusb
mkdir /buildmedia
mount /dev/disk/by-label/RHEL8 /mnt/buildusb
cp -af /mnt/buildusb/build-files/*.zip /buildmedia
umount /mnt/ buildusb
rmdir /mnt/ buildusb
%end

Responses