3

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

1 Answer 1

1

I found a great guide on how to install CentOS 7 using a USB drive and kickstart here:

Kickstart driven CentOS 7 install from USB

I suspect that modifying the partition table of a ISO image is not easily feasible.

Carlo.

2
  • I'm accepting this as an answer as the solution produced a single USB drive that could kickstart CentOS 7 on systems that use a BIOS. When trying on EUFI systems, it fails.I'm trying to review things to figure out what modifications I need to make so that it is compatible with UEFI.
    – W3t Tr3y
    Apr 22, 2015 at 22:44
  • 1
    In addition to the isolinux folder, I copied over EFI and images. I updated EFI/boot/grub.cfg so the search line read search --no-floppy --set=root -l 'BOOT'. I then found [mgorven's answer] (unix.stackexchange.com/questions/41738/…) which mentions creating /EFI/BOOT/startup.nsh that contains one line BOOTX64. While I'm not at work to try it on our new servers, it did do the trick to get the drive to show up on my Mac so I'm hopeful this will be enough to get it to work in EFI.
    – W3t Tr3y
    Apr 24, 2015 at 3:36

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.