选择通过NFS共享方式完成软件分发本地源配置,pxe网络安装linuxmint16
1、安装nfs-kernel-server,tftpd-hpa,dhcp3-server
apt-get install dhcp3-server nfs-kernel-server tftpd-hpa
2、新建文件夹/home/testom/linuxmint32
mkdir -p /home/testom/linuxmint32
3、挂载iso文件到/mnt目录下
mount -t iso9660 -o loop /wq_tmp/linux_mint_t.iso /mnt
4、拷贝镜像文件到/home/testom/linuxmint32目录下
cp -R /mnt/* /home/testom/linuxmint32
cp -R /mnt/.disk /home/testom/linuxmint32
5、新建目录/var/lib/tftpboot/linuxmint32
mkdir -p /var/lib/tftpboot/linuxmint32
拷贝光盘casper目录/var/lib/tftpboot/linuxmint32
cp -R /home/testom/linuxmint32/casper /var/lib/tftpboot/linuxmint32/.
6、拷贝解压netboot.tar.gz 文件到/var/lib/tftpboot/目录下
tar -xzvf /wq_tmp/netboot.tar.gz -C /var/lib/tftpboot/
---文件已经拷贝完成下面是配置文件
1、配置nfs文件信息如下
/etc/exports
/var/cache/apt/archives *(r0,sync,no_subtree_check)
/home/testom/linuxmint32 *(insecure,ro,async,no_root_squash)
2、配置dhcp服务器(可以用地址池也可以绑定mac指定hostname和ip)
/etc/dhcp3/dhcp.conf
allow booting;
allow bootp;
ddns-update-style none;
log-facility local7;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.137 192.168.1.147;#地址池
option routers 192.168.1.254;#网关
option broadcast-address 192.168.1.255;#广播地址
default-lease-time 600;
max-lease-time 7200;
next-server 192.168.1.242;#dhcp服务器地址
filename "pxelinux.0";
}
3、配置/var/lib/tftpboot/ubuntu-installer/i386/boot-screens/text.cfg文件
--指定启动选择界面选项背景图片之类的位置
default install
label install
menu label ^Install
menu default
kernel linuxmint32/casper/vmlinuz
append boot=casper only-ubiquity initrd=linuxmint32/casper/initrd.gz netboot=nfs nfsroot=192.168.1.242:/home/testom/linuxmint32 quiet splash—
label cli
menu label ^Command-line install
kernel ubuntu-installer/i386/linux
append tasks=standard pkgsel/language-pack-patterns= pkgsel/install-language-support=false vga=normal initrd=ubuntu-installer/i386/initrd.gz -- quiet
--两个linuxmint32文件夹不能合并,通过nfs挂载之后文件夹格式变化导致无法挂载第二次无法引导安装源报错
mount call failed-server replied:permission denied
4、启动服务
service nfs-kernel-server restart
service dhcp3-server restart
service tftpd-hpa restart
-----服务端搭建完成
客户端需要启动是选择网络启动即可自动获取安装源通过服务器安装源安装操作系统
-本地源环境搭建server:
/etc/exports
/var/cache/apt/archives *(insecure,ro,async,no_root_squash)
server:
mount -t nfs 192.168.1.242:/var/cache/apt/archives /mnt
server:
crontab -e
* 1 1 * * apt-get upgrade
* 4 1 * * dpkg-scanpackages /mnt | gzip>/mnt/Packages.gz
server,client:
/etc/fstab添加
192.168.1.242:/var/cache/apt/archives /mnt nfs defaults 0 0
---netboot.tar.gz 下载地址