创建yum源配置文件:
# 首先将光盘挂载到/mnt目录下 [root@pxe1 ~]# umount /dev/cdrom -l [root@pxe1 ~]# mount /dev/cdrom /mnt/ mount: /dev/sr0 is write-protected, mounting read-only #创建yum配置文件 [root@pxe1 ~]# cd /etc/yum.repos.d/ [root@pxe1 yum.repos.d]# ls CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Sources.repo CentOS-fasttrack.repo CentOS-CR.repo CentOS-Media.repo CentOS-Vault.repo #避免系统中的repo文件影响,首先将其备份 [root@pxe1 yum.repos.d]# mkdir bak [root@pxe1 yum.repos.d]# mv *.repo bak/ [root@pxe1 yum.repos.d]# ls bak [root@pxe1 yum.repos.d]# vim my.repo [development] <--注意:这里一定要写development name=my-centos7-dvd baseurl=file:///mnt enabled=1 gpgcheck=0注意:my.repo文件中第一行[development],中括号中建议填写development,填写其他内容会导致后面system-config-kickstart命令生成kickstart文件文件时,出现以下问题:
由于下载软件包信息失败,软件包选择被禁止
创建yum缓存:
[root@pxe1 yum.repos.d]# yum clean all Failed to set locale, defaulting to C Loaded plugins: fastestmirror, langpacks Cleaning repos: development Cleaning up everything [root@pxe1 yum.repos.d]# yum makecache Failed to set locale, defaulting to C Loaded plugins: fastestmirror, langpacks development | 3.6 kB 00:00:00 (1/4): development/filelists_db | 3.0 MB 00:00:00 (2/4): development/group_gz | 155 kB 00:00:00 (3/4): development/other_db | 1.3 MB 00:00:00 (4/4): development/primary_db | 3.0 MB 00:00:00 Determining fastest mirrors Metadata Cache Created 3. DHCP服务器配置dhcp为客户端提供必要的网络信息,如IP、netmask、gateway、dns等,并向客户端提供引导文件(pxelinux.0)的位置及TFTP服务器地址等。
3.1 安装dhcp软件包 [root@pxe1 yum.repos.d]# yum install -y dhcp ... Installed: dhcp.x86_64 12:4.2.5-47.el7.centos Complete! 3.2 修改dhcp配置文件