14.Linux中的无人职守安装脚本kickstart

一.kickstart自动安装脚本的作用
用文件来记录所有安装过程中问题的答案,并让所有需要安装的主机自动读取,记录系统安装过程中所有问题答案的文件叫kickstart脚本
二.kickstart自动安装脚本的制作**
#通过模板生成kickstart文件#
在已经装好的rhel8中,/root/anaconda-ks.cfg 就是安装当前系统时回答的所有问题的答案
生成的kickstart,此文件为kickstart模板
#用模板自作kickstart#
在已经装好的rhel8中,/root/anaconda-ks.cfg 就是安装当前系统时回答的所有问题的答案,生成的kickstart,此文件为kickstart模板
cp /root/anaconda-ks.cfg /var/www/html/westos.cfg在这里插入图片描述
vim /var/www/html/westos.cfg
#version=RHEL8
ignoredisk --only-use=sda
#Clear the Master Boot Record
zerombr
#Partition clearing information
clearpart --all --initlabel
#Reboot after installation
reboot
#Use graphical install
graphical
#Keyboard layouts
keyboard --vckeymap=us --xlayouts=‘us’
#System language
lang en_US.UTF-8 --addsupport=zh_CN.UTF-8

#Network information
network --hostname=westos_student18.westos.org
network --bootproto=dhcp --onboot=on --ipv6=auto --no-activate
repo --name=“AppStream” --baseurl=http://172.25.254.50/westos/AppStream
Use network installation
url --url=“http://172.25.254.50/westos”
#Root password
rootpw --iscrypted 6 6 6GuSHAFGYhhzXwfq2$FXcvQkawaws3NdDcOenvKhw7zbK6lY6BCuH3OqQghy3Ca/MAIqLjVSXd3WOTESXQ811JiBPWjMrFp4FLoml4o/
在这里插入图片描述
#X Window System configuration information
xconfig --startxonboot
firstboot --disable
#System services
#services --enabled=“chronyd”
#System timezone
timezone Asia/Shanghai
#Disk partitioning information
part / --fstype=“xfs” --grow --size=1
part /boot --fstype=“xfs” --size=512
part swap --fstype=“swap” --size=4096
%post --nochroot
touch /mnt/westosfile{1…6}
%end
%packages
@base
%end
在这里插入图片描述在这里插入图片描述
%end
ksvalidator /var/www/html/westos.cfg 检测westos.cfg语法在这里插入图片描述
chmod 644 /var/www/html/westos.cfg在这里插入图片描述三 在系统安装基面选择
Install Red Hat Enterprise Linux 8.0.0 按TAB在这里插入图片描述

ks=http://172.25.254.20/westos.cfg在这里插入图片描述

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值