Linux CentOS PXE+Kickstart

来源:互联网 发布:sql仓库管理系统源代码 编辑:程序博客网 时间:2024/06/06 04:34

PXE+Kickstart安装条件和步骤

首先,大家如果看到有什么不懂的地方,欢迎吐槽!!!
我会在当天或者第二天及时回复,并且改进~~


安装条件

  • DHCP Server
  • TFTP Server
  • Kickstart 所生成的ks.cfg文件
  • 存放系统安装文件的服务器,如NFS,FTP,HTTP
  • 支持PXE的网卡NIC

思路

1、桌面  Desktop、Desktop Platform、Fonts、X Window System2、TFTP File(boot.msg/vmlinuz/initrd.img/pxelinux.0)         Directory pxelinux.cfg(default)3、DHCP 提供IP地址,并且指定TFTPServer 的IP地址和引导文件4、HTTP 提供系统文件的下载地址5、Kickstart  ks.cfg文件无需用户手动干预而无人值守安装系统

详细步骤
1、kickstart生成ks.cfg文件需要Desktop的支持

   yum -y groupinstall “Desktop” “Desktop Platform” “Fonts” “X Window System”   vi /etc/inittab  default:3 改为 default:5 | reboot

2、安装http服务。挂载镜像iso,并将镜像文件拷贝到http服务的”DocumentRoot”文档根目录下

   yum -y install httpd   mount /dev/cdrom /media   cp -rf  /media/* /var/www/html/

3、安装TFTP Server

   yum -y install tftp-server   vi /etc/xinetd.d/tftp       #将disable = yes 改为no   server_args = -s /tftpboot  #更改tftp服务目录

4、配置支持PXE的启动程序

   yum -y install syslinux   mkdir -p /tftpboot/pxelinux.cfg   cp  /var/www/html/isolinux/vmlinuz /tftpboot   cp  /var/www/html/isolinux/initrd.img /tftpboot   cp  /usr/share/syslinux/pxelinux.0 /tftpboot   cp  /var/www/html/*.msg /tftpboot   cp  /var/www/html/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default   vim /tftpboot/pxelinux.cfg/default        Default linux ks=http://192.168.10.199/ks.cfg  #在httpd文档目录下        Timeout 1  #超时时间改为1

5、配置DHCP服务器
在全局配置中加入:

   Filename “pxelinux.0”;   #指定引导系统启动的文件位置   Next-server 192.168.10.199;  #指定TFTP Server的位置

6、开始安装Kickstart,同时配置system-config-kickstart

   yum -y install system-config-kickstart   System-config-kickstart #在GNOME环境下执行并配置   Installation Method           http server     192.168.10.199         http Directory  /   Partition Information      Master Boot Record         Clear Master Boot Record      Partitions         Remove all existing partitions      Disk label         Initialize the disk label      Layout         依次根据需要划分,例如(/,/boot,/swap)

7、保存ks.cfg文件与httpd根目录

     /var/www/html

8、修改default文件

Vim defaultDefault linux ks=http://192.168.10.199/ks.cfgTimeout 1   Chkconfig httpd onChkconfig xinetd onChkconfig dhcpd onService httpd startService xinetd startService dhcpd startService iptables stopSetenforce 0Vi /etc/selinux/config  #disable

Ks.cfg 文件配置

#platform=x86, AMD64, or Intel EM64T        #硬件平台#version=DEVEL          # Firewall configuration                    #防火墙配置firewall --disabled# Install OS instead of upgrade             #安装or升级系统install# Use network installation                  #网络安装url --url="http://192.168.10.199/"# Root password                             #root 密码rootpw --iscrypted $1$nVrLmmxz$.QpCBfTN48BebDBb47YEQ1# System authorization information          #系统验证信息auth  --useshadow  --passalgo=sha512# Use graphical install                     #图形化安装graphicalfirstboot --disable# System keyboard                           #系统键盘设置keyboard us# System language                           #系统语言lang en_US# SELinux configuration                     #SELinux配置selinux --disabled# Installation logging level                #安装日志级别logging --level=info# System timezone                           #系统时区timezone  Asia/Shanghai# 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=300part swap --fstype="swap" --size=1024part / --fstype="ext4" --grow --size=1      #--grow --size=1 代表将剩余的所以后空间分配给/分区%packages@chinese-support%endReboot         #此选项必须存在,否则系统会让用户手动选择是否清除所有数据
0 0
原创粉丝点击