美文网首页
note_15.4_anaconda自动安装

note_15.4_anaconda自动安装

作者: 人間失格_430b | 来源:发表于2019-03-16 17:32 被阅读0次

CentOS 6.7 x86_64:

    minimal install

安装引导选项:

ks:指明kickstart文件的位置;
ks=
  DVD drive: ks=cdrom:/PATH/TO/KICKSTART_FILE
  Hard Drive: ks=hd:/DEVICE/PATH/TO/KICKSTART_FILE
  HTTP Server: ks=http://:80
  FTP Server: ks=ftp://:
  HTTPS Server: ks=https://:443

kickstart文件的格式

  • 命令段:
    指定各种安装前配置选项,如键盘类型等;
      必备命令
      可选命令
  • 程序包段:
    指明要安装程序包,以及包组,也包括不安装的程序包;
      %packages
      @group_name
      package
      -package
      %end
  • 脚本段:
    %pre:安装前脚本
      运行环境:运行安装介质上的微型Linux系统环境;
    %post:安装后脚本
      运行环境:安装完成的系统;

命令段中的必备命令:

authconfig:认证方式配置
  authconfig --enableshadow --passalgo=sha512
bootloader:定义bootloader的安装位置及相关配置
  bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
keyboard:设置键盘类型
  keyboard us
lang:语言类型
  lang zh_CN.UTF-8
part:分区布局;
  part /boot --fstype=ext4 --size=500
  part pv.008002 --size=51200
rootpw:管理员密码
  rootpw --iscrypted $6$4Yh15kMGDWOPtbbW$SGax4DsZwDAz4201.O97WvaqVJfHcISsSQEokZH054juNnoBmO/rmmA7H8ZsD08.fM.Z3Br/67Uffod1ZbE0s.
timezone:时区
  timezone Asia/Shanghai

补充:分区相关的其它指令
clearpart:清除分区
  clearpart --none --drives=sda:清空磁盘分区;
volgroup:创建卷组
  volgroup myvg --pesize=4096 pv.008002
logvol:创建逻辑卷
  logvol /home --fstype=ext4 --name=lv_home --vgname=myvg --size=5120

生成加密密码的方式:
  ~]# openssl passwd -1 -salt `openssl rand -hex 4`

可选命令:
  install OR upgrade:安装或升级;
  text:安装界面类型,text为tui,默认为GUI
  network:配置网络接口
    network --onboot yes --device eth0 --bootproto dhcp --noipv6
  firewall:防火墙
    firewall --disabled
  selinux:SELinux
    selinux --disabled
  halt、poweroff或reboot:安装完成之后的行为;
  repo:指明安装时使用的repository;
    repo --name="CentOS" --baseurl=cdrom:sr0 --cost=100
  url: 指明安装时使用的repository,但为url格式;
    url --url=http://172.16.0.1/cobbler/ks_mirror/CentOS-6.7-x86_64/

参考官方文档:《Installation Guide》

系统安装完成之后禁用防火墙:

  • CentOS 6:
        # service iptables stop
        # chkconfig iptables off
  • CentOS 7:
        # systemctl stop firewalld.service
        # systemctl disable firewalld.service

系统安装完成后禁用SELinux:

编辑/etc/sysconfig/selinux或/etc/selinux/config文件,修改SELINUX参数的值为下面其中之一:
  permissive
  disabled
立即生效:
  # getenforce
  # setenforce 0

定制kickstart文件

  # yum install system-config-kickstart
  # system-config-kickstart
检查语法错误:
  # ksvalidator

创建光盘镜像:

    ~]# mkisofs -R -J -T -v --no-emul-boot --boot-load-size 4 --boot-info-table -V "CentOS 6 x86_64 boot" -c isolinux/boot.cat -b isolinux/isolinux.bin -o  /root/boot.iso   myboot/

相关文章

网友评论

      本文标题:note_15.4_anaconda自动安装

      本文链接:https://www.haomeiwen.com/subject/aslsmqtx.html