CentOS 7.0全自动安装光盘制作详解1 复制光盘文件1 )挂载 iso 镜像创建目录用于挂载光盘: mkdir /root/centos7挂载 iso 镜像 mount -o loop CentOS-7.0-1406-x86_64-DVD.iso/root/centos72 )复制光盘文件到编辑目录进行编辑因为挂载上 iso 镜像是只读的,如果要编辑,需要将文件复制出来,再编辑。首先创建编辑目录: mkdir /root/centos7_iso复制光盘文件: cp -rf /root/centos7/* /root/centos7_iso/diskinfo 文件需求单独拷贝下: cp /root/centos7/.discinfo /root/iso2 编辑 ks.cfg 文件系统安装的时候,按照 ks.cfg 文件的内容进行安装,我们把 ks.cfg 文件放到 isolinux 目录下: cd /root/centos7_iso/isolinux vim ks.cfg我的 ks.cfg 文件内容如下: #version=RHEL/CentOS7 by xiaoli110 install # Keyboard layouts keyboard "us" # Reboot after installation reboot # Run the Setup Agent on first boot firstboot --enable ignoredisk --only-use=sda # Keyboard layouts keyboard --vckeymap=us --xlayouts="cn" # System language lang zh_CN.UTF-8 # Network information #network --bootproto=dhcp --device=enp2s0 --onboot=off --ipv6=auto #network --bootproto=dhcp --device=enp3s0 --onboot=off --ipv6=auto #network --hostname=localhost.localdomain # Root password rootpw --iscrypted 111111111111111111111111111 # System timezone timezone Asia/Shanghai # System language lang zh_CN # Firewall configuration firewall --enabled --ssh
# System authorization information auth --useshadow --passalgo=sha512 # Use CDROM installation media cdrom # Use graphical install graphical # SELinux configuration selinux --disabled # Do not configure the X Window System skipx # System bootloader configuration bootloader --location=mbr # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all # Disk partitioning information part /boot --fstype="xfs"--size=500 part /boot/efi --fstype="xfs"--size=500 part swap --fstype="swap"--size=16000 part / --fstype="xfs" --grow--size=1