登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

herb

喜欢写博,喜欢安静,喜欢挑战!

 
 
 

日志

 
 

CentOS pxe(DHCP+TFTP+NFS+kickstart)网络安装(2)  

2010-12-20 17:01:59|  分类: Linux Cluster |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

7           KICKSTART 自动安装配置

修改default

default ks

prompt 1

timeout 600

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

label text

kernel vmlinuz

append initrd=initrd.img text

label ks

kernel vmlinuz

append initrd=initrd.img ks=nfs:192.168.15.101:/iso/ks.cfg ksdevice=eth0 devfs=nomount ramdisk_size=8192

label local

localboot 1

label memtest86

kernel memtest

append –

注:default后面要与下面的label保持一致(default ks   label ks 这样才能跳转到ks进行安装)

default中所写,我们要在/iso下放置一个ks.cfg。读取此配置文件进行安装,每台已经安装好的机器都会在主目录下生成anaconda-ks.cfg文件
复制/root下的anaconda-ks.cfg文件到/tftpboot并改名为ks.cfg

#cp /root/anaconda-ks.cfg /tftpboot/ks.cfg

增加一条nfs --server=192.168.15.101 --dir=/iso 来找到系统安装文件
#cp /root/anaconda-ks.cfg /tftpboot/ ks.cfg

  -- 示例:

# Kickstart file automatically generated by anaconda.

install

nfs --server=192.168.15.101 --dir=/iso/

lang zh_CN.UTF-8

keyboard us

xconfig --startxonboot

network --device eth0 --bootproto dhcp

rootpw --iscrypted $1$.Lf0F3Gj$isEVQBryBQYgWy23DhwXA1

firewall --enabled --port=22:tcp

authconfig --enableshadow --enablemd5

selinux --enforcing

timezone --utc Asia/Shanghai

bootloader --location=mbr --driveorder=sda --append="rhgb quiet"

# The following is the partition information you requested

# Note that any partitions you deleted are not expressed

# here so unless you clear all partitions first, this is

# not guaranteed to work

#clearpart --linux --drives=sda

autopart

clearpart --all --drives=sda --initlabel

part /boot --fstype ext3 --size=100 --ondisk=sda

part pv.2 --size=0 --grow --ondisk=sda

volgroup VolGroup00 --pesize=32768 pv.2

logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow

logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=1024 --grow --maxsize=2048

%packages

@base

@chinese-support

@core

@dialup

@editors

@gnome-desktop

@games

@graphical-internet

@graphics

@office

@printing

@sound-and-video

@text-internet

@base-x

keyutils

trousers

fipscheck

device-mapper-multipath

libsane-hpaio

xorg-x11-server-Xnest

 

8           定制安装

[root@Install ~]# init 5
[root@Install ~]# yum install system-config-kickstart

[root@Install ~]# system-config-kickstart

CentOS pxe(DHCP+TFTP+NFS+kickstart)网络安装(2) - herb - herb
 
CentOS pxe(DHCP+TFTP+NFS+kickstart)网络安装(2) - herb - herb
 
CentOS pxe(DHCP+TFTP+NFS+kickstart)网络安装(2) - herb - herb
 
CentOS pxe(DHCP+TFTP+NFS+kickstart)网络安装(2) - herb - herb
 
CentOS pxe(DHCP+TFTP+NFS+kickstart)网络安装(2) - herb - herb
 --上图可定义安装环境、分区、用户、ip等信息
如上在主目录会生成一个安装配置文件:ks.cfg,然后将此文件cp/iso中,便可引导安装!

文件cp/iso中,便可引导安装!

示例:

#platform=x86, AMD64, ?.Intel EM64T

# System authorization information

auth  --useshadow  --enablemd5

# System bootloader configuration

bootloader --location=mbr --password=root123

# Clear the Master Boot Record

zerombr

# Partition clearing information

clearpart --all --initlabel

# Use text mode install

text

# Firewall configuration

firewall --enabled --http --ssh --telnet 

# Run the Setup Agent on first boot

firstboot --disable

# System keyboard

keyboard us

# System language

lang en_US

# Installation logging level

logging --level=info

# Use NFS installation media

nfs --server=192.168.15.101 --dir=/iso

# Network information

network --bootproto=dhcp --device=eth0 --onboot=on

#Root password

rootpw --iscrypted $1$X7s0JJZR$Gm0e9DISLIWaaOmu4wmwe.

 

# SELinux configuration

selinux --enforcing

# System timezone

timezone  America/New_York

# Install OS instead of upgrade

install

# X Window System configuration information

xconfig  --defaultdesktop=GNOME --depth=8 --resolution=640x480

# Disk partitioning information

part /boot --bytes-per-inode=4096 --fstype="ext3" --size=500

part swap --bytes-per-inode=4096 --fstype="swap" --size=1000

part / --bytes-per-inode=4096 --fstype="ext3" --grow --size=1

%packages

@kde-desktop

@java-development

@gnome-desktop

@chinese-support

 

9           参考资料

https://www.ibm.com/developerworks/cn/linux/l-tip-prompt/l-pex/

http://hi.baidu.com/dongfangmn/blog/item/047b1c17c22ff604c83d6d79.html

http://cqfish.blog.51cto.com/622299/155550

 

  评论这张
 
阅读(2574)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018