关键字:通过网络安装Linux CentOS 系统的方法 Linux和Windows系统线程间的区别 Linux操作系统下修改IP、DNS等网络配置 Linux操作系统出现严重故障后的救援模式 Linux操作系统中的FTP客户端 解决Linux和Windows双系统引导问题 希望Windows 7系统出现的七个变化 windows2000不能安装office的解决一例
一、原理
无光驱、软驱
一台服务器
想要安装Linux系统
我们需要通过网卡
PXE协议
引导之后安装Linux
流程:机器启动-网卡引导-通过DHCP获得IP地址-通过tftp获得最基础
内核文件
使用该内核文件启动机器-启动之后可以对安装程序配置
选择使用http、ftp、nfs方式远程获得安装所需要
软件包
显然
网络安装
必须配置服务器端
我们
服务端需要提供以下服务: 大学城uniuc.com
DHCP
TFTP 无忧词典51dic.com
HTTP(FTP,NFS)
二、服务配置
无忧词典51dic.com
1、DHCP
配置文件: 大学城uniuc.com
option domain-name "mydomain";
大学城uniuc.com
ddns-update-style none; 行业搜hysoo.com
default-lease-time 600; 大学城uniuc.com
max-lease-time 7200;
server-name "bootserver"; 无忧词典51dic.com
subnet 192.168.123.0 netmask 255.255.255.0 {
range 192.168.123.200 192.168.123.201;
天地广owide.com
deny unknown-clients; 一流导航网16dh.com
}
host MyP5 { 无忧词典51dic.com
filename "pxelinux.0";
一流导航网16dh.com
server-name "bootserver";
hardware ethernet ae:32:20:00:b0:02;
fixed-address 192.168.123.90;
}
一流导航网16dh.com
这
复制来
配置文件
稍微解释一下:
一流导航网16dh.com
filename 后面
tftp目录下
文件
pxelinux.0 则
syslinux 包内
文件
默认 pxelinux.0 可能在 /usr/lib/syslinux 目录下
必须将其复制到 tftp 目录下
行业搜hysoo.com
host MyP5 下出现
: 行业搜hysoo.com
hardware ethernet ae:32:20:00:b0:02; 行业搜hysoo.com
fixed-address 192.168.123.90;
天地广owide.com
为客户机(需要安装系统
机器)
MAC 地址和所分配
IP地址
2、TFTP
由于必须支持TSIZE协议
所以不能安装最原始
TFTP包
我选择使用 tftp-hpa
一流导航网16dh.com
编辑文件 /etc/xinetd.d/tftp (若没有
则添加tftp文件)(若不存在xinetd.d
请安装 xinetd 包)
# default: off
天地广owide.com
# description: The tftp server serves files using the trivial file transfer \ 无忧词典51dic.com
# protocol. The tftp protocol is often used to boot diskless \ 大学城uniuc.com
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems. 天地广owide.com
service tftp
天地广owide.com
{ 天地广owide.com
disable = no
一流导航网16dh.com
socket_type = dgram
行业搜hysoo.com
protocol = udp
一流导航网16dh.com
wait = yes 一流导航网16dh.com
user = root
行业搜hysoo.com
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot 一流导航网16dh.com
per_source = 11
一流导航网16dh.com
cps = 100 2 行业搜hysoo.com
flags = IPv4 天地广owide.com
} 天地广owide.com
这里将 /tftpboot 定义为 tftp 服务
默认目录
您可以自行修改
大学城uniuc.com
保存之后重启 /etc/init.d/xinetd 服务
即可开启 tftp 服务
行业搜hysoo.com
如何测试 tftp
否成功开启? 大学城uniuc.com
在 tftp 目录下创建一个文件
比如 1.txt
大学城uniuc.com
在 Shell 中连接 tftp 服务: 行业搜hysoo.com
tftp 127.0.0.1
天地广owide.com
tftp>get 1.txt 大学城uniuc.com
若服务成功开启
则能看到成功下载文件
提示
并在当前目录下找到1.txt文件
无忧词典51dic.com
接着复制光盘中 isolinux 目录下
vmlinuz、initrd.img 文件到 /tftpboot 目录下
无忧词典51dic.com
在 /tftpboot 中创建文件夹 syslinux.cfg
syslinux.cfg 中保存
pxelinux
两个配置文件:default、list
天地广owide.com
default:
大学城uniuc.com
default linux
label linux
kernel vmlinuz
天地广owide.com
append initrd=initrd.img devfs=nomount nofb ramdisk_size=9216
你可以写很多个label
这取决于你同时想在这台服务器上提供多少种版本
Linux 给客户机安装
一个版本一个label
当然kernel、与initrd文件名不可以重复
天地广owide.com
list:
Choose one of the following Linux distributions for your installation: 行业搜hysoo.com
Name Distribution Arch. Installation media
天地广owide.com
----------------------- 一流导航网16dh.com
CentOS CentOS 4.4 i386 192.168.99.90:/ 无忧词典51dic.com
你也可以添加多行
用来选择不同
发行版本
在选择
时候填写Name下
内容即可
大学城uniuc.com
三、复制光盘文件 一流导航网16dh.com
将光盘文件复制到对应目录(ftp、http、nfs)
如果
使用 http 使用以下命令将多张光盘复制到一个目录里面: 一流导航网16dh.com
[root@bootserver] # cp -arv /media/cdrom/* /install
如果使用 ftp
请确保可以访问(可以有用户名、密码)
无忧词典51dic.com

