ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Pxe自动安装脚本配置方法

2022-01-13 14:02:50  阅读:226  来源: 互联网

标签:脚本 information -- System fstype configuration 安装 Pxe size


Pxe自动安装脚本配置方法:

yum安装system-config-kickstart

[root@localhost ~]# yum -y install system-config-kickstart

修改/var/lib/tftpboot/pxelinux.cfg/default文件:

在append initrd 的最后添加ks路径,用空格隔开: ks=ftp://192.168.140/ks.cfg

[root@localhost ~]#  system-config-kickstart

出现图形化界面,进行配置:

保存后的脚本内容如下:

[root@localhost ~]# more  ks.cfg

#platform=x86, AMD64, 或 Intel EM64T

#version=DEVEL

# Install OS instead of upgrade

install

# Keyboard layouts

keyboard 'us'

# Root password

rootpw --iscrypted $1$Mj6m4JG0$AatHUEmSlz0rAiH4K.bSc/

# System language

lang zh_CN

# System authorization information

auth  --useshadow  --passalgo=sha512

# Use text mode install

text

firstboot --disable

# SELinux configuration

selinux --disabled

# Firewall configuration

firewall --disabled

# Network information

network  --bootproto=dhcp --device=ens33

# Reboot after installation

reboot

# System timezone

timezone Asia/Shanghai

# Use network installation

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

# System bootloader configuration

bootloader --location=mbr

# Clear the Master Boot Record

zerombr

# Partition clearing information

clearpart --all

# Disk partitioning information

part /boot --fstype="ext4" --size=200

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

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

%post --interpreter=/bin/bash

service network restart

%end

PS:以上脚本只是基础安装,没有桌面等工具包,以下脚本为带桌面的自动化安装脚本:

PXE客户机自动安装脚本ks.cfg

#platform=x86, AMD64, 或 Intel EM64T

#version=DEVEL

# Install OS instead of upgrade

install

# Keyboard layouts

keyboard 'us'

# Root password

rootpw --iscrypted $1$u5JRzFEu$WvZhM8b2xvFbFQ6.qIIh70

# 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

# Network information

network  --bootproto=dhcp --device=ens33

# Reboot after installation

reboot

# System timezone

timezone Asia/Shanghai

# Use network installation

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

# System bootloader configuration

bootloader --location=mbr

# Clear the Master Boot Record

zerombr

# Partition clearing information

clearpart --linux --initlabel

# Disk partitioning information

part pv.313 --fstype="lvmpv" --ondisk=sda --size=30724

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

part biosboot --fstype="biosboot" --ondisk=sda --size=2

volgroup centos --pesize=4096 pv.313

logvol /home  --fstype="xfs" --size=5120 --name=home --vgname=centos

logvol /  --fstype="xfs" --size=10240 --name=root --vgname=centos

logvol swap  --fstype="swap" --size=1024 --name=swap --vgname=centos

%packages

@^graphical-server-environment

@base

@compat-libraries

@core

@desktop-debugging

@development

@dial-up

@fonts

@gnome-desktop

@guest-agents

@guest-desktop-agents

@hardware-monitoring

@input-methods

@internet-browser

@multimedia

@print-client

@security-tools

@x11

chrony

kexec-tools

%end

标签:脚本,information,--,System,fstype,configuration,安装,Pxe,size
来源: https://blog.csdn.net/vio4677/article/details/122472261

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有