system-config-kickstart使用安装Centos7的

一.使用system-config-kickstart命令一个图形界面配置。

在centos7中需要安装这个命令。yum -y install system-config-kickstart

我在本地配置了一个http,用光盘启动之后按ECS进入boot启动命令行

输入 linux ks=url  url为kick start的地址

记录下kickstart文件的格式

 1 #platform=x86, AMD64, or Intel EM64T
 2 #version=DEVEL
 3 # Install OS instead of upgrade
 4 install
 5 # Keyboard layouts
 6 keyboard 'us'
 7 # Root password
 8 rootpw --plaintext centos
 9 # System language
10 lang en_US
11 # System authorization information
12 auth  --useshadow  --passalgo=sha512
13 # Use text mode install
14 text
15 firstboot --disable
16 # SELinux configuration
17 selinux --disabled
18 # Do not configure the X Window System
19 skipx
20 
21 
22 # Firewall configuration
23 firewall --disabled
24 # Network information
25 network  --bootproto=dhcp --device=eth0
26 # Reboot after installation
27 reboot
28 # System timezone
29 timezone Asia/Shanghai
30 # Use network installation
31 url --url="http://192.168.56.8/centos7/os/x86_64/"
32 # System bootloader configuration
33 bootloader --append="net.ifnames=0" --location=mbr
34 # Clear the Master Boot Record
35 zerombr
36 # Partition clearing information
37 clearpart --all --initlabel
38 # Disk partitioning information
39 part / --fstype="xfs" --size=20000
40 part /boot --fstype="xfs" --size=1024
41 part swap --fstype="swap" --size=4096
42 part /data --fstype="xfs" --size=50000
43 
44 %post
45 useradd xiaoming
46 echo "centos" | passwd --stdin xiaoming
47 touch /etc/yum.repos.d/epel.repo
48 cat > /etc/yum.repos.d/epel.repo <<EOF
49 [epel]
50 baseurl=https://mirrors.aliyun.com/epel/7/x86_64/
51 gpgcheck=1
52 gpgkey=https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-7
53 enabled=1
54 EOF
55 %end

此文只为留下一个kickstart文件格式的参考。

posted on 2019-11-12 18:11  林之森火  阅读(1534)  评论(0编辑  收藏  举报

导航