Chinaunix首页 | 论坛 | 博客
  • 博客访问: 175793
  • 博文数量: 159
  • 博客积分: 7007
  • 博客等级: 准将
  • 技术积分: 1750
  • 用 户 组: 普通用户
  • 注册时间: 2008-06-17 15:05
文章分类

全部博文(159)

文章存档

2010年(39)

2009年(106)

2008年(14)

我的朋友

分类: LINUX

2010-06-17 15:31:46

欢迎转载,但请注明出处:

virtualBox虚拟机测试通过:
centos5.4安装gnome桌面
本机ip地址:192.168.10.18/24
1.生成ks.cfg文件
[root@localhost ~]#mount /dev/cdrom /mnt
[root@localhost ~]# cd /
[root@localhost /]# mkdir install
[root@localhost /]# cd install/
[root@localhost install]# cp -dpR /mnt/* ./
[root@localhost install]# yum install system-config-kickstart
包依赖关系会安装pykickstart和system-config-kickstart两个包.
[root@localhost install]# system-config-kickstart
出现如下的弹出窗口,自己配置
生成ks.cfg文件,我的文件内容如下

#platform=x86, AMD64, 或 Intel EM64T
# System authorization information
auth --useshadow --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Use text mode install
text
# Firewall configuration
firewall --disabled
# 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.10.18 --dir=/install
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# Reboot after installation
reboot
#Root password
rootpw --iscrypted $1$re06prfC$oEc/9rRpch0t0lIb/akmS1

# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone Asia/Shanghai
# Install OS instead of upgrade
install
# Disk partitioning information
part /boot --bytes-per-inode=4096 --fstype="ext3" --size=200
part swap --bytes-per-inode=4096 --fstype="swap" --size=512
part / --bytes-per-inode=4096 --fstype="ext3" --grow --size=1

%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

ks.cfg文件保存在/install目录下。。。
2.配置dhcp服务:
目的:给需要安装的服务器分配ip地址
[root@localhost install]# yum install dhcp*
[root@localhost install]# cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
[root@localhost install]# vi /etc/dhcpd.conf 

ddns-update-style interim;
ignore client-updates;

subnet 192.168.10.0 netmask 255.255.255.0 {

# --- default gateway
    option routers            192.168.10.18;
    option subnet-mask        255.255.255.0;

    option nis-domain        
"test";
    option domain-name        
"test.org";
    option domain-name-servers    192.168.10.18;

    option time-offset        -18000;    # Eastern Standard Time
#    option ntp-servers        192.168.1.1;
#    option netbios-name-servers    192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
#    option netbios-node-type 2;

    range dynamic-bootp 192.168.10.128 192.168.10.254;
    default-lease-time 21600;
    max-lease-time 43200;
    filename
"/pxelinux.0";
    next-server 192.168.10.18;

    # we want the nameserver to appear at a fixed address
    host ns {
        next-server marvin.redhat.com;
        hardware ethernet 12:34:56:78:AB:CD;
        fixed-address 207.175.42.254;
    }
}

[root@localhost install]# /etc/rc.d/init.d/dhcpd start
3.配置TFTP服务:
目的:为需要安装服务器提供下载启动镜像
[root@localhost install]# yum install tftp*
[root@localhost install]# vi /etc/xinetd.d/tftp 

# default: off
# description: The tftp server serves files using the trivial file transfer \
#    protocol. The tftp protocol is often used to boot diskless \
#    workstations, download configuration files to network-aware printers, \
#    and to start the installation process for some operating systems.
service tftp
{
    socket_type        = dgram
    protocol        = udp
    wait            = yes
    user            = root
    server            = /usr/sbin/in.tftpd
    server_args        = -s /tftpboot
    disable        = no
    per_source        = 11
    cps            = 100 2
    flags            = IPv4
}

[root@localhost install]# /etc/rc.d/init.d/xinetd start
4.配置NFS服务:
当然,你也可使用http,ftp方式来安装
[root@localhost install]# vi /etc/exports 
/install        192.168.10.0/24(ro,async)
[root@localhost install]# /etc/rc.d/init.d/portmap start
[root@localhost install]# /etc/rc.d/init.d/nfs start
[root@localhost install]# showmount -e 192.168.10.18
Export list for 192.168.10.18:
/install 192.168.10.0/24
5.配置支持PXE启动:
[root@localhost install]# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
[root@localhost install]# cp images/pxeboot/initrd.img /tftpboot/
[root@localhost install]# cp images/pxeboot/vmlinuz /tftpboot/
[root@localhost install]# cp isolinux/*.msg /tftpboot/
[root@localhost install]# cp /install/isolinux/splash.lss ./
splash.lss会让安装时显示出centos5的图形样子,^_^
[root@localhost install]# cd /tftpboot/
[root@localhost tftpboot]# ls
boot.msg  general.msg  initrd.img  options.msg  param.msg  pxelinux.0    rescue.msg  splash.lss  vmlinuz
[root@localhost tftpboot]# mkdir pxelinux.cfg
[root@localhost tftpboot]# cd pxelinux.cfg/
启动镜像pxelinux.0文件在执行过程中,会读取配置文件以确定它应该载入什么Linux内核文件来运行。所有的配置文件都放在启动服务器的/tftpboot/pxelinux.cfg/目录下。pxelinux.0根据一定的规则来搜索合适的配置文件名。举例来说,对于前面为待安装机器,dhcp服务分配的IP地址192.168.10.254(十六进制表示为C0A80AFE),MAC地址(08:00:27:3F:1F:D9),pxelinux.0会按如下次序搜索配置文件:

01-08-00-27-3F-1F-D9 > C0A80AFE > C0A80AF > … > C0 > C > default

对于一台需要支持很多安装机器的安装服务器来说,将配置写在与IP地址对应的文件里很不灵活。把所有配置都集中在default文件中是个不错的主意,可以减轻配置文件维护负担。
[root@localhost pxelinux.cfg]# cp /install/isolinux/isolinux.cfg default
[root@localhost pxelinux.cfg]# vi default

default linux
prompt 1
timeout 600
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg

label local 

localboot 0 

label linux

kernel vmlinuz

append ks=nfs:192.168.10.18:/install/ks.cfg  initrd=initrd.img  devfs=nomount  ramdisk_size=9216

label text 

kernel vmlinuz 

append initrd=initrd.img text devfs=nomount ramdisk_size=9216 

label expert 

kernel vmlinuz 

append expert initrd=initrd.img devfs=nomount ramdisk_size=9216 

label ks 

kernel vmlinuz 

append ks initrd=initrd.img devfs=nomount ramdisk_size=9216 

label nofb 

kernel vmlinuz 

append initrd=initrd.img devfs=nomount nofb ramdisk_size=9216 

label lowres 

kernel vmlinuz 

append initrd=initrd.img lowres devfs=nomount ramdisk_size=9216 

kernel vmlinuz

ok,现在开一个虚拟机,然后从网卡启动,


错误
 could not find kernel image linux 
解决:
在dhcpd.conf里加入next-server 192.168.10.11;
错误:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,3)
方法:
当时用kde的桌面做的实验,出现这个问题,搜了好多,也没找到办法,后来从新安装了测试环境,用的gnome桌面,没出现这个情况,不知是bug还是哪里设置的问题
错误:
install exited abnormally 1 1
方法:
用的centos5.2的时候出现的,后来换centos5.4就ok了...

阅读(538) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-06-20 10:13:35

你好!博客狠棒If you are looking for nike air max 2010 and kobe shoes. I will tell you that MBT Shoes is well-known for its positive effect to human body. MBT is one technology originally, MBT Shoes clearance sale, it began in Masai which is a tribe of Eastern Africa. 回复 | 举报