RHEL5 kickstart 安装小结

环境简介

系统版本:RHEL5 32位

内核版本:2.6.18-8.el5 i686

系统所需服务:tftp、dhcp、ftp、yum

创建ftp

[root@rhel5-1 ~]# rpm -qa | grep vsftp

vsftpd-2.0.5-10.el5

如上面所示安装好vsftp后可以做下面工作。

搭建YUM源

这里使用创建本地yum源,并且yum源所在根目录为ftp默认目录

[root@rhel5-1 ~]# mount /dev/cdrom /mnt/

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

[root@rhel5-1 ~]# cp -Rap /mnt/* /var/ftp/pub/

[root@rhel5-1 ~]# vi /etc/yum.repos.d/rhel5.repo

[Server]

name=Red Hat Enterprise Linux $releasever - $basearch - Debug

baseurl=file:///var/ftp/pub/Server

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[VT]

name=Red Hat Enterprise Linux $releasever - $basearch - Debug

baseurl=file:///var/ftp/pub/VT

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[Cluster]

name=Red Hat Enterprise Linux $releasever - $basearch - Debug

baseurl=file:///var/ftp/pub/Cluster

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[ClusterStorage]

name=Red Hat Enterprise Linux $releasever - $basearch - Debug

baseurl=file:///var/ftp/pub/ClusterStorage

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[root@rhel5-1 pub]# yum clean all

Loading "rhnplugin" plugin

Loading "installonlyn" plugin

Repository 'Cluster' is missing name in configuration, using id

Repository 'ClusterStorage' is missing name in configuration, using id

Repository 'VT' is missing name in configuration, using id

Repository 'Server' is missing name in configuration, using id

This system is not registered with RHN.

RHN support will be disabled.

Cleaning up Everything

[root@rhel5-1 pub]#cd /var/ftp/pub

[root@rhel5-1 pub]# createrepo .

2045/2208 - Server/jakarta-commons-collections-testframework-javadoc-3.1-6jpp.1.2208/2208 - VT/Virtualization-ko-KR-5.0.0-7.noarch.rpm

Saving Primary metadata

Saving file lists metadata

Saving other metadata

[root@rhel5-1 pub]# yum update

Loading "rhnplugin" plugin

Loading "installonlyn" plugin

Repository 'Cluster' is missing name in configuration, using id

Repository 'ClusterStorage' is missing name in configuration, using id

Repository 'VT' is missing name in configuration, using id

Repository 'Server' is missing name in configuration, using id

This system is not registered with RHN.

RHN support will be disabled.

Setting up Update Process

Setting up repositories

Cluster                   100% |=========================| 1.3 kB    00:00

ClusterStorage            100% |=========================| 1.3 kB    00:00

VT                        100% |=========================| 1.3 kB    00:00

Server                    100% |=========================| 1.3 kB    00:00

Reading repository metadata in from local files

primary.xml.gz            100% |=========================| 6.4 kB    00:00

################################################## 32/32

primary.xml.gz            100% |=========================| 4.2 kB    00:00

################################################## 32/32

primary.xml.gz            100% |=========================| 6.0 kB    00:00

################################################## 31/31

primary.xml.gz            100% |=========================| 663 kB    00:00

################################################## 2113/2113

No Packages marked for Update/Obsoletion

利用YUM安装服务

[root@rhel5-1 pub]# yum install tftp

[root@rhel5-1 pub]# yum install tftp-server

[root@rhel5-1 pub]# yum install dhcp

[root@rhel5-1 pub]# yum install system-config-kickstart

配置服务

配置tftp

[root@rhel5-1 pub]# vi /etc/xinetd.d/tftp

# default: off

# description: The tftp server serves files using the trivial file transfer \

#       protocol.  The tftp protocol is often used to boot diskless \

#       workstations, download configuration files to network-aware printers, \

#       and to start the installation process for some operating systems.

service tftp

{

socket_type             = dgram

protocol                = udp

wait                    = yes

user                    = root

server                  = /usr/sbin/in.tftpd

server_args             = -s /tftpboot

disable                 = no

per_source              = 11

cps                     = 100 2

flags                   = IPv4

}

配置PXE启动

[root@rhel5-1 ~]# mount /dev/cdrom /mnt/

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

[root@rhel5-1 pub]#cp/usr/lib/syslinux/pxelinux.0 /tftpboot/

[root@rhel5-1 pub]#cd /tftpboot/

[root@rhel5-1 pub]#mkdir/tftpboot/pxelinux.cfg

[root@rhel5-1 pub]#cp/mnt/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default

[root@rhel5-1 pub]#cp/mnt/p_w_picpaths/pxeboot/initrd.img /tftpboot/

[root@rhel5-1 pub]#cp/mnt/p_w_picpaths/pxeboot/vmlinuz /tftpboot/

[root@rhel5-1 pub]#chmodu+w/tftpboot/pxelinux.cfg/default //文件默认只读

[root@rhel5-1 pub]#vi /tftpboot/pxelinux.cfg/default

default linux

prompt 1

timeout 100                        #超时原来为600s,这里配置100s

display boot.msg

F1 boot.msg

F2 options.msg

F3 general.msg

F4 param.msg

F5 rescue.msg

label linux

kernel vmlinuz

append initrd=initrd.img ks=ftp://192.168.10.50/pub/ks.cfg #指向ks.cfg的配置文件。

label text

kernel vmlinuz

append initrd=initrd.img text

label ks

kernel vmlinuz

append ks initrd=initrd.img

label local

localboot 1

label memtest86

kernel memtest

append -

配置DHCP

[root@rhel5-1 pub]# vi /etc/dhcpd.conf

ddns-update-style none;

ignore client-updates;

subnet 192.168.10.0 netmask 255.255.255.0 {

filename                        "pxelinux.0";

next-server                     192.168.10.50;#next-server即PXE服务器

# --- default gateway

option routers                  192.168.10.254;

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

#       option ntp-servers              192.168.1.1;

#       option netbios-name-servers     192.168.1.1;

#       option netbios-node-type 2;

range dynamic-bootp 192.168.10.200 192.168.10.202;#地址池

default-lease-time 21600;

max-lease-time 43200;

配置ftp

FTP默认不用配置,将yum本地源配置在/var/ftp/pub后,启动FTP服务即可。

配置kickstart

在图形界面的终端里输入:system-config-kickstart后,kickstart会以图形界面的形式出现,根据要求配置后会生成一个ks.cfg的kickstart的配置引导文件,将此文件复制到/var/ftp/pub下。ks.cfg的内容如下:

#platform=x86, AMD64, or Intel EM64T

# System authorization information

auth  --useshadow  --enablemd5

# System bootloader configuration

bootloader --location=mbr

# Partition clearing information

clearpart --linux --initlabel

# Use graphical install

graphical

# Firewall configuration

firewall --disabled

# Run the Setup Agent on first boot

firstboot --disable

key --skip

# System keyboard

keyboard us

# System language

lang en_US

# Installation logging level

logging --level=info

# Use network installation

url --url=ftp://192.168.10.50/pub

# Network information

network --bootproto=dhcp --device=eth0 --onboot=on

# Reboot after installation

reboot

#Root password

rootpw  123456

# SELinux configuration

selinux --disabled

# System timezone

timezone  Asia/Urumqi

# Install OS instead of upgrade

install

# X Window System configuration information

xconfig  --defaultdesktop=GNOME --depth=8 --resolution=640x480 --startxonboot

# Disk partitioning information

part /boot --bytes-per-inode=4096 --fstype="ext3" --size=1028

part swap --bytes-per-inode=4096 --fstype="swap" --size=2048

part / --bytes-per-inode=4096 --fstype="ext3" --grow --size=1

%packages

@admin-tools

@base

@chinese-support

@core

@development-libs

@development-tools

@dialup

@editors

@ftp-server

@gnome-desktop

@gnome-software-development

@java

@java-development

@legacy-software-development

@legacy-software-support

@ruby

@system-tools

@text-internet

@x-software-development

@base-x

kexec-tools

device-mapper-multipath

imake

emacs

audit

mesa-libGLU-devel

xorg-x11-utils

xorg-x11-server-Xnest

xorg-x11-server-Xvfb

启动服务

[root@rhel5-1 pub]#service dhcpd start

[root@rhel5-1 pub]#service vsftpd start

[root@rhel5-1 pub]#service xinetd start

[root@rhel5-1 pub]#chkconfig dhcpd on

[root@rhel5-1 pub]#chkconfig vsftpd on

[root@rhel5-1 pub]#chkconfig xinetd on

注意在配置过程要关闭防火墙和selinux。

测试客户端

将客户端服务器通过pxe启动后,如果配置正确所有安装均会无人职守化安装。

问题备注:

问题1:

在kickstart安装过程中常会遇到各种错误,现在将我在配置中所遇到的错误进行注解。

如上错误是显示关于在安装过程中无法找到镜像文件的库信息和安装目录树,在这里要明确注意,如果你的YUM和发布的安装源文件都是一个目录文件,那么就会造成如图上面的问题,原因是在搭建YUM过程中要重新的生成其库安装索引,这个会与安装源文件的MD5校验产生冲突,所以会显示YUM可以使用,但是在kickstart安装过程中会产生各种蹊跷的问题。

解决办法

为了解决这个问题最好YUM源和安装文件源使用两个不同的文件目录,并且将对应修改的内容添加至ks.cfg文件。在安装文件的发布我使用原来光盘镜像挂载的方法,这样就可以减少对安装源文件的修改,从而避免错误的发生。

问题2:

在真实的安装环境当中,很多服务器都是双网卡,如果在按照上面配置去做,不能真正实现kicksart无人值守化安装,在多网卡环境当中,虽然安装时只接入一块网卡,但是在anaconda安装执行时会自动监测到系统存在双网卡,安装过程会让手动选择从哪个网卡启动,在RHEL6中也有同样问题存在。虽然在ks文件中写明了eth0网卡用dhcp获得地址,但是还会有问题存在,如下所示:

network  --bootproto=dhcp --device=eth0 --onboot=on

上面说明了eth0网卡用dhcp获得地址,但是在安装过程中,anaconda安装执行时会自动监测到系统存在双网卡,安装过程会让手动选择从哪个网卡启动,所以上面配置无法解决现有的问题。

若有很多服务器同时安装那么选择网卡也是很麻烦的问题。在REDhat kickstart中,这个问题可以在tftp服务器引导文件照中解决,在default 中添加一个ksdevice参数,如下所示:

label linux
  kernel vmlinuz
  append ksdevice=eth0 initrd=initrd.img ks=ftp://192.168.2.1/pub/ks.cfg

ksdevice=eth0,即从第一块网卡启动,这样就制定了启动网卡,而anaconda也会从eth0网卡执行安装程序。

转载于:https://blog.51cto.com/zhaoguohui/1090074

RHEL5 kickstart 安装小结相关推荐

  1. RHEL5+PXE+DHCP+Apache+Kickstart安装RHCE5.1 i386实验室环境

    此博文出自:http://andrewyu.blog.51cto.com/1604432/1100567 使用RHEL5+PXE+DHCP+Apache+Kickstart安装RHCE5.1 i386 ...

  2. 无人值守安装linux,RHEL5无人值守安装图文攻略

    之前,发的一个文字版本,现在整理一个图解详细版,让每个人都可以实现RHEL5的无人值守安装. 测试环境:Redhat 5.3 关闭iptables 和Selinux 所需服务:Dhcp Vsftp T ...

  3. rhel5.5安装xwindow

    rhel5.5安装xwindow 1安装xwindow  yum groupinstall "X Window System" 2.安装GNOME桌面环境  yum groupin ...

  4. Linux的kickstart安装详解

    一.什么是kickstart? kickstart安装是redhat开创的按照你设计好的方式全自动安装系统的方式.安装方式能分为光盘.硬盘.和网络.此文将以网络安装方式周详介绍使用kickstart的 ...

  5. 利用Kickstart安装的方法

    LINUX使用Kickstart进行安装 一.应用   1.无人值守安装   2.批量自动安装 二.方法   1.使用Kickstart进行安装的过程     1>.创建Kickstart配置文 ...

  6. kickstart 安装CentOS GPT分区的完整ks示例

    kickstart 安装CentOS GPT分区的完整ks示例: 重点有2个(第1个网上写的很多,但第2个也是不能少的或不能写错的): 1. %pre parted -s /dev/sda mklab ...

  7. kickstart安装

    kickstart是什么         许多系统管理员宁愿使用自动化的安装方法来安装红帽企业 Linux.为了满足这种需要,红帽创建了kickstart安装方法.使用kickstart,系统管理员可 ...

  8. KickStart安装Linux

    KickStart安装Linux 原文章名字为<使用PXE+DHCP+Apache+KickStart无人值守安装RHEL>. 安装需要:1)DHCP服务器           2)TFT ...

  9. linux征程之kickstart安装操作系统

    linux征程之kickstart安装操作系统 网络安装系统的原理 当主板bios里选择使用网络安装时,会使用PXE协议来安装操作系统.PXE(Pre-boot Execution Environme ...

最新文章

  1. MySQL数据库右连接查询right join ... on
  2. 【编译原理】关于NFA和DFA-集合定义的探索
  3. python编程入门到实践目录-Python编程从入门到实践笔记——文件
  4. 打印矩阵 java_【Java】 剑指offer(29) 顺时针打印矩阵
  5. 局域网聊天程序 java MySQL_课内资源 - 基于JAVA的局域网聊天软件的设计与实现(仿制QQ)...
  6. 给服务器mongodb设置权限_认识 MongoDB
  7. 【数据结构的魅力】005.链表问题专项
  8. freertos nand flash 读取错误_Flash失效小谈
  9. 【Oracle】进阶知识进一步了解
  10. HTML5基础知识习题 一
  11. 零基础学Arcgis(十二)地图标注与注记
  12. BP神经网络简单代码分析
  13. 欧拉公式求四面体体积
  14. android手机截图功能,安卓手机怎么截屏?三星/华为/小米等手机截图方法
  15. python html转pdf 调整大小_用Python将HTML转为PDF。
  16. 交换机端口隔离功能的使用意义
  17. 苹果 iTunes connect 下架APP
  18. Principal Component Analysis(PCA)
  19. 联想拯救者r9000p原装海力士固态4k64位读写慢的解决
  20. 【JS】使用onclick方法把对象本身传输给方法

热门文章

  1. 多层数据源处理复杂数据结构
  2. MySQL在登陆时出现ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)错误...
  3. HA总结:AWS 网络连接
  4. Linux下使用OTL操作mysql数据库
  5. 半分钟内能看透问题本质的人是如何思考的?
  6. 【HEVC】1、HM-16.7编码器的基本结构
  7. 正则表达式中问号等特殊字符的转义(转)
  8. 解决Debian 9 iwlwifi固件缺失导致无法连接无线网络的问题
  9. Apache的443端口被占用解决方法
  10. CSS学习笔记--浮动元素由于浏览器页面缩小而被挤到下面的解决方法