kickstart大量安裝centos 7系統

來源:互聯網
上載者:User

標籤:kickstart tftp

環境準備:10.0.0.7

=============PXE+Kickstart

  1.ks檔案  ok 

  2.DHCP伺服器  ok

  3.TFTP伺服器  ok  檔案

  4.HTTP伺服器(NFS、FTP) ok

  5.網卡啟動  ok

  6.YUM倉庫安裝源  ok

首先掛載光碟片鏡像:CentOS-7-x86_64-DVD-1503-01

[[email protected] ~]# mount /dev/cdrom /mnt

[[email protected] ~]# yum install -y httpd createrepo

[[email protected] ~]# mkdir /var/www/html/CentOS-7.1-x86_64

[[email protected] ~]# cp -a /mnt/* /var/www/html/CentOS-7.1-x86_64/

[[email protected] ~]# createrepo -pdo /var/www/html/CentOS-7.1-x86_64/ /var/www/html/CentOS-7.1-x86_64/

[[email protected] ~]# createrepo -g `ls /var/www/html/CentOS-7.1-x86_64/repodata/*-comps.xml` /var/www/html/CentOS-7.1-x86_64/


[[email protected] ~]# yum install -y tftp-server dhcp xinetd

[[email protected] ~]# vim /etc/xinetd.d/tftp

disable                 = no 


[[email protected] ~]# cd /usr/share/doc/dhcp-4.1.1/

[[email protected] dhcp-4.1.1]# cp dhcpd.conf.sample /etc/dhcp/dhcpd.conf

subnet 10.0.0.0 netmask 255.255.255.0 {

  range dynamic-bootp 10.0.0.100 10.0.0.200;

  option subnet-mask 255.255.255.0;

  next-server 10.0.0.7;

  filename "pxelinux.0";

}


[[email protected] dhcp-4.1.1]# /etc/init.d/dhcpd start

正在啟動 dhcpd:                                           [確定]

[[email protected] dhcp-4.1.1]# /etc/init.d/httpd start

正在啟動 httpd:

[[email protected] dhcp-4.1.1]# /etc/init.d/xinetd start


放置Kickstart檔案

[[email protected] ~]# curl --head http://10.0.0.7/CentOS-7.1-x86_64/CentOS-7.1-x86_64.cfg


[[email protected] ~]# yum install -y syslinux

[[email protected] ~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/

[[email protected] ~]# cp /mnt/isolinux/* /var/lib/tftpboot/

[[email protected] ~]# mkdir /var/lib/tftpboot/pxelinux.cfg

[[email protected] CentOS-7.1-x86_64]# vim CentOS-7.1-x86_64.cfg

18 url --url=http://10.0.0.7/CentOS-7.1-x86_64

[[email protected] ~]# cd /var/lib/tftpboot/pxelinux.cfg/

[[email protected] pxelinux.cfg]# cp /mnt/isolinux/isolinux.cfg default

[[email protected] pxelinux.cfg]# cat default    

default vesamenu.c32

timeout 600


display boot.msg


# Clear the screen when exiting the menu, instead of leaving the menu displayed.

# For vesamenu, this means the graphical background is still displayed without

# the menu itself for as long as the screen remains in graphics mode.

menu clear

menu background splash.png

menu title CentOS 7

menu vshift 8

menu rows 18

menu margin 8

#menu hidden

menu helpmsgrow 15

menu tabmsgrow 13


# Border Area

menu color border * #00000000 #00000000 none


# Selected item

menu color sel 0 #ffffffff #00000000 none


# Title bar

menu color title 0 #ff7ba3d0 #00000000 none


# Press [Tab] message

menu color tabmsg 0 #ff3a6496 #00000000 none


# Unselected menu item

menu color unsel 0 #84b8ffff #00000000 none


# Selected hotkey

menu color hotsel 0 #84b8ffff #00000000 none


# Unselected hotkey

menu color hotkey 0 #ffffffff #00000000 none


# Help text

menu color help 0 #ffffffff #00000000 none


# A scrollbar of some type? Not sure.

menu color scrollbar 0 #ffffffff #ff355594 none


# Timeout msg

menu color timeout 0 #ffffffff #00000000 none

menu color timeout_msg 0 #ffffffff #00000000 none


# Command prompt text

menu color cmdmark 0 #84b8ffff #00000000 none

menu color cmdline 0 #ffffffff #00000000 none


# Do not display the actual menu unless the user presses a key. All that is displayed is a timeout message.


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


menu separator # insert an empty line

menu separator # insert an empty line


label ks

  menu label ^AUTO Install CentOS 7

  kernel vmlinuz

  append initrd=initrd.img ks=http://10.0.0.7/CentOS-7.1-x86_64/CentOS-7.1-x86_64.cfg


label linux

  menu label ^Install CentOS 7

  kernel vmlinuz

  append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet


label check

  menu label Test this ^media & install CentOS 7

  menu default

  kernel vmlinuz

  append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rd.live.check quiet


menu separator # insert an empty line


# utilities submenu

menu begin ^Troubleshooting

  menu title Troubleshooting


label vesa

  menu indent count 5

  menu label Install CentOS 7 in ^basic graphics mode

  text help

        Try this option out if you‘re having trouble installing

        CentOS 7.

  endtext

  kernel vmlinuz

  append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 xdriver=vesa nomodeset quiet


label rescue

  menu indent count 5

  menu label ^Rescue a CentOS 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=CentOS\x207\x20x86_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

root                   unixhot


本文出自 “linux” 部落格,請務必保留此出處http://chenjisong.blog.51cto.com/7858025/1718101

kickstart大量安裝centos 7系統

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.