无网络安装linux,无人值守网络安装linux系统(centos5.4)

无人值守网络安装linux系统(centos5.4)

1、安装介绍

1.1、安装中用到的技术

1)启动服务器的配置dhcp和tftp

2)安装服务器的配置nfs或ftp或http

3)待安装pc网卡带有pxe支持

1.2、安装原理

下图是网络安装环境的一个原理示意图。整个安装环境由一个局域网,和连接到该局域网的三台机器组成:启动服务器(Boot Server),安装服务器(Installation Server),和待安装机器(Client)。其中启动服务器和安装服务器可以部署在同一台物理机上。表1列出了对这些机器的软硬件要求,和其上负载的服务与数据。

1.3、安装步骤

1)配置启动服务器

2)配置安装服务器

3)从网络启动并安装系统

2、配置启动和安装服务器

本实例中启动和安装服务器为同一台服务器,操作系统为centos5.4 x86_32,

ip:192.168.5.200注①

2.1启动服务器的配置

2.1.1 dhcp服务器的安装与配置

a)安装dhcp服务器

从光盘或网络下载dhcp server安装包dhcp-3.0.5-18.el5.i386.rpm

rpm – ivh dhcp-3.0.5-18.el5.i386.rpm#安装dhcp server

b)配置dhcp服务器

dhcp server配置文件默认为/etc/dhcpd.conf编辑内容如下:

option domain-name "aklus";

ddns-update-style none;

default-lease-time 600;

max-lease-time 7200;

server-name "bootserver";

subnet 192.168.5.0 netmask 255.255.255.0 {

range192.168.5.2 192.168.5.100;

allow unknown-clients;

allow booting;

allow bootp;

option routers 192.168.5.1;

option subnet-mask 255.255.255.0;

option domain-name-servers 8.8.8.8;

filename "pxelinux.0";注②

next-server 192.168.5.200;注③

}

上述配置文件中定义了子网为192.168.5.0/24 ip分配范围: 192.168.5.2-100,

pxelinux.0(在tftp根目录/tftpboot/下)将作为启动映像被网卡ROM里的PXE客户端载入内存并运行。Next-server 192.168.5.200指定了tftp server的地址。

c)启动dhcp服务器

[root@localhost ~]# service dhcpd restart

2.1.2 tftp服务器的安装与配置

a)安装tftp服务器

从光盘或网络下载tftp server安装包tftp-server-0.42-3.1.el5.centos.i386.rpm

rpm – ivh dhcp-3.0.5-18.el5.i386.rpm#安装tftp server

安装后,tftp默认根目录为/tftpboot

b)配置tftp server

编辑/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= -u nobody -s /tftpboot

disable= no#红色字体为修改部分

per_source= 11

cps= 100 2

flags= IPv4

}

c)启动tftp server

[root@localhost ~]# service xinetd restart

2.1.3制作启动文件

a)从安装光盘中复制linux的内核/根文件系统文件

[root@localhost ~]#cp /mnt/isolinux/initrd.img/tftpboot/

[root@localhost ~]#cp /mnt/isolinux/vmlinuz/tftpboot/

[root@localhost ~]#cp /mnt/isolinux/boot.msg /tftpboot/

b)安装syslinux后(centos5.4默认已安装),复制pxelinux.0到/tftpboot/

[root@localhost ~]# cp /usr/lib/syslinux/pxelinux.0 /tftpboot

c)编辑pxelinux.0的配置文件,用来pxelinux可以正确载入Red Hat Linux安装程序。

[root@localhost ~]#mkdir /tftpboot/pxelinux.cfg

[root@localhost~]#cp/mnt/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default

编辑default文件内容如下:

default linux

prompt 1

timeout 600

#display boot.msg

label linux

kernel vmlinuz

append ks=nfs:192.168.5.200:/linuxos/kickstart/ks.cfg initrd=initrd.img

label text

kernel vmlinuz

append initrd=initrd.img text

3、配置安装服务器

3.1.1准备系统安装文件

[root@localhost~]mkdir -p /linuxos/install

[root@localhost~]mount /dev/cdrom /linuxos/install #挂载linux安装介质

3.1.2制作kickstart文件

制作kickstart文件有两种方法,1、利用系统自带kickstart工具制作。2、编辑系统安装时自动生成的anaconda-ks.cfg文件,我们这里使用的是后者

[root@localhost~]mkdir /linuxos/kickstart

[root@localhost~]cp /root/anaconda-ks.cfg /linuxos/kickstart/ks.cfg

编辑ks.cfg文件内容如下

# Kickstart file automatically generated by anaconda.

install

nfs --server=192.168.5.200 --dir=/linuxos/install

#url --url=#http方式安装

#url --url=ftp://install:install@192.168.5.200/linuxos#ftp方式安装

lang en_US.UTF-8

keyboard us

xconfig --startxonboot

network --device eth0 --bootproto dhcp

rootpw --iscrypted $1$NpzzKWWp$DwUkDbNqWjyQhR/SHOc2w1

firewall --enabled --port=22:tcp

authconfig --enableshadow --enablemd5

selinux --enforcing

timezone --utc Asia/Shanghai

bootloader --location=mbr --driveorder=hda --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

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

part / --fstype ext3 --size=3000

part swap --size=1024

%packages

@office

@editors

@text-internet

@gnome-desktop

@dialup

@core

@base

@games

@base-x

@graphics

@printing

@sound-and-video

@graphical-internet

device-mapper-multipath

xorg-x11-server-Xnest

libsane-hpaio

3.1.3配置nfs服务器

a)编辑nfs配置文件/etc/exports内容如下:

/linuxos/install * (ro)

/linuxos/kickstart * (ro)

4、开始无人值守安装

4.1重启启动服务器和安装服务器的下列服务,确保配置生效

[root@localhost etc]#service nfs restart

[root@localhost etc]#service dhcpd restart

[root@localhost etc]#service xinetd restart

4.2设置待安装pc启动方式为网络启动

4.3重启待安装pc,开始无人值守安装,安装步骤如下图

1、设置从网络启动

2、自动获取ip

3、读取pxelinux.0配置信息,此处Enter键后自动选择默认安装详见default文件配置

5、已进入自动安装图形界面

注①启动服务器和安装服务器建议先关掉防火墙,以免后期安装时会获取不到ip和tftp中的数据

注②在安装RHAS4 for ppc时这里filename后的pxelinux.0改为netboot.img(netboot.img文件在安装介质images/pseries/netboot.img),RHAS5 for ppc时这里filename后的pxelinux.0改为ppc64.img (ppc64.img文件在安装介质images/netboot/ppc64.img)

注③next-server指定了tftp服务器的地址

参考资料:

1、

PXE Documentation Version 1.0

基于网络的Red Hat无人值守安装

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值