RHEL6 unattended installation (NFS installation)

Source: Internet
Author: User
There are a lot of unattended installation methods on the network, but most of them use FTP, basically the same as using HTTP and FTP, so today we have installed one with NFS if we have nothing to do, I found that NFS is different from those two, so I will share my experiment results with you and hope to help you. Methods: NFS + TFTP + DHCP + Kickstart + PXE prepare two virtual machines, one as the test environment (RHEL6, IP 192.168.0.254), and the other

There are a lot of unattended installation methods on the network, but most of them use FTP, basically the same as using HTTP and FTP, so today we have installed one with NFS if we have nothing to do, I found that NFS is different from those two, so I will share my experiment results with you and hope to help you.

Method: NFS + TFTP + DHCP + Kickstart + PXE
Prepare two virtual machines, one as the test environment (RHEL6 with IP address 192.168.0.254), and the other as the installation end of RHEL6, and set network boot installation.
Install the required services and modify the corresponding configuration file:

1. Use yum to install the required software package. First, build the yum disc Source:
Root@www.linuxidc.com ~ # Mount/dev/cdrom/mnt
Create a file ending with. repo in the/etc/yum. repos. d directory:
Root@www.linuxidc.com ~ # Vi/etc/yum. repos. d/server. repo
The configuration is as follows:
[Server]
Name = this is my yum server
Baseurl = file: // mnt/Server
Enabled = 1
Gpgcheck = 0
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-RedHat-release
Run the rpm-import/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release command.
Gpgkey
2. Install TFTP, modify the tftp configuration file, and enable the service.
Root@www.linuxidc.com ~ # Yum install tftp-server
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Aaa
| 3.7 kB...
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package tftp-server.x86_64 0: 0. 49-5.1.el6 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
========================================================== ======================================
========================================================== ===
Package
Arch
Version
Repository
Size
========================================================== ======================================
========================================================== ===
Installing:
Tftp-server
X86_64
0.49-5.1.el6
Aaa
39 k
Transaction Summary
========================================================== ======================================
========================================================== ===
Install
1 Package (s)
Upgrade
0 Package (s)
Total download size: 39 k
Installed size: 57 k
Is this OK [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: tftp-server-0.49-5.1.el6.x86_64
1/1
Installed:
Tftp-server.x86_64 0: 0. 49-5.1.el6
Complete!
Root@www.linuxidc.com ~ #
Root@www.linuxidc.com ~ # Vim/etc/xinetd. d/tftp
# Default: off
# Description: The tftp server serves files using the trivial file transfer \
#
Protocol. The tftp protocol is often used to boot diskless \
#
Workstations, download configuration files to network-aware printers ,\
#
And to start the installation process for some operating systems.
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
CPIs = 100 2
Flags = IPv4
}
Root@www.linuxidc.com ~ #/Etc/init. d/xinetd restart
Stopping xinetd:
[OK]
Starting xinetd:
[OK]
Root@www.linuxidc.com ~ #
~
3. Create an NFS directory under/and share it as follows:
Root@www.linuxidc.com ~ # Mkdir/NFS
Root@www.linuxidc.com ~ # Vim/etc/exports
/NFS
192.168.0.0/24 (rw, sync)
Root@www.linuxidc.com ~ #/Etc/init. d/nfs restart
Shutting down NFS mountd:
Shutting down NFS daemon:
Shutting down NFS quotas:
Starting NFS services:
Starting NFS quotas:
Starting NFS daemon:
Starting NFS mountd:
[FAILED]
[FAILED]
[FAILED]
[OK]
[OK]
[OK]
[OK]
4. Install dhcp, modify the configuration file, and enable the Service:
Root@www.linuxidc.com ~ # Yum install dhcp-y
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package dhcp. x86_64. 1.1-12. P1.el6 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
========================================================== ======================================
========================================================== ===
Package
Arch
Version
Repository
Size
========================================================== ======================================
========================================================== ===
Installing:
Dhcp
X86_64
12: 4. 1.1-12. P1.el6
Aaa
820 k
Transaction Summary
========================================================== ======================================
========================================================== ===
Install
1 Package (s)
Upgrade
0 Package (s)
Total download size: 820 k
Installed size: 2.0 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: 12: dhcp-4.1.1-12.P1.el6.x86_64
1/1
Installed:
Dhcp. x86_64. 1.1-12. P1.el6
Complete!
Root@www.linuxidc.com ~ #
Root@www.linuxidc.com ~ # Cp/usr/share/doc/dhcp-4.1.1/dhcpd. conf. sample
/Etc/dhcp/dhcpd. conf
Root@www.linuxidc.com ~ # Vim/etc/dhcp/dhcpd. conf(The content of the original RHEL6 file is as follows:
It may seem messy at first)
# Dhcpd. conf
#
# Sample configuration file for ISC dhcpd
#
# Option definitions common to all supported networks...
Option domain-name "example.org ";
Option domain-name-servers ns1.example.org, ns2.example.org;
Default-lease-time 600;
Max-lease-time 7200;
# Use this to enble/disable dynamic dns updates globally.
# Ddns-update-style none;
# If this DHCP server is the official DHCP server for the local
# Network, the authoritative directive shoshould be uncommented.
# Authoritative;
# Use this to send dhcp log messages to a different log file (you also
# Have to hack syslog. conf to complete the redirection ).
Log-facility local7;
# No service will be given on this subnet, but declaring it helps
# DHCP server to understand the network topology.
Subnet 10.152.187.0 netmask 255.255.255.0 {
}
# This is a very basic subnet declaration.
Subnet 10.254.239.0 netmask has been released successfully {
Range 10.254.239.10 10.254.239.20;
Option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
}
# This declaration allows BOOTP clients to get dynamic addresses,
# Which we don't really recommend.
Subnet 10.254.239.32 netmask implements 255.255.255.255 {
Range dynamic-bootp 10.254.239.40 10.254.239.60;
Option broadcast-address 10.254.239.31;
Option routers rtr-239-32-1.example.org;
}
# A slightly different configuration for an internal subnet.
Subnet 10.5.5.0 netmask has been released successfully {
Range 10.5.5.26 10.5.5.30;
Option domain-name-servers ns1.internal.example.org;
Option domain-name "internal.example.org ";
Option routers 10.5.5.1;
Option broadcast-address 10.5.5.31;
Default-lease-time 600;
Max-lease-time 7200;
}
# Hosts which require special configuration options can be listed in
# Host statements. If no address is specified, the address will be
# Allocated dynamically (if possible), but the host-specific information
# Will still come from the host declaration.
Host passacaglia {
Hardware ethernet 0: 0: c0: 5d: bd: 95;
Filename "vmunix. passacaglia ";
Server-name "toccata.fugue.com ";
}
# Fixed IP addresses can also be specified for hosts. These addresses
# Shoshould not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
# Be booted with DHCP, unless there is an address range on the subnet
# To which a BOOTP client is connected which has the dynamic-bootp flag
# Set.
Host fantasia {
Hardware ethernet 08: 00: 07: 26: c0: a5;
Fixed-address fantasia.fugue.com;
}
# You can declare a class of clients and then do address allocation
# Based on that. The example below shows a case where all clients
# In a certain class get addresses on the 10.17.htm/24 subnet, and all
# Other clients get addresses on the 10.0.29/24 subnet.
Class "foo "{
Match if substring (option vendor-class-identifier, 0, 4) = "SUNW ";
}
Shared-network 224-29 {
Subnet 10.17.224.0 netmask 255.255.255.0 {
Option routers rtr-224.example.org;
}
Subnet 10.0.29.0 netmask 255.255.255.0 {
Option routers rtr-29.example.org;
}
Pool {
Allow members of "foo ";
Range 10.17.224.10 10.17.224.250;
}
Pool {
Deny members of "foo ";
Range 10.0.29.10 10.0.29.230;
}
}
So I copied the original dhcp file in RHEL5 as follows:
Ddns-update-style interim;
Ignore client-updates;
Filename "pxelinux.0 ";
Next-server 192.168.0.254; (these two lines are newly added)
Subnet192.168.0.0Netmask 255.255.255.0 {
# --- Default gateway
Option routers
Option subnet-mask
192.168.0.254;
255.255.255.0;
Option nis-domain
"Domain.org ";
Option domain-name
"Domain.org ";
Option domain-name-servers
192.168.0.254;
Option time-offset
-18000; # Eastern Standard Time
#
Option ntp-servers
192.168.1.1;
#
Option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- You understand Netbios very well
#
Option netbios-node-type 2;
Range dynamic-bootp192.168.0.100 192.168.0.200;
Default-lease-time 21600;
Max-lease-time 43200;
# We want the nameserver to appear at a fixed address
Host ns {
Next-server marvin.redhat.com;
Hardware ethernet 12: 34: 56: 78: AB: CD;
Fixed-address 207.175.42.254;
}
}
Root@www.linuxidc.com ~ #/Etc/init. d/dhcpd configtest
Syntax: OK
Root@www.linuxidc.com ~ #/Etc/init. d/dhcpd restart
Starting dhcpd:
[OK]
Root@www.linuxidc.com ~ #

Related Article

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.