While I really enjoy my current employment opportunity, servers are typically installed by students and we have several generations of servers all installed by different people, so there can be inconsistencies. Since our current servers distribution is not going to be supported by the vendor for much longer and we recently purchased 15 new servers, it seemed like the perfect opportunity to expand our use of configuration management (puppet in our case) and to introduce the idea of using Kickstart since we’re migrating to CentOS.
While I used Kickstart with Redhat, RHEL, Fedora, and CentOS at a previous position, that was over five years ago and was on a network with dhcp, tftp, and nfs servers. I’m currently in a security group with no dhcp, tftp or nfs servers, so I really wanted to find a way to do everything off of USB. Since that proved to be more challenging then I expected, I wanted to write up my solution so I could find it again and hopefully spare some one else some of the pain.
The CentOS wiki suggests using dd to copythe iso to the usb drive:
Based on that, my first (very naïve) attempts were to dd the iso over and then to try to re-partition the drive to create a partition in the spare space to hold the kickstart files. There’s still a part of me that feels there has to be a way to make this work, but I never got it to work.
In Feburary, I first posed the question to the SuperUser community and thankfully karlacio posted an answer yesterday (April 22, 2015) which referenced gist 4b9ad551cb6c35870d7c
My first deviation was I used labels so my syslinux.cfg had an append line like:
While that worked great for systems with BIOSes, it failed to work on machines with EFI. After reading up some, I knew that the EFI folder would be required since EFI’s look for partitions with that folder instead of utilizing an MBR.
So I copied the EFI folder from the ISO to the BOOT partition.
Similar to the syslinux.cfg file, I had to update EFI/BOOT/grub.cfg to refernce the updated location; this change was quite simple I just changed the search line to read:
search --no-floppy --set=root -l 'BOOT'
In looking at the grub.cfg file, I noticed that it referenced files under images, so I copied that DVD/images folder over to BOOT/images. In order to have room to copy the folder, I had to start over and make the first partition 530MB. You could go larger, but since I had two 8GB USB3 thumb drives, I didn’t want to waste too much space.
I was quite frustrated when that didn’t work, but I finally found mgorven’s answer which suggested creating BOOT/EFI/BOOT/startup.nsh which contained one line:
Using this method I was able to create a usb-based installation media that booted on my MacBook Pro, our newer EFI based systems, and are older ones using BIOSes.
Update – 1/9/2016 – I was able to use this method to sucessfully create usb-based media for RHEL 7.