KICKSTART+NFS+DHCP+PXE+TFTP fully automated Linux installation
First dare not say is original, is through the network search summed up the more reliable and stable setting method and content.
There are a few things to be aware of during the installation process, which are rarely involved in other tutorials and cause some difficulty for beginners.
The Ks.cfg file in this tutorial strictly modifies the anaconda.cfg file that exists on the system .
The system used in this article is RHEL6.4, the operating system.
all of the operations in this article are implemented in virtual machines, and in order to achieve better results, the virtual machine network uses an internal network. The main purpose is to avoid the system directly to its Windows system services to it automatically assign the address, we want to use the Linux host DHCP service to assign the address.
Please turn off the firewall. The connection timed out without closing.
please turn off selinux. Does not close, it will cause the pxelinux.0 file to not be retrieved .
Good directly on the content.
Configure the local source to mount the mirrored ISO file.
Mount the ISO file to the media directory :
mount/dev/sr0/media/
Modify /etc/yum.repos.d/rhel-source.repo
[Email protected] ~]# Vim/etc/yum.repos.d/rhel-source.repo
[Rhel-source]
name=red Hat Enterprise Linux $releasever-$basearch-source
baseurl=file:///media/
enabled=1
Gpgcheck=1
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release
[Rhel-source-beta]
name=red Hat Enterprise Linux $releaseverBeta-$basearch-source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/srpms/
Enabled=0
Gpgcheck=1
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-beta,file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release
Save exit.
installing DHCP and tftp services
#yum Install tftp* dhcp*
Edit TFTP
Vim/etc/xinetd.d/tftp
Service TFTP
{
Socket_type = Dgram
protocol = UDP
Wait = yes
user = root
Server =/usr/sbin/in.tftpd
Server_args =-unobody-s/tftpboot
disable = no
Per_source = 11
CPS = 100 2
Flags = IPV4
}
Modified:disable = no modified to Yes
to edit a configuration file for a DHCP service
Vim/etc/dhcpd.conf
#
# DHCP Server Configuration file.
# See/usr/share/doc/dhcp*/dhcpd.conf.sample
# See ' Mans 5 dhcpd.conf '
Ddns-update-style Interim;
Ignore client-updates;
Next-server 192.168.0.20;
FileName "pxelinux.0";
authoritative;
Allow booting;
Allow BOOTP;
Subnet 192.168.0.0 netmask 255.255.255.0{
Range DYNAMIC-BOOTP 192.168.0.100192.168.0.200;
Option routers 192.168.0.1;
Option Subnet-mask 255.255.255.0;
Option Domain-name-servers 192.168.0.10;
Option Domain-name "Ssgm.net";
Default-lease-time 21600;
Max-lease-time 43200;
}
The above content can be copied and pasted directly into the configuration file.
Configuration Pxe
new Folder Mkdir/rhelos
copy ISO image internal file into rhelos file,cp–rf/media/*/rhelos/
Edit NFS configuration file:
Vi/etc/exports content is as follows
/rhelos * (Rw,sync)
Start Services, serviceDHCPD start
Service NFS Start
Service Rpcbind Start
If these services are not started automatically, they need to be started automatically under the Chkconfig configuration.
root directory for Mkdir/tftpboot tftp
Cp/usr/lib/syslinux/pxelinux.0/tftpboot
Note: If you cannot find this file, you will need yum install syslinux and then copy the pxelinux.0 file in/usr/share/syslinux/.
Cp/media/images/pxeboot/{vmlinuz,initrd.img}/tftpboot
Mkdir/tftpboot/pxelinux.cfg
Cp/mnt/isolinux/isolinux.cfgpxelinux.cfg/default
Vim/tftpboot/pxelinux.cfg/default (Modify the configuration as follows:)
Default Linux
Prompt 1
Timeout 600
Display Boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
Label Linux
Kernel Vmlinuz
Append ks=nfs:192.168.0.20:/rhelos/ks.cfginitrd=initrd.img ( where modifications are required )
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-
Set Timeout */* time out to 10S */
build the Ks.cfg installation profile (copy to the directory that provides the installation /rhelos directory)
Set permissions chmod o+wx/rhelos/ks.cfg
You can modify the required system requirements according to the Anaconda-ks.cfg file in the/root/directory .
(note,clearpart –all –Initlabel # If the statement is not added in the Ks.cfg script, an automated installation will not be possible)
NFS –server=nfs server IP –location of the dir= CD or location of the system installation files
Network –device eth0 –bootprotodhcp(using DHCP to automate assigning IP addresses)
start the client, power up + plug in the network cable, set up the network card, waiting for installation is complete.
Reboot the system to do it.
The following is my ks.cfg reference configuration:
# Kickstart file automatically generated Byanaconda.
#version =devel
Install
Text
NFS--server=192.168.0.20--dir=/rhelos
Key--skip
Lang Zh_cn. UTF-8
Keyboard US
Network--device eth0--bootproto DHCP
ROOTPW--iscrypted$6$hbczimafur/h6xaf$2njtxj/ bh1yaqut2446zmgsechrbbxabbcthnpr9xwc7nbfsewpb8if1vj9kqz1okx02clustb0bofz3ijui//
Firewall--disabled
Authconfig--enableshadow--passalgo=sha512
SELinux--disabled
TimeZone Asia/shanghai
Bootloader--location=mbr--driveorder=sda--append= "RHGB quiet"
# The following is the partitioninformation you requested
# Note that any partitions deleted arenot expressed
# here so unless your clear all Partitionsfirst
# Guaranteed to work
#clearpart--none
Clearpart--all--initlabel
Part/boot--fstype Ext4--size=100
Part swap--size=2000
Part/--fstype EXT4--size=1--grow
#part/boot--fstype=ext4--size=200
#part/--FSTYPE=EXT4--grow--size=200
%packages
@base
@chinese-support
@console-internet
@core
@debugging
@development
@dial-up
@mysql-client
@mysql
@system-MANAGEMENT-SNMP
@server-policy
Python-dmidecode
Sgpio
Device-mapper-persistent-data
Ftp
Lftp
Glibc-utils
Systemtap-client
Gdb-gdbserver
Libstdc++-docs
Gcc-gnat
Gcc-objc
Gcc-objc++
Rp-pppoe
Perl-dbd-mysql
%end
The above configuration file is a CFG file that minimizes installation and customizes the installation package . Note ROOTPW set the root password, must be modified to your own password, with my, I will not give you to say the password.
Network--device eth0--bootproto DHCP This must be set, otherwise, after entering the system, cannot obtain the IP, cannot find the ks.cfg file. It takes two IPs to get the entire boot process . This step is crucial.
Finally, Restart Service:
Service DHCPD Restart;
Service NFS Restart;
Service xinetd Restart;
Service Rpcbind Restart
Please note the setting of the red flag.
This article is from the "China-Network Technology" blog, please be sure to keep this source http://hua0221.blog.51cto.com/108877/1601463
KICKSTART+NFS+DHCP+PXE+TFTP Fully automated Linux installation