美文网首页
PXE安装Centos7

PXE安装Centos7

作者: 米青 | 来源:发表于2016-11-17 10:22 被阅读0次

PXE(Pre-boot Execution Environment)是由Intel设计的协议,它可以使计算机通过网络而不是从本地硬盘、光驱等设备启动。

现代的网卡,一般都内嵌支持PXE的ROM芯片。当计算机引导时,BIOS把PXE client调入内存执行,并显示出命令菜单,

经用户选择后,PXE client将放置在远端的操作系统通过网络下载到本地运行。

pxe服务端需要准备的环境如下

操作系统镜像CentOS-7-x86_64-Everything-1511.iso

tftp

dhcp

httpd

安装所需要的服务程序

yum -y install syslinux tftp-server httpd dchp

mount /dev/sr0 /data

cp  -v /data/images/pxeboot/{vmlinuz,initrd.img}  /var/lib/tftpboot

安装syslinux软件包后,我们需要将pxelinux.0文件复制到tftp默认的根目:/var/lib/tftpboot

cp  -v /usr/share/syslinux/{pxelinux.0,menu.c32,memdisk,mboot.c32,chain.c32}  /var/lib/tftpboot/

mkdir /var/lib/tftpboot/pxelinux.cfg/

vim  /var/lib/tftpboot/pxelinux.cfg/default

default menu.c32

prompt5timeout30MENU TITLECentOS7PXEMenuLABEL linux

MENU LABELInstallCentOS7x86_64

KERNEL vmlinuz

APPEND initrd=initrd.img inst.repo=http://172.16.253.85/centos

LABEL linux_autoinst

MENU LABELInstallCentOS7x86_64 auto

KERNEL vmlinuz

APPEND initrd=initrd.img inst.repo=http://172.16.253.85/centos ks=http://172.16.253.85/kickstart/ks.cfg

配置dhcp

cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example  /etc/dhcp/dhcpd.conf

vim /etc/dhcp/dhcpd.conf

#option domain-name "magedu.com";#option domain-name-servers 172.16.253.85;subnet172.16.0.0netmask255.255.0.0{range172.16.0.1172.16.0.100;filename"pxelinux.0";next-server172.16.253.85;指定tftp服务器的地址}

配置httpd

mount /dev/sr0 /var/www/centos

vim /etc/http/conf/httpd.conf

DocumentRoot"/var/www/"OptionsIndexesFollowSymLinksAllowOverrideNoneRequireall granted

制作kickstart文件

mkdir /var/www/kickstart

yum -y install system-config-kickstart

system-config-kickstart需在图形界面启动,生成配置文件ks.cfg,放在kickstart目录下

ks.cfg配置文件样例

#platform=x86, AMD64, or Intel EM64T#version=DEVEL# Install OS instead of upgradeinstall# Keyboard layoutskeyboard'us'# Root passwordrootpw--iscrypted $1$6/CtpwDu$I5sBDo0KeVe4zTprFkmkI.# System timezonetimezoneAfrica/Kinshasa# Use network installationurl--url="http://172.16.253.85/centos"# System languagelang en_US# Firewall configurationfirewall--disabled# System authorization informationauth--useshadow--passalgo=sha512# Use graphical installgraphical

firstboot--disable# SELinux configurationselinux--disabled# Halt after installationhalt# System bootloader configurationbootloader--location=mbr# Clear the Master Boot Recordzerombr# Partition clearing informationclearpart--all--initlabel# Disk partitioning informationpart/boot--fstype="xfs"--size=200part swap--fstype="swap"--size=1024part/--fstype="xfs"--grow--size=1%post

reboot%end%packages@base@core%end

检查kickstart文件是否有语法错误

ksvalidator ks.cfg

Systemctl enable tftp.socket httpd dhcpd

Systemctl start  tftp.socket httpd dhcpd

如果安装过程中出现tftp open time out字样,请关闭pxe服务器的selinux,清空iptables规则。

setenforce 0

iptables -F

测试安装

选择自动安装

等待安装完成即可

测试安装

dhcp查看已分发的地址

安装完毕

相关文章

  • PXE自动安装CentOS7详解

    PXE安装CentOS7主要分成以下几个部分: 1、配置DHCP 2、配置tftp 3、配置kickstart文件...

  • PXE安装Centos7

    PXE(Pre-boot Execution Environment)是由Intel设计的协议,它可以使计算机通过...

  • pxe安装最小

    要使用pxe安装需要的准备(centos7作服务器): 要安装系统的光盘 这个没有什么说的,买的实体光盘,下载的i...

  • Linux自动化安装

    基于centos7的PXE自动化安装centos6,7 环境:两台主机一台DHCP,HTTPD,TFTP服务器(一...

  • Pxe+Dhcp+Httpd+Tftp+Kickstart搭建无

    原理和概念 PXE :Pxe并不是一种安装方式,而是一种引导的方式,进行 PXE 安装的必要条件是要安装的计算机中...

  • CentOs7 PXE自动批量部署

    CentOs7 PXE自动批量部署 目录 主服务器信息 环境 PXE工作原理 部署主服务器配置网卡IP配置本地yu...

  • 使用PXE引导安装CentOS7

    一、PXE简介 PXE(preboot execute environment,预启动执行环境)是由Intel公司...

  • 第十二周

    1、配置chrony服务,实现服务器时间自动同步 2、实现cobbler+pxe自动化装机 PXE安装: 安装yu...

  • BCLinux 6 PXE安装

    本文介绍如何在BCLinux 6中搭建PXE安装环境。 PXE安装需要在局域网内开启如下服务: DHCP服务为待安...

  • 基于PXE和光盘镜像在线批量安装CentOS系统流程整理

    PXE 使用总结 最近用到了PXE批量安装集群OS,现整理相关操作指南如下,具体安装使用请读者根据自身现场环境进行...

网友评论

      本文标题:PXE安装Centos7

      本文链接:https://www.haomeiwen.com/subject/gjfgettx.html