I have a kickstart based DVD that I want to use to setup a few identicat servers. The DVD is an exact copy of a RHEL iso image, with the addition of a directory named "custom". Under that directory, I have some scripts and some jpgs that I want to copy to each server.

In the kickstart file, in the %post --nochroot section, I copy all those files to their final location as:

 cp -f /custom/script1.sh /mnt/sysimage/usr/local/bin/
 cp -f /custom/script2.sh /mnt/sysimage/usr/local/bin/
 cp -f /custom/script3.sh /mnt/sysimage/usr/local/bin/

 cp -f /custom/image1.jpg /mnt/sysimage/usr/local/<myapp>
 cp -f /custom/image2.jpg /mnt/sysimage/usr/local/<myapp>
 cp -f /custom/image3.jpg /mnt/sysimage/usr/local/<myapp>

However, the ks.log file says that the /custom directory does exists!

So, how do I copy files from installation DVD to the new system?

  • 2
    The DVD is almost certainly mounted somewhere other than root (maybe /mnt/cdrom or something). I'm not familiar with Kickstart so I couldn't say where, but someone around probably knows... – Chris S Jul 11 '13 at 13:55
  • I can't check right now, but you could switch over to a shell running on a virtual console during Kickstart and look. (CTRL+ALT+F1 - CTRL+ALT+F5) – Aaron Copley Jul 11 '13 at 15:56
  • I don't believe that this is not documented somewhere! – Peter Jul 11 '13 at 18:16

OK, I found it. Red Hat/Centos, mount the installation media in the /mnt/source directory. So in order to copy my files, I changed the commands to:

%post --nochroot s
cp -f /mnt/source/custom/script1.sh /mnt/sysimage/usr/local/bin/
  • What version of RHEL were you using? I'm trying something similar with RHEL 6.3 and I don't see a /mnt/source when I use --nochroot. – Burhan Ali Aug 7 '13 at 10:15
  • My version is 6.3 too. – Peter Aug 20 '13 at 8:27
  • Thanks. I subsequently discovered that /mnt/source is there if you are using a DVD. I was using a USB key at the time and it doesn't exist for that. – Burhan Ali Aug 20 '13 at 9:26
  • And, where is it? – Peter Aug 20 '13 at 9:29
  • It doesn't exist at all as far as I could see. There is a /mnt/isodir directory which contains the ISO and I had to resort to manually mounting this ISO to gain access to the contents of the DVD. I don't know if that's the "right" approach but it's what I ended up doing. – Burhan Ali Aug 20 '13 at 9:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.