Linux CentOS PXE+Kickstart

PXE+Kickstart安装条件和步骤

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



安装条件

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

思路

1、桌面  Desktop、Desktop Platform、Fonts、X Window System
2、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 default
Default linux ks=http://192.168.10.199/ks.cfg
Timeout 1   

Chkconfig httpd on
Chkconfig xinetd on
Chkconfig dhcpd on

Service httpd start
Service xinetd start
Service dhcpd start
Service iptables stop
Setenforce 0
Vi /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                     #图形化安装
graphical
firstboot --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=300
part swap --fstype="swap" --size=1024
part / --fstype="ext4" --grow --size=1      #--grow --size=1 代表将剩余的所以后空间分配给/分区

%packages
@chinese-support

%end
Reboot         #此选项必须存在,否则系统会让用户手动选择是否清除所有数据
时间: 2024-07-28 22:24:05

Linux CentOS PXE+Kickstart的相关文章

Ubuntu配置PXE+Kickstart+TFTP+DHCP实现快速布署Linux操作系统

这里使用的Server环境是 Ubuntu Server 12.04 1.安装所需软件包 # apt-get install  system-config-kickstart dhcp3-server tftpd-hpa tftp-hpa debmrror 安装配置一下VNC,并开户远程连接上去,VNC的配置省略 # system-config-kickstart 弹出上面的一个图形界面配置窗,配置完成之后,保存文件到/var/www/ubuntu/下,命令为ks.cfg,为以后提供服务打下基础

Linux CentOS下shell显示-bash-4.1$不显示用户名路径

  Linux CentOS下shell显示-bash-4.1$不显示用户名路径的解决方法 问题描述: CentOS下新增一个用户,登录进去之后shell脚本的信息如下: 而不是我们经常看到的username@hostname的组合,看起来很不舒服. 解决方案: 问题的原因是因为没有配置.bash_profile的问题,可以通过配置这个文件来解决问题. 1.在Terminal输入: [plain] vi ~/.bash_profile 2.如果没有.bash_profile可以自己添加.然后往文

Linux CentOS Mysql修改默认端口

  为了提高服务器的安全性,本节课主要讲的是Linux下如何修改Mysql端口.支持Linux环境下大部分系统的修改,如Centos和Ubuntu等. 演示环境: Linux CentOS 6.3 X32 Mysql 5.1.66 一.编辑my.conf vi /etc/my.conf 二.在[mysqld]下添加port=3506 三.重启mysql服务 #/etc/init.d/mysqld restart Tips: 0.3506是你想要修改的端口; 1.修改后记得将端口添加进iptabl

linux服务器-Linux CentOS 6.2远程服务器 安装jdk 不成功~~~~~~

问题描述 Linux CentOS 6.2远程服务器 安装jdk 不成功~~~~~~ [root@S476320 ~]# rpm -ivh jdk-7u25-linux-i586.rpm Preparing... ########################################### [100%] 1:jdk ########################################### [100%] error: unpacking of archive failed

Linux(Centos)全自动异地备份数据(WEB+Mysql)

中介交易 http://www.aliyun.com/zixun/aggregation/6858.html">SEO诊断 淘宝客 云主机 技术大厅 文章开始之前,先问下各位站长一个问题:什么东西对于站长是十分重要的?其实对于站长而言,很多东西都是很重要的.但我们现在排除外在因素,把范围缩小到网站系统本身,哪些是非常重要的呢?网站数据就是其中之一了. 网站数据包括程序文件本身.网站运行过程中不断产生的附件数据(图片.文档.视频等)以及数据库文件,三大块总括为网站数据. 以自己为例,在这两年

linux centos系统硬盘已经满了(提示超过90%使用),但是df查看磁盘空间只占用了40%

问题描述 linux centos系统硬盘已经满了(提示超过90%使用),但是df查看磁盘空间只占用了40% linux centos系统硬盘已经满了(提示超过90%使用),但是df查看磁盘空间只占用了40%为什么?该如何解决呢?谢谢 解决方案 1.centos有时在统计磁盘空间的时候存在误差,特别是在虚拟机上,建议你先重启一下系统,然后再用df命令看看磁盘空间. 解决方案二: 先用df查看一下磁盘空间分布状态.是不是有临时文件占用了 解决方案三: find path -type f -size

Linux(CentOS)中常用软件安装,使用及异常——MySQL, VmTools

本文主要是为了记录在工作中遇到的常用软件的安装过程,方便以后遇到相同情形时可以快速的查阅.主要讲述了MySQL, VMTools的安装. 本文的操作系统采用的是CentOS,可以采用shell命令查阅:lsb_release -a. Mysql的安装 Mysql的安装 mysql的下载地址:http://dev.mysql.com/downloads/mysql/#downloads,截止目前(2016-08-21)最新的版本是5.7, 本文介绍的mysql的版本是5.5.(mysql>sele

linux Centos 服务器之间文件共享挂载

linux Centos (6.6)服务器之间文件共享挂载 目的:因为服务器设置了负载均衡,多服务器的文件上传必然要同步,这里的目的把服务器1设置为主文件服务器 服务器1:192.168.1.100 服务器2:192.168.1.20 风来了.呆狐狸 安装基础所需套件[每台] 1.nfs yum install nfs-utils 2.设置服务自启动 chkconfig rpcbind on chkconfig nfs on 3.启动服务 service rpcbind start servic

linux centos 安装 vmware tool

问题描述 linux centos 安装 vmware tool 小弟刚开始学习linux,请问我已经成功的安装成功vmware tool 然后也设置的共享的文件夹 但是怎么在mnt/hgfs下没有共享的文件夹呢?希望大神们能帮解答 解决方案 设置共享的文件夹后还要再运行vmware-config-tools.pl 解决方案二: 工具-->安装VMware Tools.然后加载光驱. mount /dev/cdrom /mnt/cdrom 切换到/tmp目录 cd /tmp 解压安装包到当前目录