`
jedy
  • 浏览: 147865 次
  • 性别: Icon_minigender_1
  • 来自: 上海
文章分类
社区版块
存档分类
最新评论

Auto Install with Kickstart

阅读更多
  • Copy install files of redhat
  • Setup NFS server
    • Related files
    • Setting
    • Start
    • Usage
  • Kickstart config file
    • File
    • Note
  • DHCP
  • PXE
    • Set bios for DELL
    • set tftp server
    • set boot item
  • More Scripts
    • boot.msg
    • pxelinux.cfg/default
    • ks.cfg
    • ks_more.cfg
    • mysql.sh
    • qmail.sh
    • set.sh

Copy install files of redhat

mkdir /misc/redhat 

insert each install CD of RedHat

mount /dev/cdrom /mnt/cdrom 

if CD1

cp -var /mnt/cdrom/. /misc/redhat 

other CDs

cp -var /mnt/cdrom/RedHat /misc/redhat umount /mnt/cdrom eject 

Setup NFS server

Related files

/etc/exports -- config file
/usr/sbin/exportfs
/usr/sbin/showmount -- check
/var/lib/nfs/xtab -- log

Setting

echo "/mis/redhat 192.168.2.0/24(ro,no_root_squash)" >> /etc/exports 

ro -- readonly
no_root_squash -- every user on remote is nobody except root

Start

service portmap start
service nfs start

Usage

mount –t nfs -o soft,intr,timeout=30 192.168.2.119:/usr/home /usr/home/ 
  • timeo=n

This sets the time (in tenths of a second) the NFS client will wait for a request to complete. The default value is 7 (0.7 seconds). What happens after a timeout depends on whether you use the hard or soft option.

  • soft

Soft-mount (as opposed to hard-mount) the driver. This option causes an I/O error to be reported to the process attempting a file operation when a major timeout occurs.

  • intr

Allow signals to interrupt an NFS call. Useful for aborting when the server doesn't respond.

Kickstart config file

File

ks.cfg content:

#Generated by Kickstart Configurator 
#System language
lang en_US
#Language modules to install
langsupport zh_CN.GB2312 zh_TW.Big5 ja_JP.eucJP --default=en_US
#System keyboard
keyboard us
#System mouse
mouse generic3ps/2
#Sytem timezone
timezone Asia/Tokyo
#Root password rootpw --iscrypted $1$yifNoGyM$fq2lHrrfGIEyvglxnSuZ0.
#Reboot after installation
reboot
#Use text mode install
text
#Install Red Hat Linux instead of upgrade
install
#Use NFS installation Media
nfs --server=192.168.2.119 --dir=/misc/redhat/
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part / --fstype ext3 --size 5000 --asprimary
part /boot --fstype ext3 --size 100 --asprimary
part swap --size 1024 --asprimary
part /home --fstype ext3 --size 5000
part /usr --fstype ext3 --size 5000 --asprimary
part /var --fstype ext3 --size 1 --grow
#System authorization infomation
auth --useshadow --enablemd5
#Network information
network --bootproto=dhcp --device=eth0
#Firewall configuration
firewall --disabled
#Do not configure XWindows
skipx
#Package install information
%packages --resolvedeps
@ Development Tools
ntp

%post
#!/bin/bash
if [ -e /etc/ntp.conf ]; then
mv /etc/ntp.conf /etc/ntp.conf.bak
fi
echo "server dns5.sakura.ad.jp
driftfile /etc/ntp/drift
broadcastdelay 0.008" > /etc/ntp.conf
chkconfig --level 3 ntpd on

copy to NFS directory

cp ks.cfg /misc/redhat 

enter the following command at the boot: prompt:

linux ks=nfs:192.168.2.119:/misc/redhat/ks.cfg 

Note

When installing, it has following message:

Could not allocate requested partitions Partitioning failed:
Could not allocate partitions Press OK to reboot your system

Maybe partitions are too large.

DHCP

Append this to /etc/dhcp.conf

allow booting;
allow bootp;
class "pxeclients" {
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
next-server <server-ip>;
filename "linux-install/pxelinux.0";
}

Then

service dhcpd restart 

server-ip is tftp server's ip, e.g. 192.168.2.119

PXE

Set bios for DELL

Selecting MBA UNDI allows the system to boot from the network server. The MBA UNDI option appears under Boot Sequence only if the Network Interface Controller option is set to On w/MBA. If the Network Interface Controller option is set to On or Off, set it to On w/MBA and then press <Alt><b> to save the change and reboot the system. MBA UNDI then appears under Boot Sequence.

set tftp server

/sbin/chkconfig --level 345 xinetd on
/sbin/chkconfig --level 345 tftp on
mkdir /tftpboot/linux-install
cd /tftpboot/linux-install
cp /usr/lib/syslinux/pxelinux.0 ./
# directory image and isolinux are on CD1 of redhat install CDs
cp /mnt/cdrom/image/pxeboot/initr.img ./
cp /mnt/cdrom/image/pxeboot/vmlinux ./
mkdir pxelinux.cfg
cp /mnt/cdrom/isolinux/isolinux.cfg ./pxelinux.cfg/default
cp /mnt/cdrom/isolinux/*.msg ./

set boot item

Add this into boot.msg

-  To auto install Red Hat Enterprise Linux, type:     autoinstall <ENTER>. 

Add this into default.

label autoinstall   kernel vmlinuz   append ks=nfs:192.168.2.119:/misc/redhat/ks.cfg initrd=initrd.img 

Then at the "boot:" prompt type "autointall".

More Scripts

Using these scripts to choose to install MySQL and qmail.

boot.msg

splash.lss   -  To install or upgrade Red Hat Enterprise Linux in graphical mode,      press the <ENTER> key.   -  To install or upgrade Red Hat Enterprise Linux in text mode, type:      linux text <ENTER>.    -  To install Red Hat Enterprise Linux only, type:      base <ENTER>.   -  To install Red Hat Enterprise Linux, MySQL and qmail, type:     install <ENTER>.   -  Use the function keys listed below for more information.  [F1-Main] [F2-Options] [F3-General] [F4-Kernel] [F5-Rescue]  

pxelinux.cfg/default

default bse
prompt 1 timeout 300
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
F7 snake.msg
label linux
kernel vmlinuz
append initrd=initrd.img
label text
kernel vmlinuz
append initrd=initrd.img text
label expert
kernel vmlinuz
append expert initrd=initrd.img
label ks
kernel vmlinuz
append ks initrd=initrd.img
label lowres
kernel vmlinuz
append initrd=initrd.img lowres
label base
kernel vmlinuz
append ks=nfs:192.168.1.1:/misc/redhat/ks.cfg initrd=initrd.img
label install
kernel vmlinuz
append ks=nfs:192.168.1.1:/misc/redhat/ks_more.cfg initrd=initrd.img

ks.cfg

# kickstart auto install config
# Author : Wu Hao
# Date : 2005/08/24
#System language
lang en_US
#Language modules to install
langsupport zh_CN.GB2312 zh_TW.Big5 ja_JP.eucJP --default=en_US
#System keyboard
keyboard us
#System mouse
mouse generic3ps/2
#Sytem timezone
timezone Asia/Tokyo
#Root password
rootpw --iscrypted $1$yifNoGyM$fq2lHrrfGIEyvglxnSuZ0.
#Reboot after installation
reboot
#Use text mode install
text
#Install Red Hat Linux instead of upgrade
install
#Use NFS installation Media
nfs --server=192.168.1.1 --dir=/misc/redhat/
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part / --fstype ext3 --size 5000 --asprimary
part /boot --fstype ext3 --size 100 --asprimary
part swap --size 1024 --asprimary
#part /home --fstype ext3 --size 5000
#part /usr --fstype ext3 --size 5000 --asprimary
part /var --fstype ext3 --size 1 --grow
#System authorization infomation
auth --useshadow --enablemd5
#Network information
network --bootproto=dhcp --device=eth0
#Firewall configuration
firewall --disabled
#Do not configure XWindows skipx
#Package install information
%packages --resolvedeps
@ Development Tools
ntp
%post --nochroot
#!/bin/bash
SOURCE_DIR=/mnt/source/others
TARGET_DIR=/mnt/sysimage/usr/src
R_TARGET_DIR=/usr/src
mkdir -p $TARGET_DIR
#set
cp $SOURCE_DIR/set.sh $TARGET_DIR
chroot /mnt/sysimage/ $R_TARGET_DIR/set.sh

ks_more.cfg

Only post part is different from ks.cfg.

%post --nochroot
chvt 3
exec > /dev/tty3 < /dev/tty3
SOURCE_DIR=/mnt/source/others
TARGET_DIR=/mnt/sysimage/usr/src
R_TARGET_DIR=/usr/src
mkdir -p $TARGET_DIR
#default set
cp $SOURCE_DIR/set.sh $TARGET_DIR
echo "#!/bin/sh" >> /mnt/sysimage/tmp/run
echo $R_TARGET_DIR/set.sh >> /mnt/sysimage/tmp/run
#mysql
echo "Do you want to install MySQL?[y/n]"
read answer
if [ $answer == "y" ]; then
cp $SOURCE_DIR/perl-DBI-1.32-5.i386.rpm $TARGET_DIR
cp $SOURCE_DIR/MySQL-server-standard-4.1.13-0.rhel3.i386.rpm $TARGET_DIR
cp $SOURCE_DIR/MySQL-client-standard-4.1.13-0.rhel3.i386.rpm $TARGET_DIR
cp $SOURCE_DIR/mysql.sh $TARGET_DIR
echo $R_TARGET_DIR/mysql.sh >> /mnt/sysimage/tmp/run
fi
#qmail
echo "Do you want to install qmail?[y/n]"
read answer
if [ $answer == "y" ]; then
echo "Input FQDN of your mail server"
read mail_server
cp $SOURCE_DIR/checkpassword-0.90.tar.gz $TARGET_DIR
cp $SOURCE_DIR/qmail-1.03.tar.gz $TARGET_DIR
cp $SOURCE_DIR/ucspi-tcp-0.88.tar.gz $TARGET_DIR
cp $SOURCE_DIR/qmail.sh $TARGET_DIR
echo "$R_TARGET_DIR/qmail.sh install" >> /mnt/sysimage/tmp/run
echo "echo $mail_server | $R_TARGET_DIR/qmail.sh setup" >> /mnt/sysimage/tmp/run
fi
chvt 1

%post
chvt 3
chmod 755 /tmp/run /tmp/run
chvt 1

mysql.sh

#!/bin/bash
cd /tmp
rpm -i perl-DBI-1.32-5.i386.rpm
groupadd mysql
useradd -g mysql mysql
rpm -i MySQL*.rpm

qmail.sh

渡瀬さんのスクリプトを使う

set.sh

#!/bin/bash 
#ntp
if [ -e /etc/ntp.conf ]; then
mv /etc/ntp.conf /etc/ntp.conf.bak
fi
echo "server dns5.sakura.ad.jp
driftfile /etc/ntp/drift
broadcastdelay 0.008" > /etc/ntp.conf
chkconfig --level 3 ntpd on
#close useless services
chkconfig microcode_ctl off
chkconfig gpm off
chkconfig mdmonitor off
chkconfig atd off
chkconfig apmd off
chkconfig isdn off
chkconfig pcmcia off
chkconfig autofs off
chkconfig rhnsd off
chkconfig cups off
chkconfig xfs off
chkconfig canna off
chkconfig FreeWnn off
chkconfig rawdevices off
#DNS
echo "nameserver 202.216.224.67
nameserver 202.216.224.66
nameserver 210.188.224.9
nameserver 210.224.172.13
nameserver 202.222.22.172
search localhost" > /etc/resolve.conf

分享到:
评论

相关推荐

    linux PXE server with kickstart

    Linux PXE Server with Kickstart自动化安装Linux OS 在IT领域,Linux PXE(预启动执行环境)服务器配合Kickstart是实现大规模Linux操作系统自动安装的有效方法。本文将详细介绍如何配置RHEL5U8 x64系统的PXE自动...

    pxe_install_kickstart_centos7.sh

    PXE部署系统安装

    KickStart-2-10-0-490-KICKSTART-2.10.0.zip

    本文将深入探讨"KickStart-2-10-0-490-KICKSTART-2.10.0.zip"压缩包中的关键内容,包括其提供的软件——Keithley KickStart 2.10.0版,以及如何利用该软件进行高效、精确的测试。 首先,Keithley KickStart是一款...

    Kickstart_2_4_0_486_KICKSTART-2.4.0.zip

    《Keithley Kickstart 2.4.0:全方位掌握KEITHLEY仪器控制》 Keithley公司的Kickstart软件是一款专为操作和控制Keithley全线仪器设计的强大工具。此软件的最新版本,即"Kickstart_2_4_0_486_KICKSTART-2.4.0.zip",...

    KickStart_2_1_0_1184_KICKSTART-2.1.0.zip

    Keithley KickStart 2.1.0 是一款专为电气测试和测量设备设计的软件工具,主要用于简化和自动化测试过程。这款软件适用于那些需要高效、精确进行电气参数测量的工程师和科学家。它提供了用户友好的界面,使得设置和...

    kickstart 无人值守安装

    ### Kickstart无人值守安装详解 #### 一、引言 在IT运维领域,尤其是系统部署环节,Kickstart无人值守安装技术被广泛应用于大规模部署Linux操作系统,如RedHat Enterprise Linux(RHEL)。此技术能有效避免手工...

    autoinstall:Autoinst索引

    本文将深入探讨三种不同的自动化安装方法,包括基于Kickstart的CentOS自动化安装、基于AutoYaST的SuSE自动化安装以及VMware ESXi的自动化部署实践。 【 Kickstart 自动化安装 CentOS 】 Kickstart是Red Hat系Linux...

    kickstart配置文件详解

    kickstart配置文件详解kickstart配置文件详解

    kickstart企业级部署安装

    kickstart是Linux系统中一种用于自动化安装Linux发行版的工具,它可以预先设置安装参数和配置,如分区、软件包选择、网络设置等,然后通过网络启动计算机并自动执行这些预设的配置来完成安装过程。kickstart的使用...

    kickstart自动全新安装ubuntu_server

    《使用Kickstart自动全新安装Ubuntu Server详解》 在IT领域,自动化部署是一项重要的任务,能够大大提高工作效率,降低出错概率。本文将详细介绍如何利用Kickstart技术自动全新安装Ubuntu Server,适用于那些希望...

    kickstart详解

    kickstart详细解释说明及示例。 内容涵盖RHEL5、RHEL6。

    KickStart无人值守批量安装Linux

    # KickStart无人值守批量安装Linux 在大规模部署Linux系统时,手动逐台进行安装显然效率低下且容易出错。为此,Linux提供了`KickStart`技术,它允许管理员预定义安装配置,实现自动化无人值守的批量安装。本文将...

    RHEL6 kickstart 网络部署指南

    - `install`:指示进行安装操作。 - `text` 或 `graphical`:指定安装模式。 - `lang`、`keyboard`、`timezone` 等:设置语言、键盘布局、时区等基本信息。 - `authconfig`、`network`:配置认证方式和网络设置。 - ...

    VMWare ESXi 5.1 Kickstart Image

    VMWare ESXi 5.1 Kickstart Image This tutorial explains how to create a VMWare ESXi 5.1 image using a scripted install approach.

    PXE+kickstart批量部署操作系统.pdf

    bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet" clearpart --all --initlabel autopart --type=lvm --useexisting %post --nochroot # 自定义脚本 echo "System Installation ...

    install_cobbler.zip_Cobbler服务的部署_cobbler_kickstart

    Cobbler服务的部署是自动化Linux系统安装的关键步骤,它结合了Kickstart技术,使得大规模服务器部署变得简单高效。在本教程中,我们将深入探讨如何安装Cobbler服务,导入系统镜像,以及配置Kickstart文件,以实现...

    通过kickstart技术实现无人值守安装操作系统

    通过Kickstart技术实现无人值守安装操作系统 Kickstart技术是一种自动化安装操作系统的方法,可以实现无人值守安装操作系统,大大减少了安装操作系统的时间和人力投入。下面是通过Kickstart技术实现无人值守安装...

    Centos7 kickstart 配置

    ### Centos7 Kickstart 自动化安装配置详解 #### 一、概述 Kickstart 是一种自动化部署工具,它能够帮助用户实现对 CentOS 或其他 Red Hat 基础系统的无人值守安装。通过创建一个预定义的配置文件(通常命名为 `ks....

    kickstart-3.3.2.zip for Joomla!1.5

    【标题】"kickstart-3.3.2.zip for Joomla!1.5"是一个用于Joomla!1.5.x版本的备份恢复工具,主要与AKEEBA备份系统配合使用。这个压缩包包含了必要的文件,帮助用户方便快捷地完成对Joomla!1.5网站的数据恢复操作。 ...

    PXE+kickstart批量部署操作系统.docx

    "PXE+kickstart批量部署操作系统" PXE(Preboot Execution Environment)是一种网络启动技术,允许计算机从远程服务器上启动操作系统。Kickstart是一种自动化安装Linux操作系统的工具,经常与PXE结合使用,实现批量...

Global site tag (gtag.js) - Google Analytics