- 论坛徽章:
- 0
|
原来很简单的,我用的是redhat
1.需要disk1下的/images/boot.iso
2.用ultraiso提取isolinux下的isolinux.cfg文件,修改后更新
修改其中的
label linux
kernel vmlinuz
append initrd=initrd.img ks=cdrom
label ks
kernel vmlinuz
append ks initrd=initrd.img ks=nfs:nfsserver.domain.com:/var/ftp/incoming/autoinstall.cfg
3.这里需要用一台机器开nfs服务,将redhat的几个iso文件都放在下面。这里采用nfsserver.domain.com,exports文件如下
#cat /etc/exports
/var/ftp *
iso文件放在nfsserver.domain.com /var/ftp/pub/rhel3
4.cfg文件制作,可以用redhat-config-kickstart你喜欢的类型
我这里有2个cfg文件
ks.cfg:用ultraiso放在boot.iso的根目录下
内容如下:
#Generated by Kickstart Configurator
#System language
lang en_US
#Language modules to install
langsupport zh_CN.GB2312 zh_TW.Big5 cs_CZ da_DK nl_NL fr_FR de_DE is_IS it_IT ja_JP.eucJP ko_KR.eucKR no_NO pt_PT ru_RU.k0I8r sl_SI es_ES sv_SE uk_UA --default=en_US
#System keyboard
keyboard us
#System mouse
mouse generic3ps/2
#Sytem timezone
timezone Asia/Shanghai
#Root password
rootpw --iscrypted $1$/REHUsmZ$r3vBM54c7iCUu9RsgnB4X/
#Reboot after installation
reboot
#Use text mode install
text
#Install Red Hat Linux instead of upgrade
install
#Use NFS installation Media
nfs --server=nfsserver.domain.com --dir=/var/ftp/pub/rhel3
#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 100
part / --fstype ext3 --size 3096 --grow
part swap --size 512
#System authorization infomation
auth --useshadow --enablemd5
#Network information
network --bootproto=dhcp --device=eth0
#Firewall configuration
firewall --disabled
#XWindows configuration information
xconfig --depth=24 --resolution=800x600 --defaultdesktop=GNOME --startxonboot
#Package install information
%packages --resolvedeps
@ X Window System
@ GNOME Desktop Environment
@ KDE Desktop Environment
@ Editors
@ Engineering and Scientific
@ Graphical Internet
@ Text-based Internet
@ Office/Productivity
@ Sound and Video
@ Graphics
@ Games and Entertainment
@ Authoring and Publishing
@ Server Configuration Tools
@ Web Server
@ Mail Server
@ Windows File Server
@ DNS Name Server
@ FTP Server
@ News Server
@ Network Servers
@ Development Tools
@ Kernel Development
@ X Software Development
@ GNOME Software Development
@ KDE Software Development
@ Administration Tools
@ System Tools
@ Printing Support
%post
ifconfig eth0|grep "inet addr"|awk '{print $2}'| mail -s "Linux install fininshed " bitizerg@hotmail.com
第二个文件放在nfsserver.domain.com /var/ftp/incoming/autoinstall.cfg
内容如下
#Generated by Kickstart Configurator
#System language
lang en_US
#Language modules to install
langsupport zh_CN.GB2312 zh_TW.Big5 cs_CZ da_DK nl_NL fr_FR de_DE is_IS it_IT ja_JP.eucJP ko_KR.eucKR no_NO pt_PT ru_RU.k0I8r sl_SI es_ES sv_SE uk_UA --default=en_US
#System keyboard
keyboard us
#System mouse
mouse generic3ps/2
#Sytem timezone
timezone Asia/Shanghai
#Root password
rootpw --iscrypted $1$/REHUsmZ$r3vBM54c7iCUu9RsgnB4X/
#Reboot after installation
reboot
#Use text mode install
text
#Install Red Hat Linux instead of upgrade
install
#Use NFS installation Media
nfs --server=nfsserver.domain.com --dir=/var/ftp/pub/rhel3
#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 100
part / --fstype ext3 --size 3096 --grow
part swap --size 4096
#System authorization infomation
auth --useshadow --enablemd5
#Network information
#umcomment it after fininshed
#network --bootproto=dhcp --device=eth0
#modify ip address before install,and comment it after fininshed
network --bootproto=static --ip=111.111.111.111 --netmask=255.255.252.0 --gateway=111.111.111.1 --nameserver=111.111.111.25 --device=eth0
#Firewall configuration
firewall --disabled
#XWindows configuration information
xconfig --depth=24 --resolution=800x600 --defaultdesktop=GNOME --startxonboot
#Package install information
%packages --resolvedeps
@ X Window System
@ GNOME Desktop Environment
@ KDE Desktop Environment
@ Editors
@ Engineering and Scientific
@ Graphical Internet
@ Text-based Internet
@ Office/Productivity
@ Sound and Video
@ Graphics
@ Games and Entertainment
@ Authoring and Publishing
@ Server Configuration Tools
@ Web Server
@ Mail Server
@ Windows File Server
@ DNS Name Server
@ FTP Server
@ News Server
@ Network Servers
@ Development Tools
@ Kernel Development
@ X Software Development
@ GNOME Software Development
@ KDE Software Development
@ Administration Tools
@ System Tools
@ Printing Support
#@ everything
#kernel
#grub
%post
ifconfig eth0|grep "inet addr"|awk '{print $2}'| mail -s "Linux install fininshed " bitizerg@hotmail.com
5.将boot.iso刻盘
可完成一下功能
启动后直接回车(or一直等待):采用光盘的ks.cfg,自动安装全部packages,ip由dhcp获得,所有分区都会被清楚
用ks命令:用nfsserver.domian.com的autoinstall.cfg安装,采用其中指定的ip地址,当你需要安装一台新机器的时候,必须修改其中的ip地址
安装顺利的话,完成后会有邮件到你邮箱 |
|