ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 【松溪】部署Linux系统的网络自动安装

【松溪】部署Linux系统的网络自动安装

原创 Linux操作系统 作者:idba 时间:2008-07-09 21:21:08 0 删除 编辑

部署比较简单,开启如下服务( dhcpd,tftp,nfs,portmap ) 再修改几个配置文件就可以;

一, 开启dhcp服务
修改/etc/dhcpd.conf 文件,修改网络ip信息就可以,然后重启dhcpd服务;
#ddns-update-style. interim;
ddns-update-style. ad-hoc;
ignore client-updates;
allow booting;
allow bootp;
option nis-domain "domain.org";
#option domain-name "pxeserver";
option time-offset -18000; # Eastern Standard Time
default-lease-time 1000;
max-lease-time 1600;

subnet 10.9.200.0 netmask 255.255.255.0 {
option routers 10.9.200.247;
option subnet-mask 255.255.255.0;
option domain-name-servers 111.0.25.132;

range dynamic-bootp 10.9.200.201 10.9.200.211;

filename "linux-install/pxelinux.0";
}
二, 开启tftp服务

开启服务的命令: chkconfig xinetd on , chkconfig tftp on
修改/tftpboot/linux-install/pxelinux.cfg/default 文件;
解释:dba_rhel4u5_x86_64 是配置名称
解释:label dba_rhel4u5_x86_64 是配置具体内容
解释:kernel rhel4-u5-x86_64/vmlinuz 是指/tftpboot/linux-install/rhel4-u5-x86_64/vmlinuz
解释:rhel4-u5-x86_64/initrd.img 是指/tftpboot/linux-install/rhel4-u5-x86_64/initrd.img
解释:/home/os/rhel4-u5-x86_64/ks.cfg.dba 编辑kickstart文件; 默认口令是 hello123

default dba_rhel4u5_x86_64
prompt 1
timeout 30
display msgs/boot.msg
F1 msgs/boot.msg
F2 msgs/general.msg
F3 msgs/expert.msg
F4 msgs/param.msg
F5 msgs/rescue.msg
F7 msgs/snake.msg

label dba_rhel4u5_x86_64
kernel rhel4-u5-x86_64/vmlinuz
append ks=nfs:10.9.200.151:/home/os/rhel4-u5-x86_64/ks.cfg.dba ksdevice=eth0 initrd=rhel4-u5-x86_64/initrd.img devfs=nomount ramdisk_size=16384 nofb
Kickstart文件如下:
cat /home/os/rhel4-u5-x86_64/ks.cfg.dba
# ks.cfg.app
# kickstart file for search server
#Generated by Kickstart Configurator

#System language
lang en_US
#Language modules to install
langsupport zh_CN.GB18030 --default=en_US
#System keyboard
keyboard us
#System mouse
mouse generic3ps/2
#Sytem timezone
timezone Asia/Shanghai
#Root password
rootpw --iscrypted $1$UHlWseBT$Bbyz7d/cVx5Is2ojBKWVO/
#Reboot after installation
reboot
#Install Red Hat Linux instead of upgrade
install
#Use NFS installation Media
nfs --server=10.9.68.250 --dir=/home/os/rhel4-u5-x86_64
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part /boot --fstype ext3 --size 128 --asprimary --ondisk cciss/c0d0
part swap --size 16384 --asprimary --ondisk cciss/c0d0
part / --fstype ext3 --size 1 --grow --ondisk cciss/c0d0
part /u01 --fstype ext3 --size 1 --grow --ondisk cciss/c0d1
#System authorization infomation
auth --useshadow --enablemd5
#Network information
network --bootproto=dhcp --device=eth0
#Firewall configuration
firewall --disabled
selinux --disabled
#Do not configure XWindows
skipx
#Package install information
%packages --resolvedeps
@ everything
#%pre
#mkdir /mnt/temp-pre
#mount -o nolock 10.9.19.222:/opt/iso/rhel4-u4 /mnt/temp-pre
#open -s -w -- /mnt/temp/preinst.sh
#umount /mnt/temp-pre

#%post
#umount /mnt/temp
三,开启nfs,portmap 两个服务,用chkconfig命令;
编辑 /etc/exports 添加一行记录;
/home/os *(ro,sync)

四, 安装文件与Kickstart文件
find /home/os
/home/os
/home/os/rhel4-u5-x86_64
/home/os/rhel4-u5-x86_64/RHEL4-U5-x86_64-AS-disc4.iso
/home/os/rhel4-u5-x86_64/RHEL4-U5-x86_64-AS-disc1.iso
/home/os/rhel4-u5-x86_64/md5.txt
/home/os/rhel4-u5-x86_64/RHEL4-U5-x86_64-AS-disc5.iso
/home/os/rhel4-u5-x86_64/RHEL4-U5-x86_64-AS-disc3.iso
/home/os/rhel4-u5-x86_64/RHEL4-U5-x86_64-AS-disc2.iso
/home/os/rhel4-u5-x86_64/ks.cfg.dba

完成以上步骤就完成了在本地网段通过网络自动安装linux系统的配置; 启动hp服务器,按 F12 选择网络启动就可以;

五, 附录(hp ilo 远程控制卡的使用)
ilo 远程控制卡默认都是配置了admin用户 口令是:xx
ilo 的默认ip地址都是 相应网段的 xxx.xxx.0.xxx; 例如: 10.9.68.125 的远程控制卡ip就是 10.9.0.125;
在windows的ie界面输入ip地址就能打开界面;

http://rdc.taobao.com/blog/dba/html/185_%e9%83%a8%e7%bd%b2linux%e7%b3%bb%e7%bb%9f%e7%9a%84%e7%bd%91%e7%bb%9c%e8%87%aa%e5%8a%a8%e5%ae%89%e8%a3%85.html/trackback

<!--

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/1384/viewspace-374819/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-03-25

  • 博文量
    210
  • 访问量
    394627