How would you create a CentOS 7 USB installer with a data partition to store kickstart files?
We will be getting some new servers shortly and overall I’m expecting to do over 30 servers installs. What I’d really like to do is have a usb stick that I boot off of and then use kickstart to do the install.
With CentOS 7, the CentOS wiki says to use dd to copy the ISO to the usb drive e.g.
dd if=CentOS-6.5-x86_64-bin-DVD1.iso of=/dev/sdb
That works great, but the ISO is just over 6.5GB, I should have left over space.
Looking at fdisk, I would have guessed I could just add a partition starting at 13793280
, but I’ve tried it three times and every time creating the extra partition causes the installer to error out when before creating a third partition it worked on the same system.
Disk /dev/sdb: 31.0 GB, 31009800192 bytes, 60566016 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x4f3c40e6
Device Boot Start End Blocks Id System
/dev/sdb1 * 0 13793279 6896640 0 Empty
/dev/sdb2 4812 17391 6290 ef EFI (FAT-12/16/32)
If I have to setup a web server to serve the kickstart files, I could probably do that but I’m not eager to go through the process that would require. I’m not sure if I could do that in our secondary site or what resistance there may be for that.
I also need to develop a disaster recovery strategy, so if I could say buy new servers, follow procedure X to create a USB stick, do the install by booting off the USB stick, then I could kill two birds with one stone.
I’m semi-resigned to have to edit the boot parameters manually for now to add the ks=
parameter at least initially. Since you can use UUID, it should be possible to have a single command per type of server and I can easily provide that to the people who will rack the servers. What I’d really like to avoid though is having two USB thumb drives (one for installation media and the other for kickstart file).
Edit: I should have said that the validation the installer does originally passes, but after adding and formatting the partition it fails. I don't think that's significant as I my assumption is the partition table affects that checksum, but its possible that the partitions overlap and creating the file system is corrupting data.
Edit 2: Just in case I'm doing something wrong when creating the third partition, I thought I'd add the output of fdisk
after adding the partition.
Disk /dev/sdb: 31.0 GB, 31009800192 bytes, 60566016 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x4f3c40e6
Device Boot Start End Blocks Id System
/dev/sdb1 * 0 13793279 6896640 0 Empty
/dev/sdb2 4812 17391 6290 ef EFI (FAT-12/16/32)
/dev/sdb3 13793280 60566015 23386368 83 Linux