PXE boot notes (part 4, serving files)

Now we have a working DHCP server with the ability to allow clients to boot, a TFTP server which is providing the PXE bootloader, and it then references some other content that we haven’t yet detailed.

Remember the Centos 7 Minimal ISO I referred to earlier? We need that on the boot server – so get it copied over. Once it’s copied over, mount it in a convenient place:

mkdir /tmp/minimal-iso
mount -o loop $PATH_TO_ISO/CentOS-7-x86_64-Minimal /tmp/minimal-iso

We could simply refer to the paths under the mountpoint in our various configs from here but disk space wasn’t exactly at a premium so I lazily copied the content to two locations – the TFTP root, and under the webserver root. There’s about a million ways to do this reliably (cp, rsync, tar etc) but I’m a bit old and like tar, so:

for x in /var/www/html/centos /var/lib/tftpboot/centos
do
  mkdir -p $x
  ( cd /tmp/minimal-iso && tar cpf - . ) | ( cd $x && tar xvpf - )
done

Yes, it’s not very efficient, but humour me – with hundreds of TB of storage to play with in this system I could afford to be profligate!

That puts in place the files the pxelinux.cfg/default referred to in the previous post, so now the client machines can not only grab a bootloader but a kernel and initial ramdisk too. Good.

Webserver configuration is uncomplicated, as we left it with the default configuration and placed everything in the preconfigured DocumentRoot of /var/www/html. The only thing left to do now with the webserver itself is to enable and start it:

systemctl enable httpd
systemctl start httpd

And there was one more thing referred to in the PXE config file: ks.cfg, the actual Kickstart configuration for the test boxes. That’ll be described next post.

Advertisements

One comment

  1. Pingback: PXE boot notes (part 3, TFTP) « Random Ramblings


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s