Build a PXE server, push and install Linux systems

Source: Internet
Author: User

Build the Environment:

Push server :

ip:192.168.189.138

System:CentOS 5.8

Push system:RHEL 5.4

1 : Configure DHCPD service.

If the dhcpd service is not installed , please install:

# yum -y install dhcp.x86_64# vi /etc/dhcpd.confoption domain-name  " 766.com "; default-lease-time 6000;  max-lease-time 11400;  authourtative;   next-server 192.168.189.138; ddns-update-style ad-hoc;  log-facility  local7;  subnet 192.168.189.0 netmask 255.255.255.0{  range  192.168.189.150 192.168.189.195; option domain-name-servers 192.168.189.254;   option domain-name  "766.com"; option netbios-name-servers 192.168.189.254;   option routers 192.168.189.254;  option broadcast-address 192.168.189.255;  default-lease-time 6000;  max-lease-time 11400;  filename  "/kickstart /ks.cfg "; }  option space pxe;   class " PXE  {       match&nbSp;if substring (optionvendor-class-identifier, 0, 9)  =  "Pxeclient";       optionvendor-encapsulated-options 01:04:00:00:00:00:ff;       option boot-size 0x1;      filename "pxelinux.0";       option tftp-server-name  "192.168.189.138";       option vendor-class-identifier "Pxeclient";       vendor-option-space  pxe;  }


2: Open TFTP Service:

If you do not have the tftp service software, please install:

# yum -y installtftp.x86_64# yum -y installxinetd.x86_64  # yum  -y installtftp-server.x86_64 Configuration tftp# vi/etc/xinetd.d/tftpservice 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 }

3: prepare the files and directories you want to push.

Copy the files from the isolinux directory in the CD or ISO file to the /tftpboot.

Copy the pxelinux.0 file to the /tftpboot:

# Cp/usr/lib/syslinux/pxelinux.0/tftpboot

Create RHEL5.4 directory, put initrd.img , Vmlinuz two files are copied in:

# mkdir-p/tftpboot/rhel5.4# mv/tftpboot/initrd.img/tftpboot/rhel5.4# mv/tftpboot/vmlinuz/tftpboot/rhel5.4

Create the pxelinux.cfg directory, copy the isolinux.cfg file, and rename the default:

# MV Isolinux.cfg pxelinux.cfg/default Modify default file parameter # Vi/tftpboot/pxelinux.cfg/defaultdefault linuxprompt 1timeout 600display BOOT.MSGF1 boot.msgf2 options.msgf3 general.msgf4 param.msgf5 rescue.msglabel RHEL5.4 kernel rhel5.4/vmlinuz Append ksdevice=eth0 load_ramdisk=1 initrd=rhel5.4/initrd.img Noipv6

To configure boot.msg, add load options:

# Vi/tftpboot/boot.msginstall RHEL5.4---> RHEL5.4


4: provide installation image or content, use here NFS Way.

Copy the disc image or content to /home/redhat .

using NFS , share the /home/redhat to the 192.168.189.0/24 Network segment:

# Vi/etc/exports/home/redhat 192.168.189.0/24 (Rw,async,no_root_squash)


5: start each of the required services and test the installation.

# service DHCPD start# service xinetd start# Service NFS Start


start the computer, F12 , choose to boot from the network card, normal words can enter the installation boot interface:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/87/DB/wKiom1fjSpeSVhukAACMNtJrQII320.png "title=" 1.png " alt= "Wkiom1fjspesvhukaacmntjrqii320.png"/>

Write RHEL5.4 , enter the installation.

Select the installation media acquisition method, select NFS:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/87/D7/wKioL1fjSqqRDFxZAAA0DkGUT4g674.png "title=" 2.png " alt= "Wkiol1fjsqqrdfxzaaa0dkgut4g674.png"/>

fill in the server IP with media path:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/87/DB/wKiom1fjSrWz-9YsAAA9U1wF7qY086.png "title=" 3.png " alt= "Wkiom1fjsrwz-9ysaaa9u1wf7qy086.png"/>

Into the graphical installation interface, instructions can be installed:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/87/DB/wKiom1fjSsThNCCoAAPpw3HAktw913.png "title=" 4.png " alt= "Wkiom1fjssthnccoaappw3haktw913.png"/>

=============================================================================================================

Use KS automatic installation of files:

Create the ks file template using system-config-kickstart ( System-config-kickstart Unable to create LVM, inorder to use LVM, it is possible to generate the ks file, edit manually)

LVM Configuration:

partpv.01--size=10000--growvolgroupvg-001 pv.01logvol/--vgname=vg-001--size=10000--name=lv-001

KS The file specifies the keyboard, language, installation method, partition and other configuration.

Configuration default file, specifying KS file path (available nfs,ftp and Other methods):

Append ksdevice=eth0 load_ramdisk=1 initrd=rhel5.4/initrd.img ks=nfs:192.168.189.138:/home/redhat/ks.cfg Noipv6

Start the client and test the automatic installation.


This article from the "Play God Clown" blog, reproduced please contact the author!

Build a PXE server, push and install Linux systems

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.