CentOS 6.5 PXE一键安装Linux操作系统
#安装配置DHCP yum -y install dhcp cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf vim /etc/dhcp/dhcpd.conf subnet 192.168.3.0 netmask 255.255.255.0 { range 192.168.3.100 192.168.3.200; option domain-name-servers server.example.com; option domain-name "8.8.8.8"; option routers 192.168.3.1; option broadcast-address 192.168.3.255; next-server 192.168.3.100; filename "pxelinux.0"; default-lease-time 60000; max-lease-time 720000; } service dhcpd start chkconfig dhcpd on #配置xinetd服务器 yum -y install syslinux tftp-server vim /etc/xinetd.d/tftp disable=no service xinetd start chkconfig xinetd on #拷贝引导文件 cd /var/lib/tftpboot cp /mnt/isolinux/* . cp /usr/share/syslinux/pxelinux.0 . mkdir pxelinux.cfg cd pxelinux.cfg cp /mnt/isolinux/isolinux.cfg ./default vim default label Install RHEL6.5 kernel vmlinuz append initrd=initrd.img ks=nfs:192.168.3.100:/var/lib/tftpboot/ks.cfg #配置NFS服务 yum -y install nfs* mkdir /rhel6 mount /dev/cdrom /rhel6 vim /etc/exports /rhel6 192.168.3.0/24(rw,sync) service nfs start chkconfig nfs on yum -y install system-config-kickstgart system-config-kickstart #创建一键安装脚本 #手动写入脚本 #platform=x86, AMD64, or Intel EM64T #version=DEVEL # Firewall configuration firewall --disabled # Install OS instead of upgrade install # Use NFS installation media nfs --server=192.168.3.100 --dir=/mnt # Root password rootpw --iscrypted $1$3X.jwnPp$90YJQkQsBqTdL4aPRsgKc/ # System authorization information auth --useshadow --passalgo=sha512 # Use graphical install graphical firstboot --disable # System keyboard keyboard us # System language lang en_US # SELinux configuration selinux --enforcing # Installation logging level logging --level=info # Reboot after installation reboot # System timezone timezone --isUtc 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=200 part / --fstype="ext4" --grow --size=1 %packages @basic-desktop @desktop-debugging @desktop-platform @fonts @general-desktop @graphical-admin-tools @input-methods @kde-desktop @legacy-x @remote-desktop-clients @x11 %end
本文出自 “吴善强” 博客,请务必保留此出处http://shanqiangwu.blog.51cto.com/8067564/1653988
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。