1、安装需要的软件
(1)dhcp
(2)http
(3)tftp-server
(4)system-config-kickstart
(5)syslinux
[root@centos6 ~]# yum install dhcp http tftp-server system-config-kickstart syslinux
2、挂载光盘
[root@centos6 ~]# mkdir /media/Centos6 [root@centos6 ~]# mount /dev/sr0 /media/Centos6
[root@centos6 ~]# ls /media/Centos6
3、拷贝、创建相关引导文件及目录
[root@centos6 ~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/ [root@centos6 ~]# cp /media/Centos6/isolinux/* /var/lib/tftpboot/ [root@centos6 ~]# mkdir /var/lib/tftpboot/pxelinux.cfg/ [root@centos6 ~]# mkdir /var/www/html/Centos6 [root@centos6 ~]# cp /var/lib/tftpboot/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
4、编辑default文件
[root@centos6 ~]# vim /var/lib/tftpboot/pxelinux.cfg/default
添加ks=http://192.168.2.120/ks.cfg Ps: ks.cfg文件是kickstart生成的配置文件,下面有生成操作方法
5、编辑dhcpd.conf配置文件,之后启动service dhcpd start
6、编辑tftp配置文件,之后启动tftp
7、把光盘挂载到Centos6目录,并开启http服务
[root@centos6 ~]# mount --bind /media/Centos6 /var/www/html/Centos6 [root@centos6 ~]# service httpd start
8、图形模式下运行system-config-kickstart
system-config-kickstart生成的ks.cfg配置文件,此文件要保存到/var/www/html/目录
#platform=x86, AMD64, or Intel EM64T #version=DEVEL # Firewall configuration firewall --disabled # Install OS instead of upgrade install # Use network installation url --url="http://192.168.2.120/Centos6" # Root password rootpw --iscrypted $1$G69czo8b$LOPAMTfziVYr2xd7n2n2x/ # System authorization information auth --useshadow --passalgo=sha512 # Use text mode install text firstboot --disable # System keyboard keyboard us # System language lang en_US # SELinux configuration selinux --disabled # Installation logging level logging --level=info # Reboot after installation reboot # System timezone timezone Asia/Shanghai # Network information network --bootproto=dhcp --device=eth0 --onboot=on # System bootloader configuration bootloader --location=mbr # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --initlabel # Disk partitioning information part /boot --fstype="ext4" --size=500 part swap --fstype="swap" --size=1024 part / --fstype="ext4" --size=5000 %post mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo %end %packages @base %end
9、无人安装Centos 6系统,我用VMware Workstation Pro做演示
原创文章,作者:染,如若转载,请注明出处:http://www.178linux.com/20166