半自动化安装系统(本地引导)
2017-09-28 09:39
204 查看
一、kickstart文件的制作方法1
使用system-config-kickstart制作kickstart
system-config-kickstart #没有安装的话使用epel源yum安装 yum -y install system-config-kickstart‘ #注意,system-config-kickstart必须在图形桌面环境运行
各项解释
Basic Configuration:指明各种安装前配置,如键盘类型等1.语言 2.键盘类型 3.时区 4.将当前系统时间作为UTC时间 5.root用户密码 6.在kickstart中,root密码加密 7.体系结构 8.安装后是否重启 9.perform installation in text mode (graphical default) 在文本模式进行安装(图形默认)
Installation Method
1.安装方式’ 安装一个新的 安装一个已经存在的 2.安装源
Boot Loader Options
Partition Information
Centos7 BUG在Package Selection选项
需要修改 /etc/yum.repos.d/base.repo 把[base] 改为[development]即可
二、kickstart文件
生成的kickstart文件
#platform=x86, AMD64, or Intel EM64T #version=DEVEL # Install OS instead of upgrade install # Keyboard layouts keyboard 'us' # Root password rootpw --iscrypted $1$gKnEUhgA$5EeYyX7tBEzS9QueZjlsj1 # Use network installation url --url="http://172.17.0.1/centos/7" # System language lang en_US # Firewall configuration firewall --disabled # System authorization information auth --useshadow --passalgo=sha512 # Use text mode install text # SELinux configuration selinux --disabled # Do not configure the X Window System skipx # Network information network --bootproto=static --device=eth0 --gateway=172.17.0.1 --ip=172.17.0.200 --netmask=255.255.0.0 # Reboot after installation reboot # System timezone timezone Asia/Shanghai # System bootloader configuration bootloader --location=mbr --boot-drive=sda # Partition clearing information clearpart --all --initlabel # Disk partitioning information part /boot --fstype="ext4" --size=1024 part /home --fstype="ext4" --size=50000 part swap --fstype="swap" --size=4096 part / --fstype="ext4" --size=50000 %post rm -rf /etc/yum.repos.d/* cat > /etc/yum.repos.d/base.repo <<EOF [development] name=yum-base-centos-$releasever baseurl=http://172.16.0.1/centos/$releasever/ gpgcheck=0 enabled = 1 [epel] name=epel baseurl=http://172.17.0.1/fedora-epel/$releasever/x86_64/ gpgcheck=0 enabled=1 EOF useradd muzigan echo muzigan |paswd --stdin muzigan mkdir /root/.ssh cat > /root/.ssh/authorized_keys <<EOF ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCRdZZhKgHvdIirAoE3l951Zsmds3pybWVDy3JU93J3HCm5/YX5O/K5cCxz1f/r5M7P7uqHUGk94YwkNg4h960Xy87WBYgHL0E6sr4RemT0OU8RhC+zdsEW3jbdaOaHkyfGbfmeIPaPYNl64/wJ5mU3pWzIuXB96MltPtb33l34OGTZJI0I4edV/QVfHw0R2O2Nez7FO14sf+URcLEVwws/9YehhZV2bNirXwSjefJqh9F7w1CHBjQuGgpX6585+YVjKgw8AkyadmhLxYx/eJJGjb5vEXBjL/Hw8Oqljjkn0k8lmyTbmDrdcf9AtyBNHKh8quNxtqtz+SGq142N4w0X root@localhost.localdomain EOF %end
kickstart文件格式
kickstart文件的格式 命令段: 指明各种安装前配置,如键盘类型等 命令段中的命令: 必备命令 authconfig: 认证方式配置 authconfig --useshadow --passalgo=sha512 bootloader: bootloader的安装位置及相关配置 bootloader --location=mbr --driveorder=sda – append="crashkernel=auto rhgb quiet" keyboard: 设定键盘类型 lang: 语言类型 part: 创建分区 rootpw: 指明root的密码 timezone: 时区 kickstart文件的格式 可选命令 install OR upgrade text: 文本安装界面 network firewall selinux halt poweroff reboot repo user:安装完成后为系统创建新用户 url: 指明安装源 key –skip 跳过安装序列号,适用于rhel版本 程序包段: 指明要安装的程序包组或程序包,不安装的程序包等 %packages @group_name package -package %end 脚本段: %pre: 安装前脚本 运行环境:运行于安装介质上的微型Linux环境 %post: 安装后脚本 运行环境:安装完成的系统
三、将kickstart文件放入ftp服务下
systemctl status vsftpd cp ks.cfg /var/ftp/pub/
四、使用kickstart文件安装一个新的系统
注意:需要从对应版本光盘引导在引导界面
ESC linux ks=ftp://172.17.0.117/pub/ks.cfg
注意:在centos7中安装过程中需要输入b; 才能 开始安装 但在centos6中不需要,只要在生成ks文件时不选择交互式安装的选项就好
五、成功
安装后的脚本测试安装的新系统包太少,不支持yum源中的$releasever变量;所以应该改为对应版本号
sed -r "s/.* ([0-9]+)[.].*/\1/" /etc/redhat-release
相关文章推荐
- Linux用PXE自动化安装系统和制作引导盘
- PXE网络引导自动化安装系统详解
- 本地自动化安装CentOS系统
- PXE网络引导自动化安装系统详解
- TQ2440,学习笔记之安装 系统引导安装程序+嵌入式linux系统
- ubuntu安装完成出现引导系统grub提示:invalid arch independent ELF magic
- 解决Windows10下安装Ubuntu16.04双系统后开机没有Ubuntu引导
- 初涉定制linux系统之——自动化安装Centos系统镜像制作
- Kickstart+PXE网络自动化Centos系统安装
- 系统自动化安装
- Cobbler6.4 linux系统自动化安装脚本
- Windows7电脑装ubuntu系统成双系统,使用easyBCD建立引导而不使用U盘和使用U盘来进行启动安装。
- 红帽系Linux系统安装流程及自动化安装
- Cobbler自动化批量安装系统服务搭建详解
- 先安装Linux再安装windows双系统引导项处理
- Win7和Centos7 安装后修改系统默认引导设置
- 用苹果系统制作U盘引导安装苹果系统
- 在有UEFI引导系统下的win10中安装双系统ubuntu的注意点
- 帝国网站管理系统本地安装图文教程
- 安装CentOS、Linux系统时,GPT分区不能引导的解决方法