6. Copy CentOS Distribution Data
Download ISO
The CentOS ISO image can be downloaded from one of many mirrors listed on
centos.org
. Download withwget
to the master node.[root@master ~]# yum install wget [root@master ~]# wget http://mirror.math.princeton.edu/pub/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-Everything-2207-02.iso
Warning
In MHPC Hardware please use http://172.16.0.1/repo/iso/CentOS-7.9-x86_64-Everything-2207-02.iso to download the iso image into the
scratch
folder.[root@master ~]# yum install wget [root@master ~]# cd /scratch [root@master scratch]# wget http://172.16.0.1/repo/iso/CentOS-7.9-x86_64-Everything-2207-02.iso
Mount ISO
We need to extract the contents of that ISO image to a folder. Mount the ISO as loopback device into a folder, e.g.
/mnt/iso
.# mount ISO image [root@master ~]# mkdir -p /mnt/iso [root@master ~]# mount CentOS-7-x86_64-Everything-2207-02.iso /mnt/iso
Copy contents to folder
Copy the contents of your mounted directory to a folder hosted by HTTP server, such as
/var/www/html/CentOS-7-2207-02-x86_64
.[root@master ~]# cp -r /mnt/iso /var/www/html/CentOS-7-2207-02-x86_64
Copy CentOS installer kernel and initrd file for PXE boot
The ISO includes a kernel and initrd file which can be used for PXE booting via network. Copy these files into a
centos7
folder in the TFTP root directory/var/lib/tftpboot/
.[root@master ~]# mkdir -p /var/lib/tftpboot/centos7/ [root@master ~]# cp /mnt/iso/images/pxeboot/vmlinuz /var/lib/tftpboot/centos7/ [root@master ~]# cp /mnt/iso/images/pxeboot/initrd.img /var/lib/tftpboot/centos7/
Unmount ISO
Finally unmount the ISO image.
[root@master ~]# umount /mnt/iso