Build a CentOS7 server for: pxe boot, kickstart, reposync, repotrack, nfs, https (STEP 3)

STEP 3 – CONFIGURE THE VM’s 2ND DISK AND INSTALL

note: if vdisks are “SATA”, this should display “sda”, if vdisks are “NVMe” this should display “nmve0n1”
[root@c7pxe elmer]# lsblk # show partition layout (before config’d 2nd disk):
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0              11:0    1 1024M  0 rom
nvme0n1         259:0    0    8G  0 disk
├─nvme0n1p1     259:1    0  512M  0 part /boot
└─nvme0n1p2     259:2    0  7.5G  0 part
  └─centos-root 253:0    0  7.5G  0 lvm  /

  • configure the 2nd disk: 20GB for “reposync” files (was using 30GB, but didn’t need it all):
    • start up the vm.
    • if NVME:
      • fdisk -l # new disk is listed as ” Disk /dev/nvme0n2: 32.2 GB, 32212254720 bytes, 62914560 sectors “
      • fdisk /dev/nvme0n2 # select new “n“, primary “p“, partition number “1“, first sector ‘default‘, last sector ‘default‘, write “w“.
      • fdisk /dev/nvme0n2 # select change type “t“, linux lvm ‘8e‘, write ‘w‘.
      • mkfs.xfs -f /dev/nvme0n2  # for some reason, the VMware Fusion VMs with NVMe vdisk required the extra “-f” flag for this to work.
    • or, if SATA:
      • fdisk -l # new disk is listed as “Disk /dev/sdb: 32.2 GB, 32212254720 bytes, 62914560 sectors”
      • fdisk /dev/sdb # select new “n“, primary “p“, partition number “1“, first sector ‘default‘, last sector ‘default‘, write “w“.
      • fdisk /dev/sdb # select change type “t“, linux lvm ‘8e‘, write ‘w‘.
      • mkfs.xfs /dev/sdb1
mkdir /var/www/html/repos   # httpd must be installed and 2nd disk must be ready.
mount /dev/nvme0n2 /var/www/html/repos
            # if SATA: mount /dev/sdb1 /var/www/html/repos
nano /etc/fstab # add new line,
            # “/dev/nvme0n2 /var/www/html/repos xfs defaults     0   0
reboot # verify that mounts, folders, and httpd work after a reboot.
[root@c7pxe elmer]# lsblk # show partition layout:
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0              11:0    1  7.8G  0 rom
nvme0n1         259:0    0    8G  0 disk
├─nvme0n1p1     259:1    0  512M  0 part /boot
└─nvme0n1p2     259:2    0  7.5G  0 part
  └─centos-root 253:0    0  7.5G  0 lvm  /
nvme0n2         259:3    0   20G  0 disk /var/www/html/repos

cd /var/www/html/repos/

from a browser, check that 10.0.0.11 is providing a web page (apache default).
check that the /home/elmer/shrink-disk.sh script has the lines for “/var/www/html/repos“.
  • mkdir -p /var/www/html/repos/{c7x64,c7x32} # or whatever list of distros to serve.
  • mkdir -p /var/www/html/repos/c7x64/{base,extras,updates,epel}
  • mkdir -p /var/www/html/repos/c7x32/{base,extras,updates} # there is no epel for c7x32.
  • mkdir -p /var/www/html/repos/client-files/ # will serve scripts/files here, for post install uses.
optionally: to serve ISO images to PXE boot clients:
  • mkdir -p /var/www/html/repos/c7x64/ISOminimal
    • # use: mount /dev/cdrom /var/www/html/repos/c7x64/ISOminimal
  • mkdir -p /var/www/html/repos/c7x64/ISOeverything
    • # use: mount /dev/cdrom /var/www/html/repos/c7x64/ISOeverything
  • mkdir -p /var/www/html/repos/c7x32/ISOminimal
    • # use: mount /dev/cdrom /var/www/html/repos/c7x32/ISOminimal
  • mkdir -p /var/www/html/repos/c7x32/ISOeverything
    • # use: mount /dev/cdrom /var/www/html/repos/c7x32/ISOeverything
enable remote machines to read from httpd server on c7pxe.local:
chcon -R -t httpd_sys_content_t /var/www/html/repos/
      # something about “SE Linux” according to a doc at RHEL.
      # that may throw an error, but it may not be relevant on c7pxe with selinux=permissive
      # or? might have to wait until after it’s ran a reposync cycle, so there is content in the folders.

One thought on “Build a CentOS7 server for: pxe boot, kickstart, reposync, repotrack, nfs, https (STEP 3)

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s