PXE无人值守安装linux

简介:

                    PXE无人值守安装linux

1.dhcp服务器安装

  用于为用户动态的分配ip地址

 [root@target ~]# mount /dev/cdrom /mnt/cdrom              //挂载镜像

 [root@target ~]# vim /etc/yum.repos.d/rhel-debuginfo.repo     //配置yum

 [root@target ~]# yum install dhcp                         //安装dhcp服务器

 [root@target ~]# vim /etc/dhcpd.conf                      //末行模式下执行如下命令获得配置文件   :r /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample    /

配置如下

 启动dhcp服务器,并且加入开机启动

 [root@target ~]# service dhcpd start

 [root@target ~]# chkconfig dhcpd on

2.配置ftp服务器

  用于提供系统安装所需的系统软件

  [root@target ~]# yum install vsftpd                              //安装服务器软件

  [root@target ~]# cp -R /mnt/cdrom/* /var/ftp/pub/                //把光盘中的系统文件copyftp中匿名文件夹中

  启动服务器,并设置开机启动

  [root@target ~]# service vsftpd start

  [root@target ~]# chkconfig vsftpd on

3.配置tftp服务器

  用于提供引导服务器安装时的终端配置

  [root@target ~]# yum install tftp-server                        //安装tftp软件

  [root@target ~]# vim /etc/xinetd.d/tftp                         //设置配置文件

  只需将disable=yes修改为 disable=no即可,用于设置tftp服务可启动

  [root@target ~]# service xinetd restart                         //启动tftp服务器(tftp是一个超级守护进程)

4.copy开机引导程序到tftp文件夹中

  [root@target ~]# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/         //ftfp的驱动文件 

  [root@target ~]# cp /mnt/cdrom/images/pxeboot/vmlinuz /tftpboot/  //pxe的内核文件

  [root@target ~]# cp /mnt/cdrom/images/pxeboot/initrd.img /tftpboot/  //启动时与硬件相关驱动

  [root@target ~]# mkdir -pv /tftpboot/pxelinux.cfg                  //pxe所需目录

  [root@target ~]# cp /mnt/cdrom/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default    //所需配置文件

5.安装无人值守程序

  [root@target ~]# yum install system-config-kickstart               //软件安装

  执行配置命令

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

  

 

 

 

 

保存配置

对保存的配置文件ks.cfg进行配置

 [root@target ~]# vim /root/ks.cfg 

 加入如下一行,可加任意地方

 

6.dhcp服务器中配置tftp服务器的查找

  将配置文件修改如下,只需加入两行

  [root@target ~]# vim /etc/dhcpd.conf  

重启服务

 [root@target ~]# service dhcpd restart

7.配置tftp服务器,指明ftp服务器

[root@target ~]# vim /tftpboot/pxelinux.cfg/default

 

最好修改默认时间,否则会等10分钟才能够启动程序

timeout修改为6秒:timeout 6

8.copy ks.cfgftp服务器中

  [root@target ~]# cp /root/ks.cfg /var/ftp/pub/

9.测试

  我们是在虚拟机里面重新安装一个系统,所以先要排除一些虚拟机安装的外在条件

  Tftp,ftpdhcp服务器要与安装的服务器在同一个网段中,我使用的是host-noly

  删除虚拟机本身的dhcp服务器

   配置参数

   

   

等待安装成功即可,如果刚刚安装后,启动失败,则重新启动即可,在启动时可能会因为sendmail的启动,影响启动速度,耐心等待!!










本文转自 guodong810 51CTO博客,原文链接:http://blog.51cto.com/guodong810/1143737,如需转载请自行联系原作者
目录
相关文章
|
10天前
|
缓存 Linux 测试技术
安装【银河麒麟V10】linux系统--并挂载镜像
安装【银河麒麟V10】linux系统--并挂载镜像
61 0
|
10天前
|
Linux C语言
linux yum安装ffmpeg 图文详解
linux yum安装ffmpeg 图文详解
28 0
|
10天前
|
NoSQL Linux Redis
linux 下和win下安装redis 并添加开机自启 图文详解
linux 下和win下安装redis 并添加开机自启 图文详解
15 0
|
10天前
|
Linux
linux yum 安装rar和unrar
linux yum 安装rar和unrar
35 0
|
3天前
|
关系型数据库 MySQL Linux
Linux联网安装MySQL Server
Linux联网安装MySQL Server
13 0
|
10天前
|
Java Linux 开发工具
linux jdk的安装
linux jdk的安装
16 0
|
18天前
|
Ubuntu Linux 虚拟化
【Linux】ubuntu安装samba服务器
【Linux】ubuntu安装samba服务器
|
11天前
|
Web App开发 Linux 网络安全
工作中常用到的Linux命令
工作中常用到的Linux命令
|
11天前
|
Web App开发 Java Linux
Linux之Shell基本命令篇
Linux之Shell基本命令篇
Linux之Shell基本命令篇