mount /dev/cdrom /mnt
cd /etc/yum.repos.d/
cp rhel-debuginfo.repo cd.repo
vi /etc/yum.repos.d/cd.repo
[rhel-cd]
name=Red Hat Enterprise Linux $releasever - $basearch - cd
baseurl=file:///mnt/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
yum install vsftpd
yum install nmap
cd /var/ftp/
mkdir os
cp -r /mnt/* /var/ftp/os
cd /var/ftp/os
createrepo -g /mnt/Server/repodata/repomd.xml ./
需要安装软件包的其它机器
cd /etc/yum.repos.d/
cp rhel-debuginfo.repo rhel-ftp.repo
vi rhel-ftp.repo
[rhel-ftp]
name=Red Hat Enterprise Linux $releasever - $basearch - ftp
baseurl=ftp://172.16.1.205/os
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
yum install nmap
----------------------------------------
mount /dev/cdrom /mnt
yum install tftp-server
chkconfig tftp on
service xinetd restart
cd /tftpboot/linux-install
mv pxelinux.0 ..
cp /mnt/images/pxeboot/vmlinuz .
cp /mnt/images/pxeboot/initrd.img .
cd /tftpboot
mkdir pxelinux.cfg
cd pxelinux.cfg
cp /mnt/isolinux/isolinux.cfg default
yum install dhcp
cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
vi /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 192.168.9.0 netmask 255.255.255.0 {
option routers 192.168.9.1;
option subnet-mask 255.255.255.0;
option domain-name "linux-oracle.com";
option domain-name-servers 192.168.9.1;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.9.128 192.168.9.200;
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.9.1;
filename "pxelinux.0";
}
yum install vsftpd
mkdir /var/ftp/os
cp -r /mnt/* /var/ftp/os
service vsftpd restart
yum install system-config-kickstart
system-config-kickstart
打开ks文件,查看,分区的位置不应该有#
cp rhks.cfg /var/ftp/os
chmod 755 /var/ftp/os/rhks.cfg
vi /tftpboot/pxelinux.cfg/default
如示例所示
label ks
kernel vmlinuz
append ks=ftp://192.168.9.1/os/rhks.cfg initrd=initrd.img
客户机自动安装
====================================================
cat ksftp2.cfg
#platform=x86, AMD64, 或 Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url="ftp://172.16.11.15/linux"
repo --name="Red Hat Enterprise Linux" --baseurl=ftp://172.16.11.15/linux --cost=100
# Root password
rootpw --iscrypted $1$nWusSXbi$EDexTcuuc476kso8a4zdj.
# System authorization information
auth --useshadow --passalgo=sha512
# Use graphical install
graphical
firstboot --disable
# System keyboard
keyboard us
# System language
lang zh_CN
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# System timezone
timezone Asia/Shanghai
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --append="rhgb crashkernel=auto quiet" --location=mbr --driveorder="sda"
# Partition clearing information
clearpart --all --initlabel
part swap --asprimary --size=1000
part /boot --fstype=ext4 --size=500
part / --grow --size=1
%post --interpreter=/bin/bash
rm -f /etc/yum.repos.d/*
echo '[base]
name=yumlinux
baseurl=ftp://172.16.11.15/linux
gpgcheck=0
enabled=1' > /etc/yum.repos.d/rrr.repo
%end
%packages
@chinese-support
@core
@server-policy
%end
===============================================================