Install Centos6.4 in unattended PXE

Source: Internet
Author: User

Install Centos6.4 in unattended PXE

To use pex, kickstart, (ftp, HTTP, nfs), tftp, DHCP, and Centos6.4 are required.

1) ks. cfg file creation

1 [root@wwwshare] #yuminstall-ysystem-config-kickstart

Kickstart creates ks. cfg Based on/root/anaconda-ks.cfg (Disk allocation, time zone, language, rpm package and other parameters configured during system installation)

# Partitionclearinginformation copy the partition information clearpart -- all -- initlabelpart/boot -- fstype = ext4 -- size = 500partpv in the anaconda-ks.cfg. 008002 -- grow -- size = 1volgroupvg_centos -- pesize = 4096pv. 008002 logvol/-- fstype = ext4 -- name = lv_root -- vgname = vg_centos -- grow -- size = 1024 -- maxsize = 51200logvolswap -- name = lv_swap -- vgname = vg_centos -- grow -- size = 1984 -- maxsize = 1984

Add Software Package

% Packages @ base @ basic-desktop @ core @ debugging @ desktop-platform @ toptopplatformdevelopment @ ServerPlatformDevelopment @ Developmenttools package group for compilation and installation @ directory-client @ fonts @ input-methods @ internet-browser @ java-platform @ legacy-x @ network-file-system-client @ print-client @ remote-desktop-clients @ server-platform @ server- policy @ x11 % end

2) Build an ftp server and prepare the RPM Software Package

1234 [root@www~] #yuminstall-yvsftpd [root@www ftp ] #mkdirCentOS_6.4_x86_64 [root@www ftp ] #mount-r/dev/sr0/var/ftp/CentOS_6.4_x86_64 [root@www~] #cpks.cfg/var/ftp/kickstart/ks.cfg

3) Prepare the Centos6.4 boot file. This is the key part (TFTP)

Install and start tftp

12345678910111213 [root@www~] #rpm-ivhtftp-0.49-7.el6.x86_64.rpm Preparing... ###########################################[100%] 1:tftp ###########################################[100%] [root@www~] #rpm-ivhtftp-server-0.49-7.el6.x86_64.rpm Preparing... ###########################################[100%] 1:tftp-server ###########################################[100%] [root@www~] #chkconfigtftpon [root@www~] #servicexinetdrestart Stoppingxinetd:[OK] Startingxinetd:[OK] [root@www~] #ss-uan|grep69 UNCONN00*:69*:*

Prepare the Startup File and kernel

1234567891011121314151617181920212223242526 [root@www~] # Yumistall-ysyslinux this package prepares pxelinux.0 for booting the network to install Linux [root@www~] #cp/usr/share/syslinux/pxelinux.0/var/lib/tftpboot/ [root@www~] # Cp/var/ftp/CentOS_6.4_x86_64/isolinux/{boot.msg, splash.jpg, vesamenu. c32}/var/lib/tftpboot/define CentOS6.4 default installation Interface [root@www~] #cp/var/ftp/CentOS_6.4_x86_64/images/pxeboot/{initrd.img,vmlinuz}/var/lib/tftpboot/ [root@wwwtftpboot] #mkdirpxelinux.cfg [root@wwwpxelinux.cfg] #cp/var/ftp/CentOS_6.4_x86_64/isolinux/isolinux.cfg./default labellinux menulabel^Installorupgradeanexistingsystem menudefault kernelvmlinuz appendinitrd=initrd.imgks= [root@wwwtftpboot] # Ls-lR verify whether the files on the tftp are ready .: total36032 -r--r--r--1rootroot84Nov1403:48boot.msg -r--r--r--1rootroot32495283Nov1403:49initrd.img -rw-r--r--1rootroot26595Nov1403:42pxelinux.0 drwxr-xr-x2rootroot4096Nov1501:58pxelinux.cfg -r--r--r--1rootroot151230Nov1403:48splash.jpg -r--r--r--1rootroot162860Nov1403:48vesamenu.c32 -r-xr-xr-x1rootroot4043888Nov1403:49vmlinuz . /pxelinux .cfg: total4 -rw-r--r--1rootroot991Nov1404:01default

4) DHCP Server Installation

123456789101112131415 [root@www~] #rpm-ivhdhcp-common-4.1.1-38.P1.el6.centos.x86_64.rpm Preparing... ###########################################[100%] 1:dhcp-common ###########################################[100%] [root@www~] #rpm-ivhdhcp-4.1.1-38.P1.el6.centos.x86_64.rpm Preparing... ###########################################[100%] 1:dhcp ###########################################[100%] [root@www~] #cp/usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample/etc/dhcp/dhcpd.conf subnet192.168.1.0netmask255.255.255.0{ range192.168.1.200192.168.1.225; optionrouters192.168.1.1; } Next-server192.168.1.150; specifies the tftp for bootstrap Installation filename= "pxelinux,0" ; [root@www~] #servicedhcpdstart Startingdhcpd:[OK]

5) The Client is ready to adjust the BIOS startup sequence.

The Client obtains the IP address from DHCP.

Installation interface display

Create LVM volume

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.