Linux operation and maintenance of automated tools Kickstart
Bulk Kickstart installation of the operating system tools, RedHat earlier launch of the product (not much to say, now playing Cobbler friends
Test environment: CentOS 6.6 x86_64 minimal
First, the installation package
yum -y install dhcp tftp-server syslinux nfs-utils kickstart
cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
vim /etc/dhcp/dhcpd.conf
# dhcpd.conf
# option definitions common to all supported networks…
option domain-name-servers 192.168.1.2, 192.168.1.3;
# A slightly different configuration for an internal subnet.
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.214.120;
option routers 192.168.1.2;
option subnet-mask 255.255.255.0;
filename “/pxelinux.0”;
default-lease-time 600;
max-lease-time 7200;
}
vim /etc/xinetd.d/tftp
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
cps = 100 2
flags = IPv4
}
pxelinux.0
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
mount /dev/cdrom /mnt/
cp /mnt/isolinux/* /var/lib/tftpboot/
cd /var/lib/tftpboot/
mkdir pxelinux.cfg
mv isolinux.cfg pxelinux.cfg/default
NFS
shell > vim /etc/exports
/mnt 192.168.1.0/24(ro,sync)
chkconfig –add nfs
chkconfig –add dhcpd
chkconfig –add xinetd
chkconfig –add rpcbind
chkconfig –level 35 nfs on
chkconfig –level 35 dhcpd on
chkconfig –level 35 xinetd on
chkconfig –level 35 rpcbind on
exportfs -ar
service dhcpd restart
service xinetd restart
service rpcbind restart
service nfs restart
setenforce 0
service iptables stop
Seven test PXE boot installation
1, the client set boot from the network (in fact, do not set the local network can not be found naturally go to find), you can see the installation interface
2, select the language
3, OK
4. Select the keyboard (us) OK
5, select the media location (NFS Directory) OK
6, configure the network (the default can) OK
7, Setting Up NFS Services (NFS server name: 192.168.1.10 ## NFS server address
CentOS directroy: / mnt ## ISO stowed position) OK
8, where the installation interface appears normal, prove no problem (with CD-ROM to install a pattern)
## This is the realization of the PXE boot installation, you want to have unattended configuration Kickstart!
Eight, install the desktop environment
## The following operation is performed directly in the virtual machine, the non-terminal connection! (Not necessary)
yum grouplist | grep -iP “(x window system|desktop)”
Desktop
X Winsow System
yum update
yum -y groupinstall “X Window System”
yum -y groupinstall “Desktop”
init 5
yum -y install system-config-kickstart
system-config-kickstart
The next point on the whole it is a little mouse!
· Basic configuration
Default Language: Simplified Chinese to be the default (English)
keyboard: to default
time zone: Asia /Singapore, according to the actual situation to
UTC clock: Check the
root password: test123
confirm the root password: test123
root password encryption: The default is on the hook, do not control
Advanced Configuration
reboot after installing the system: Check
· Installation
Performing a new installation: Tick
Select the NFS:
the NFS server: 192.168.1.10
the NFS directory: / mnt ## NFS shared storage directory of ISO
· Boot Loader Options
Mounting Type
install a new boot loader: Check the
installation options
Boot Record (MBR) on the primary boot loader installation
· partition information
master boot record
to clear the Master Boot Record: Check the
partition
to remove all existing partitions: Check the
disk label
to initialize the disk label : check the
layout
add partition (with the same real machine installed)
• network configuration
to add network devices – network equipment (eth0) – the network type (DHCP) – to confirm
· verify
default
• firewall configuration
disable
· display configuration
installation graphical environment: not checked (if you do not want to install it)
to disable
· package selection
default
· pre-installation script
by default
after installation script *
default
Select – File – Save – (Save the file to the / root directory, a file named ks.cfg)
mkdir /nfsdir
cp ks.cfg /nfsdir
chown 777 /nfsdir/ks.cfg
vim /etc/exports
/mnt 192.168.1.0/24(ro,sync)
/nfsdir 192.168.1.0/24(ro,sync)
exportfs -ar
vim /var/lib/tftpboot/pxelinux.cfg/default
default vesamenu.c32
#prompt 1
timeout 50
display boot.msg
menu background splash.jpg
menu title Welcome to CentOS 6.6!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff #00000000
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append ks=nfs:192.168.1.10:/nfsdir/ks.cfg initrd=initrd.img
label vesa
menu label Install system with ^basic video driver
kernel vmlinuz
append initrd=initrd.img xdriver=vesa nomodeset
label rescue
menu label ^Rescue installed system
kernel vmlinuz
append initrd=initrd.img rescue
label local
menu label Boot from ^local drive
localboot 0xffff
label memtest86
menu label ^Memory test
kernel memtest
append –
## Wherein, timeout 50 (formerly 600 this parameter is a time into the system selection mode, we do not want to wait too long so the tone for five seconds)
## In the first label added: ks = nfs: 192.168.1.10: /nfsdir/ks.cfg (defined ks.cfg path)
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append ks=nfs:192.168.1.10:/nfsdir/ks.cfg initrd=initrd.img
vim /nfsdir/ks.cfg
#platform=x86, AMD64, ? Intel EM64T
#version=DEVEL
# Firewall configuration
firewall –disabled
# Install OS instead of upgrade
install
# Use NFS installation media
nfs –server=192.168.214.10 –dir=/mnt
# Root password
rootpw –iscrypted $1$56NxQt/e$3fz.wnuWl7Ak7q9TIpwl0.
# System authorization information
auth –useshadow –passalgo=sha512
# Use graphical install
graphical
# System keyboard
keyboard us
# System language
lang US_ENG
# SELinux configuration
selinux –disabled
# Do not configure the X Window System
skipx
# Installation logging level
logging –level=info
# Reboot after installation
reboot
# System timezone
timezone –isUtc Asia/singapore
# Network information
network –bootproto=dhcp –device=eth0 –onboot=on
# System bootloader configuration
bootloader –location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart –all –initlabel
# Disk partitioning information
part /boot –fstype=”ext4″ –size=200
part swap –fstype=”swap” –size=1024
part / –fstype=”ext4″ –grow –size=1
Recent Comments