首页 > 代码库 > kickstart无人职守安装
kickstart无人职守安装
1 先将需要安装的系统文件挂载到/mnt:
# mount -t cifs -o username=administrator,passwd=abcde //192.168.1.99/iso /mnt/
2 1-1 进入挂载的/mnt目录,RPM安装dhcp,tftp,kickstart:
#rpm -ivh *kickstart*
#rpm -ivh xinetd-2.3.14-10.el5.i386.rpm(tftp服务)
#rpm -ivh dhcp-3.0.5-23.el5.i386.rpm
rpm dhcp-devel-3.0.5-23.el5.i386.rpm
1-2 配置dhcpd:
# cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
# vi /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
filename "pxelinux.0";
next-server 192.168.1.22; (这里写入,不然的话系统会识别不到linux内核)
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.22;
option subnet-mask 255.255.255.0;
option nis-domain "domain.org";
option domain-name "domain.org";
option domain-name-servers 192.168.1.1;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.1.128 192.168.1.229;
default-lease-time 21600;
max-lease-time 43200;
# we want the nameserver to appear at a fixed address
host ns {
next-server 192.168.1.22;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 192.168.1.22;
}
}
#/etc/init.d/dhcpd
1-3 配置tftp:
# vi /etc/xinetd.d/tftp
将disable设置为no
#/etc/init.d/xinetd start
# netstat -a | grep tftp
udp 0 0 *:tftp *:* off (0.00/0/0
#cd /mnt/centos5/isolinux;cp * /tftpboot/;mkdir pxelinux.cf
然后将isolinux.cfg cp到新建的目录pxelinux.cf,更名为:default
#vi /tftpboot/pxelinux.cfg/default
default linux
prompt 0
timeout 1
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label linux
kernel vmlinuz
append ks=http://192.168.1.22/ks/ks.cfg initrd=initrd.img
label text
kernel vmlinuz
append initrd=initrd.img text
label ks
kernel vmlinuz
append ks initrd=initrd.img
label local
localboot 1
label memtest86
"default" 24L, 397C
我们将定义好的ks.cfg文件通过http访问打开,由此需要安装httpd(安装httpd步骤掠过)
1-4下面配置 kickstart:
# system-config-kickstart
其他选项按照自己的需求选择即可。这里我们将配置好的ks.cfg文件保存到/var/www/html/ks目录下
在
在/var/www/html/ks查看下ks.cfg文件:
下面我们将系统盘文件拷贝到nfs的连接:/var/www/html/centos5
vi /etc/exports
/var/www/html/centos5 *(rw)
启动nfs和pormap服务:然后通过客户机网卡启动安装(请确认关闭selinux与防火墙,不然客户端会连接不到tftp服务):
本文出自 “大王好帅” 博客,请务必保留此出处http://dawang.blog.51cto.com/4927689/1598896
kickstart无人职守安装