linux之无人值守安装RHEL7

Kickstart+http+tftp无人值守化安装RHEL7.2操作系统

  1. 软件准备

Yum install httpd ftp-server syslinux system-config-kickstart.noarch xinetd.x86_64

  1. dhcp配置

subnet 10.252.1.0 netmask 255.255.255.0 {

       range 10.252.1.100 10.252.1.200;

       option domain-name-servers 10.252.1.1;

       option domain-name "xingyao.com";

       option routers 10.252.1.1;

       option broadcast-address 10.252.1.255;

       default-lease-time 600;

       max-lease-time 7200;

       next-server 10.252.1.10;

       filename "pxelinux.0";

}

  1. tftp配置

cat /etc/xinetd.d/tftp

service tftp

{

socket_type          = dgram

protocol        = udp

wait               = yes

user               = root

server                   = /usr/sbin/in.tftpd

server_args           = -s /var/lib/tftpboot

disable                 = no

per_source           = 11

cps                = 100 2

flags                     = IPv4

}

4.cd /var/lib/tftpboot;mkdir pxelinux.cfg

     cp /usr/share/syslinux/pxelinux.0 ./.

     cp /var/www/html/pakage/images/pxeboot/{vmlinuz,initrd.img} ./.

     cp /var/www/html/pakage/isolinux/{vesamenu.c32,boot.msg} ./.

     cp /var/www/html/pakage/isolinux/isolinux.cfg pxelinux.cfg/default

  1. 修改/var/lib/tftpboot/pxelinux.cfg/default

egrep -v "^$|^#" /var/lib/tftpboot/pxelinux.cfg/default

default linux

timeout 600

display boot.msg

menu clear

menu background splash.png

menu title Red Hat Enterprise Linux 7.2

menu vshift 8

menu rows 18

menu margin 8

menu helpmsgrow 15

menu tabmsgrow 13

menu color border * #00000000 #00000000 none

menu color sel 0 #ffffffff #00000000 none

menu color title 0 #ff7ba3d0 #00000000 none

menu color tabmsg 0 #ff3a6496 #00000000 none

menu color unsel 0 #84b8ffff #00000000 none

menu color hotsel 0 #84b8ffff #00000000 none

menu color hotkey 0 #ffffffff #00000000 none

menu color help 0 #ffffffff #00000000 none

menu color scrollbar 0 #ffffffff #ff355594 none

menu color timeout 0 #ffffffff #00000000 none

menu color timeout_msg 0 #ffffffff #00000000 none

menu color cmdmark 0 #84b8ffff #00000000 none

menu color cmdline 0 #ffffffff #00000000 none

menu tabmsg Press Tab for full configuration options on menu items.

menu separator # insert an empty line

menu separator # insert an empty line

label linux

  menu label ^Install Red Hat Enterprise Linux 7.2

  kernel vmlinuz

  append initrd=initrd.img ks=http://10.252.1.10/ks.cfg

label check

  menu label Test this ^media & install Red Hat Enterprise Linux 7.2

  menu default

  kernel vmlinuz

  append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.2\x20Server.x86_64 rd.live.check quiet

menu separator # insert an empty line

menu begin ^Troubleshooting

  menu title Troubleshooting

label vesa

  menu indent count 5

  menu label Install Red Hat Enterprise Linux 7.2 in ^basic graphics mode

  text help

Try this option out if you're having trouble installing

Red Hat Enterprise Linux 7.2.

  endtext

  kernel vmlinuz

  append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.2\x20Server.x86_64 xdriver=vesa nomodeset quiet

label rescue

  menu indent count 5

  menu label ^Rescue a Red Hat Enterprise Linux system

  text help

If the system will not boot, this lets you access files

and edit config files to try to get it booting again.

  endtext

  kernel vmlinuz

  append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.2\x20Server.x86_64 rescue quiet

label memtest

  menu label Run a ^memory test

  text help

If your system is having issues, a problem with your

system's memory may be the cause. Use this utility to

see if the memory is working correctly.

  endtext

  kernel memtest

menu separator # insert an empty line

label local

  menu label Boot from ^local drive

  localboot 0xffff

menu separator # insert an empty line

menu separator # insert an empty line

label returntomain

  menu label Return to ^main menu

  menu exit

menu end

  1. 光盘镜像挂在到http站点下/var/www/html/pakage

生成ks.cfg自动应答文件,如下:(http主机为10.252.1.10,将以下图中192.168.1.120修改掉

  1. RHEL7yum源必须如下设置,否则生成ks.cfg文件获取不到软件包

[development]  # 名字必须是development

name=rhel7

baseurl=file:///var/www/html/pakage

enabled=1

gpgcheck=0

  1. 将生成的ks.cfg文件放到/var/www/html/目录下
  2. 创建一个虚拟机,网卡设置为与10.252.1.10(此处设置vmnet4)同一局域网,开机即可无人值守自动化安装
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值