PXE自动安装cento7(笔记)

PXE自动安装cento7 :
1安装yum仓库
2创建tftp服务器网卡设置静态
3 syslinux引导创建
4 安装dhcp 创建dhcp分组
5 安装kickstart 创建自动安装文件
6 安装测试
PXE自动安装cento7(笔记)






  1. BIOS---pxe启动
  2. DHCP—分配IP 定位引导程序
  3. TFTP服务器,提供引导程序下载
  4. 网络启动
  5. 安装源YUM仓库(centos 7)
  6. 准备TFTP服务---DHCP---引导程序位置----配置启动菜单
  7. 创建本地YUM仓库:
    Umount /dev/sro 卸载
    Mount
    Df –hT
    Mount /dev/sr0 /mnt
    Ls
    Cd /etc/yum.repos.d/
    Mv CentOS-Base.repo CentOS-B ase.repo.bak
    Vi CentOS-Media.repo
    Baseurl=








     File:///mnt/

Enabled=1

Cd
Yum list all
Yum install –y vsftp
Cd /var/ftp/
Ls
Makdir centos7
Unmount /dev/sr0
Mount /dev/sr0 /var/ftp/centos7
Vi /etc/yum.repos.d/ CentOS-Media.repo







Baseurl=ftp://192.168.28.155/centos7
Gpgcheck=0

cd
Yum clean all
Yum repolist
失败==
Ip a
Vi /etc/sysconfig/network-scripts/ifcfg-ens33
BOOTPROTO=static
ONBOOT=yes
IPADD=192.168.28.155
NETMASK=255.255.255.0
:wq









Ifdown ens33;ifup ens33
Systemctl start vsftpd
Systemctl enable vsftpd
光盘为临时挂载,重启电脑要重新修改,如何永久挂载?


Systemctl stop firewalld
Systemctl disable firewalld
Setenforce 0 关闭selinux防火墙

Yum –y install tftp-server xinetd

Rpm –ql tftp
Repm –ql tftp-server
Rpm –ql xinetd 超级管理器

PXE自动安装cento7(笔记)
Systemctl start xinetd
Systemctl enable xinetd 开启提供内核及文件
Cd /var/lib/tftpboot/
Cd images/
Ls
Cd /var/ftp/centos7/
Ls
Cd /images/
Cd pxeboot
Ls
Cp vmlinuz initrd.img /var/lib/tftpboot 拷贝引导文件










Yum install –y syslinux
Rpm –ql syslinux
Cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
Cd /var/lib/tftpboot/
Ls
Mkdir pxelinux.cfg 创建启动目录
Cd pxelinux.cfg
Ls
Vi default 创建默认文件
PXE自动安装cento7(笔记)








:wq

Systemctl restart xinetd
PXE自动安装cento7(笔记)
PXE自动安装cento7(笔记)
:wq
Systemctl start dhcpd
Systemctl enable dhcpd




安装==修改配置文件==启动=开机启动
PXE自动安装cento7(笔记)
创建应答文件:
Yum install –y system-config-kickstart.noarch
System-config-kickstart 启动



PXE自动安装cento7(笔记)PXE自动安装cento7(笔记)

Yum remove –y system-config-kickstart.noarch
修改源:

PXE自动安装cento7(笔记)
[c7-media] 修改标识符为: [development]

Yum repolist

Yum install –y system-config-kickstart.noarch
System-config-kickstart
PXE自动安装cento7(笔记)
文件内容:ks.cfg


latform=x86, AMD64, 或 Intel EM64T

ersion=DEVEL

Install OS instead of upgrade**

install

Keyboard layouts

keyboard 'us'

Root password

rootpw --iscrypted $1$LY5LkYCl$V.A.C3Ozo88VxWEjZWFQE.

Use network installation

url --url="ftp://192.168.28.155/centos7"

System language

lang zh_CN

System authorization information

auth --useshadow --passalgo=sha512

Use graphical install

graphical

firstboot --disable

SELinux configuration

selinux --disabled

Firewall configuration

firewall --disabled

Reboot after installation

reboot

System timezone

timezone Asia/Shanghai

System bootloader configuration

bootloader --location=mbr

Partition clearing information

clearpart --all

Disk partitioning information****

part swap --fstype="swap" --size=2048

part /boot --fstype="xfs" --size=1024

part / --fstype="xfs" --grow --size=1

%packages

@core

%end

Cp ks.cfg /var/ftp
Cd /var/ftp
Ls
编辑启动文件:
Vi /var/lib/tftpboot/pxelinux.cfg/default
Ks=ftp://192.168.28.155/ks.cfg




Curl ftp://192.168.28.155
Systemctl restart xinetd 重启tftp服务器

PXE自动安装cento7(笔记)

PXE自动安装cento7(笔记)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章