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(筆記)

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