pxe+dhcp+apache+kickstart无人值守安装系统centos
pxe+dhcp+apache+kickstart无人值守安装系统
挂载系统盘、
mkdir /mnt/cdrom mount /dev/cdrom /mnt/cdrom
关闭selinux、关闭防火墙
setenforce 0 /etc/init.d/iptables stop
安装apache服务(默认是安装的)
yum install apache -y
复制光盘的内容,到网站目录
cp -rf /mnt/cdrom/* /var/www/html/
安装tftp-server服务
yum install tftp-server -y
修改/etc/xinetd.d/tftp
cat /etc/xinetd.d/tftp
service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4 }
重启tftp-server,tftp是xinet下的服务,所以重启xinetd即可
/etc/init.d/xinetd restart
新建tftp-server文件夹
mkdir /tftpboot
安装syslinux、复制文件到tftp目录
yum install syslinux -y cp /usr/share/syslinux/pxelinux.0 /tftpboot/ cp /var/www/html/images/pxeboot/initrd.img /tftpboot/ cp /var/www/html/images/pxeboot/vmlinuz /tftpboot/ cp /var/www/html/isolinux/*.msg /tftpboot/ cd /tftpboot mkdir pxelinux.cfg cp /var/www/html/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
安装dhcp服务,并修改配置文件
yum install dhcp -y cat /etc/dhcp/dhcpd.conf
ddns-update-style interim; ignore client-updates; next-server 192.168.1.10; filename "/pxelinux.0"; subnet 192.168.1.0 netmask 255.255.255.0{ option routers 192.168.1.1; option subnet-mask 255.255.255.0; option nis-domain "aaa.com"; option domain-name "aaa.com"; option domain-name-servers 192.168.1.10; option time-offset -18000; range dynamic-bootp 192.168.1.50 192.168.1.100; default-lease-time 21600; max-lease-time 43200; }
/etc/init.d/dhcpd restart
安装system-config-kickstart服务
yum install system-config-kickstart -y
使用system-config-kickstart命令可以定制系统生成ks.cfg文件保存在/var/www/html下
cat /var/www/html/ks.cfg
#platform=x86, AMD64, 或 Intel EM64T #version=DEVEL # Firewall configuration firewall --disabled # Install OS instead of upgrade install # Use network installation url --url="http://192.168.1.10/" # Root password rootpw --iscrypted $1$0wsiMqf8$Pi4ilLUovQuihPbopJyyY/ # 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 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 --asprimary --fstype="ext4" --size=300 part / --asprimary --fstype="ext4" --grow --size=1 part swap --asprimary --fstype="swap" --size=1024 %packages @basic-desktop @desktop-debugging @desktop-platform @fonts @general-desktop @graphical-admin-tools @input-methods @kde-desktop @legacy-x @remote-desktop-clients @x11 %end
cat /tftpboot/pxelinux.cfg/default
default vesamenu.c32 default text timeout 600 display boot.msg menu background splash.jpg menu title Welcome to CentOS 6.3! menu color border 0 #ffffffff #00000000 menu color sel 7 #ffffffff #ff000000 menu color title 0 #ffffffff #00000000 menu color tabmsg 0 #ffffffff #00000000 menu color unsel 0 #ffffffff #00000000 menu color hotsel 0 #ff000000 #ffffffff menu color hotkey 7 #ffffffff #ff000000 menu color scrollbar 0 #ffffffff #00000000 label linux menu label ^Install or upgrade an existing system menu default kernel vmlinuz append initrd=initrd.img label vesa menu label Install system with ^basic video driver kernel vmlinuz append initrd=initrd.img xdriver=vesa nomodeset label rescue menu label ^Rescue installed system kernel vmlinuz append initrd=initrd.img rescue label local menu label Boot from ^local drive localboot 0xffff label memtest86 menu label ^Memory test kernel memtest append - label text kernel vmlinuz append initrd=initrd.img ks=http://192.168.1.10/ks.cfg
本文出自 “openatrium” 博客,请务必保留此出处http://5381589.blog.51cto.com/5371589/1641871
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。