无人值守安装kickstart

      无人值守安装kickstarthtml

一.Kickstart简介linux

 (1原理:经过kickstart生成ks.cfg文件,过滤掉安装过程当中人工干预的部分,最终达到从网卡启动后可以自动安装系统直到完成从而实现了大规模部署安装操做系统.web

 (2)应用vim

    @1.当你须要大量的安装linux操做系统的时候*服务器

@2.PC机没有光驱或光驱损坏的时候网络

@3.须要常常安装操做系统的时候app

3软件需求:ide

        @1.dhcp服务器:分发ip地址,测试

        @2.tftp服务器:传输kernelinitrd等配置文件spa

        @3.web/nfs/ftp服务器:传输kickstart文件以及安装源

        @4.kickstart:把咱们须要手动选择的内容添加到文件里,让客户端可以自动执行。

二.具体配置

1.dhcp的配置


[root@tx1 ~]# yum install dhcp -y

ddns-update-style interim;

ignore client-updates;

subnet 192.168.8.0 netmask 255.255.255.0 {

# --- default gateway

       option routers                  192.168.8.1;

       option subnet-mask              255.255.255.0;

       option time-offset              -18000; # Eastern Standard Time

       range dynamic-bootp 192.168.8.100 192.168.8.200;

       default-lease-time 21600;

       max-lease-time 43200;

next-server 192.168.8.70;    //定索取pxelinux.0tftp服务器的ip

filename  "pxelinux.0";//指定须要加载的网络引导的bootloader文件

}

2.tftp的配置

注:tftp服务是一个基于xinetd的服务。

[root@tx1 ~]# cd /etc/xinetd.d

[root@tx1 xinetd.d]# vim tftp

server_args             = -s /tftpboot   //文件的保存目录

       disable                 = no        //开启tftp服务


[root@tx1 tftpboot]# cd linux-install/

[root@tx1 linux-install]# ls

msgs  pxelinux.0  pxelinux.cfg

注:若是没有这个目录,那么执行 find / -name pxelinux.0 ;找到这个文件以后,执行cp pxelinux.0 /tftpboot


[root@tx1 linux-install]# cp pxelinux.0 ..

[root@tx1 tftpboot]# mkdir pxelinux.cfg

[root@tx1 ~]# cd /mnt/cdrom/isolinux///去光盘里找所须要的参数文件以及内核和驱动文件:

[root@tx1 isolinux]# cp isolinux.cfg /tftpboot/pxelinux.cfg/default

[root@tx1 isolinux]# vim /tftpboot/pxelinux.cfg/default

 1 default ks

16 label ks

17   kernel vmlinuz

18   append ks=http://192.168.8.70/ks.cfg initrd=initrd.img

[root@tx1 isolinux]# cp vmlinuz /tftpboot/

[root@tx1 isolinux]# cp initrd.img /tftpboot/

[root@tx1 isolinux]# vim /etc/xinetd.conf

3.web的配置

[root@tx1 ~]# yum install httpd -y

[root@tx1 ~]# cd /var/www/html

[root@tx1 html]# mount /dev/cdrom ./iso   发布安装源

mount: block device /dev/cdrom is write-protected, mounting read-only


[root@tx1 html]# service httpd restart

Stopping httpd:                                            [FAILED]

Starting httpd:                                            [  OK  ]

4.配置ks文件

[root@tx1 ~]# yum install -y system-config-kickstart

[root@tx1 ~]# system-config-kickstart

1在基本配置里选择语言和输入密码

2在安装选项里选择http服务器的IP地址和目录

3在分区信息里调整分区表信息

4网络配置,点“add network device”—>“ok”

(5)单击file 选择保存文件

(6)编辑配置文件

[root@tx1 html]# vim ks.cfg

key --skip  把这个选项添加进去

5.客户端测试