- 论坛徽章:
- 0
|
小弟我是一个Linux菜鸟,前些天,和一个朋友说起了LINUX下的无人职守安装,朋友有点不相信还可以这样做系统的,本人决定实验一次给他看看,呵呵,不过我也不是很熟,周末刚好有时间,拿出来练练手,虽然出了一些问题,最后还是成功了,现在和大家分享一下,小弟技术有限,有不清楚的地方还请大家海涵。
环境: 服务器(RHEL5),采用DHCP,NFS,和TFTP安装,所有服务都在同一台机子上,IP---->192.168.1.11/255.255.255.0
客户端(需安装系统的机子),用两台虚拟机实现,所装系统也是RHEL5
一:生成ks.cfg配置文件
运行system-config-kickstar,图行界面配置,大家都知道怎么做。
我的ks.cfg配置文件内容如下:
#platform=x86, AMD64, 或 Intel EM64T
# System authorization information
auth --useshadow --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --none
# Use graphical install
graphical
# Firewall configuration
firewall --disabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang zh_CN
key --skip
# Installation logging level
logging --level=info
# Use NFS installation media
nfs --server=192.168.1.11 --dir=/mnt
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# Reboot after installation
reboot
#Root password
rootpw --iscrypted $1$sUvSsRx3$yQzIfw7pgABOlHNosj/Ts0
# SELinux configuration
selinux --disabled
# System timezone
timezone America/New_York
# Install OS instead of upgrade
install
# X Window System configuration information
xconfig --defaultdesktop=GNOME --depth=8 --resolution=1024x768 --startxonboot
# Disk partitioning information
part /boot --bytes-per-inode=4096 --fstype="ext3" --size=100
part swap --bytes-per-inode=4096 --fstype="swap" --size=1024
part / --bytes-per-inode=4096 --fstype="ext3" --grow --size=5000
%packages
@office
@development-libs
@editors
@system-tools
@gnome-software-development
@text-internet
@x-software-development
@gnome-desktop
@dialup
@core
@base
@java
@java-development
@openfabrics-enterprise-distribution
@legacy-software-support
@base-x
@chinese-support
@graphics
@ruby
@printing
@kde-software-development
@kde-desktop
@server-cfg
@sound-and-video
@admin-tools
@development-tools
@graphical-internet
perl-Convert-ASN1
emacs
festival
audit
mesa-libGLU-devel
kexec-tools
fipscheck
device-mapper-multipath
xorg-x11-utils
xorg-x11-server-Xnest
xorg-x11-server-Xvfb
libsane-hpaio
imake
二:安装DHCP服务
yum -y install dhcp
cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf ------>拷贝DHCP服务的模板主配置文件
vim /etc/dhcpd.conf 如下:
ddns-update-style interim;
ignore client-updates;
next-server 192.168.1.11;
filename "/pxelinux.0";
subnet 192.168.1.0 netmask 255.255.255.0 {
# --- default gateway
option routers 192.168.1.11;
option subnet-mask 255.255.255.0;
option nis-domain "domain.org";
option domain-name "domain.org";
option domain-name-servers 192.168.1.11;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.1.128 192.168.1.254;
default-lease-time 21600;
max-lease-time 43200;
}
启动服务 service dhcpd restart
三:NFS服务
vim /etc/exports 如下:
/mnt *(rw) ----------->此目录为挂载系统ISO镜像文件的目录,共享
/mnt1 *(rw) ----------->此目录为存放ks.cfg的目录,共享
mount -o loop /root/RHEL5U3.iso /mnt ----------->挂载光盘镜像文件
cp /root/ks.cfg /mnt1
启动服务 service nfs restart
四:TFTP服务
yum -y install tftp-server
mkdir /tftpboot/pxelinux.cfg/
cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
cp /mnt/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
cp /mnt/isolinux/vmlinuz /tftpboot/
cp /mnt/isolinux/initrd.img /tftpboot/
启动tftp服务
chkconfig tftp on
service xinetd restart
五:vim /tftpboot/pxelinux.cfg/default 文件,内容如下(没有全部,只是其中有用的一部分)
default linux
prompt 1
timeout 10
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label linux
kernel vmlinuz
append initrd=initrd.img text ks=nfs:192.168.1.11:/mnt1/ks.cfg
label text
kernel vmlinuz
append initrd=initrd.img text
六:服务端配置完成,启动客户机,进行安装。 |
|