CentOS7 PXE安装批量安装操作系统
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了CentOS7 PXE安装批量安装操作系统,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含3492字,纯文字阅读大概需要5分钟。
内容图文
![CentOS7 PXE安装批量安装操作系统](/upload/InfoBanner/zyjiaocheng/979/60854039a61b49249c1e6827475fefb4.jpg)
1.安装相关软件
yum -y install tftp-server httpd dhcp syslinux
2.配置DHCP
cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf
cat /etc/dhcp/dhcpd.conf
- 启动DHCP服务
systemctl start dhcpd.service
3.配值tftp-server (基本不用修改配置文件)
- cat /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer # protocol. The tftp protocol is often used to boot diskless # workstations, download configuration files to network-aware printers, # and to start the installation process for some operating systems.
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = yes
per_source = 11
cps = 100 2
flags = IPv4
}
- cat /usr/lib/systemd/system/tftp.service
[Unit]
Description=Tftp Server
Requires=tftp.socket
Documentation=man:in.tftpd
[Service]
ExecStart=/usr/sbin/in.tftpd -s /var/lib/tftpboot
StandardInput=socket
[Install]
Also=tftp.socket
启动tftp-server服务
systemctl start tftp.socket
- 设定PXE相关的文件:
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
cp /usr/share/syslinux/{chain.c32,mboot.c32,menu.c32,memdisk} /var/lib/tftpboot/
cp /media/cdrom/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/
#基于pxe安装使用的光盘上的文件(自己本地挂载光盘即可)或者是yum仓库里
mkdir /var/lib/tftpboot/pxelinux.cfg/
- vim default #default的文件内容如下
default menu.c32 #加载时显示的默认菜单控制的程序(配置无法启动,menu.c32 改成Linux)
prompt 5 #显示提示符时间
timeout 30 #超时时长
MENU TITLE CentOS 7 PXE Menu #标题为CentOS7 PXE Menu
LABEL linux #指明下面菜单项的label
MENU LABEL Install CentOS 7 x86_64 #菜单的label
KERNEL vmlinuz #指明kernel文件
APPEND initrd=initrd.img inst.repo=http://192.168.121.17/centos7 ks=http://192.168.121.17/centos7.cfg #附加给kernel的参数,inst.repo可以是教室的ftp服务器,或者把光盘当做yum仓库,把它作为一个网站的访问就可以了
4.挂载ISO文件
mkdir -pv /media/cdrom
mount -r /dev/cdrom /media/cdrom
mkdir -pv /var/www/html/centos7/
mount --bind /media/cdrom /var/www/html/centos7
5. 配置kickstart文件:
- 该kickstart文件是CentOS7 最小化安装的一部分+system-config-kickstart 命令创建的kickstart文件(强烈建议在desktop centos7 上面操作system-config-kickstart命令)的合集
#platform=x86, AMD64, 或 Intel EM64T
#version=DEVEL
# Install OS instead of upgrade
install
# Keyboard layouts
keyboard 'us'
# Root password
rootpw --iscrypted $1$kncWgT41$Z37pYAKljSaTTQ4EadDqE1
# Use network installation
url --url="http://10.2.1.10/centos7"
# System language
lang en_US
# System authorization information
auth --useshadow --passalgo=sha512
# Use text mode install
text
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# Firewall configuration
firewall --disabled
# Network information
network --bootproto=dhcp --device=ens33
network --hostname=localhost.pxe
# Reboot after installation
reboot
# System timezone
timezone Asia/Shanghai
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="xfs" --size=1024
part swap --fstype="swap" --size=4096
part / --fstype="xfs" --grow --size=1
%post
systemctl disable postfix.service
%end
%packages
@^minimal
@compat-libraries
@debugging
@development
bash-completion
dos2unix
lrzsz
nmap
sysstat
tree
vim
wget
%end
内容总结
以上是互联网集市为您收集整理的CentOS7 PXE安装批量安装操作系统全部内容,希望文章能够帮你解决CentOS7 PXE安装批量安装操作系统所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。