免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4896 | 回复: 0

独辟蹊径系列本地网络PXE安装Ubuntu [第十五期] [复制链接]

论坛徽章:
0
发表于 2009-12-07 22:54 |显示全部楼层
独辟蹊径系列本地网络PXE安装Ubuntu
ChinaUnix网友:kns1024wh
  本期独辟蹊径系列讲解的本地网络安装Ubuntu9.049.10,在091月刊《独辟蹊径网络安装系列之Debian/Ubuntu》中提及了网络安装Ubuntu的方法,本期将讲解在UbuntuDVD介质支持上的变动,以及如何使用DVD介质快速的构建一个本地的网络安装环境,做到从网络安装和部署ubuntu的目的。
本期将从如何下载到UbuntuDVD镜像、如何将UbuntuDVD镜像设置为本地的安装源、以及网络安装的演示过程进行讲解。
如何下载到UbuntuDVD镜像?
  UbuntuDVD介质安装介质大概是从ubuntu 6.06.1版本开始提供下载,在ubnutu网站上选择http://www.ubuntu.com/getubuntu/download/下载页面中选择
Alternative download options, including Ubuntu installer for Windows  这个超级链接看到如下内容:


选择其中的DVD images containing additional language packs » 超级链接进入到DVD镜像的下载页面http://www.ubuntu.com/getubuntu/downloadmirrors#dvd

从上面选择自己认为速度最快的站点进入

选择9.10/

  在这个页面选择合适的X86或者是X86-64位的版本下载,这样就可以现在DVD格式的Ubuntu发行版本的镜像。这样解除了很多的网友对Ubuntu的DVD镜像的疑惑。
下面就具体讲解一下如何利用这个UbuntuDVD镜像实现本地网络化安装Ubuntu版本的方式。
在独辟蹊径的系列文章中多次讲解道网络安装Linux发行版本的步骤,需要一个DHCP+TFTPD+DNS网络服务,并提供有NFSHTTPFTP、和Samba等安装源目录的访问方式。具体的如何配置一个DHCP+TFTPD+DNS大家可以参考上一期的文章中简洁方式,以下的过程默认已经应用了一个DHCP+TFTPD+DNS的网络环境,并在安装的服务器上配置有一个默认的apache服务。
ubuntu-9.10-dvd-i386.iso镜像文件挂载并将挂载点的文件复制到一个通过Apache发布的安装目录树文件夹中。

DVD镜像的文件复制到/ub的一个安装目录树中。
查看/ub安装目录树的内容如下

install文件夹下的内容就是DVD镜像介质实现本地安装的PXE网络引导文件和配置信息。

接下来需要操作的事情就是将netboot文件夹中的内容全部复制到TFTPD的服务根文件夹/tftpboot中。
[root@bdr netboot]# cp -arvp ./ /tftpboot
[root@bdr netboot]# cd /tftpboot
[root@bdr tftpboot]# ls -l
total 179136
-rw-r--r-- 1 root root 5665249 Jun 25 2008 32.initrd.img
-rw-r--r-- 1 root root 1806388 Jun 25 2008 32.vmlinuz
drwxr-xr-x 3 root root 4096 Dec 24 2008 bakdeb
-rw-r--r-- 1 root root 2048 Jun 25 2008 boot.cat
-rw-r--r-- 1 root root 526 Aug 27 2008 boot.msg
dr-xr-xr-x 2 root root 4096 Sep 4 2008 boot-screens
-rw-r--r-- 1 root root 2412688 Sep 12 2008 bzImage
-rw-r--r-- 1 root root 5669675 Feb 19 2009 centos52x32.initrd.img
-rw-r--r-- 1 root root 1806388 Apr 28 2009 centos52x32.vmlinuz
-rw-r--r-- 1 root root 5923367 Nov 3 2008 centos52x64.initrd.img
-rw-r--r-- 1 root root 1859484 Oct 31 2008 centos52x64.vmlinuz
-rw-r--r-- 1 root root 6302756 Jun 16 10:57 centos53.initrd.img
-rw-r--r-- 1 root root 1826484 Jun 16 10:57 centos53.vmlinuz
-rw-r--r-- 1 root root 5482335 Jun 25 2008 centos.initrd.img
-rw-r--r-- 1 root root 1844028 Jun 25 2008 centos.vmlinuz
drwxr-xr-x 2 root root 4096 Oct 17 16:09 clonezilla
-rw-r--r-- 1 root root 19036899 Jun 15 17:13 f11.initrd-pae.img
-rwxr-xr-x 1 root root 3089424 Jun 15 17:14 f11.vmlinuz-pae
-rw-r--r-- 1 root root 9592925 Jun 25 2008 fedora.initrd.img
-rwxr-xr-x 1 root root 2086048 Jun 25 2008 fedora.vmlinuz
-rw-r--r-- 1 root root 124422 Dec 20 2008 file1
-rw-r--r-- 1 root root 919 Jun 25 2008 general.msg
-rw-r--r-- 1 root root 1458 Sep 16 2008 GPG-KEY-DRBL
-r--r--r-- 1 root root 7565430 Nov 17 17:39 initrd.gz
-rw-r--r-- 1 root root 5665249 Oct 10 13:54 initrd.img
-r--r--r-- 1 root root 3501776 Nov 17 17:39 linux
drwxr-xr-x 6 root root 4096 Sep 12 2008 linux-install
-rw-r--r-- 1 root root 6857588 Sep 29 15:21 lrac.initrd.img
-rw-r--r-- 1 root root 1855924 Sep 29 15:21 lrac.vmlinuz
drwxr-xr-x 2 root root 4096 Jun 25 2008 msgs
-r--r--r-- 1 root root 128796 Oct 24 00:11 mt86plus
dr-xr-xr-x 3 root root 4096 Oct 17 17:00 netboot
-rw-r--r-- 1 root root 5547954 Dec 19 2008 netboot.tar.gz
-rw-r--r-- 1 root root 817 Jun 25 2008 options.msg
-rw-r--r-- 1 root root 517 Jun 25 2008 param.msg
drwxr-xr-x 2 root root 4096 Sep 19 06:57 pmagic
-rw-r--r-- 1 root root 124422 Dec 20 2008 preseed.cfg
-r--r--r-- 1 root root 264192 Oct 24 13:11 pxeboot
lrwxrwxrwx 1 root root 32 Nov 17 17:34 pxelinux.0 -> ubuntu-installer/i386/pxelinux.0
drwxr-xr-x 2 root root 4096 Nov 18 15:31 pxelinux.cfg
dr-xr-xr-x 2 root root 4096 Sep 4 2008 pxelinux.cfg.serial-9600
-r--r--r-- 1 root root 1865 Apr 24 2009 README.sbm
-rw-r--r-- 1 root root 490 Jun 25 2008 rescue.msg
-rw-r--r-- 1 root root 5665249 Jun 25 2008 rh52x32.initrd.img
-rw-r--r-- 1 root root 1806388 Jun 25 2008 rh52x32.vmlinuz
-rw-r--r-- 1 root root 5923899 Jun 25 2008 rh52x64.initrd.img
-rw-r--r-- 1 root root 1859484 Jun 25 2008 rh52x64.vmlinuz
-r--r--r-- 1 root root 6482195 Nov 1 2008 rh53betax64.initrd.img
-r--r--r-- 1 root root 1903324 Nov 1 2008 rh53betax64.initrd.vmlinuz
-rw-r--r-- 1 root root 6641597 Jan 23 2009 rh53x64.initrd.img
-rw-r--r-- 1 root root 1889308 Jan 23 2009 rh53x64.vmlinuz
-r--r--r-- 1 root root 7040188 Jul 9 17:02 rh54x64.initrd.img
-r--r--r-- 1 root root 1931900 Jul 9 17:02 rh54x64.vmlinuz
-r--r--r-- 1 root root 1474560 Apr 24 2009 sbm.bin
-rw-r--r-- 1 root root 23107 Jun 25 2008 splash.lss
-r--r--r-- 1 root root 18565547 Jun 25 2008 suse11.initrd
-r--r--r-- 1 root root 2125856 Jun 25 2008 suse11.linux
dr-xr-xr-x 3 root root 4096 Apr 18 2009 ubuntu-installer
-r--r--r-- 1 root root 7707518 Sep 4 2008 u.initrd.gz
-r--r--r-- 1 root root 1920472 Sep 4 2008 u.linux
-r--r--r-- 1 root root 14146 Sep 4 2008 u.pxelinux.0
dr-xr-xr-x 2 root root 4096 Sep 4 2008 u.pxelinux.cfg
-r--r--r-- 1 root root 56 Apr 18 2009 version.info
-r--r--r-- 1 root root 3890400 Oct 29 06:51 vmlinuz

  编辑vi pxelinux.cfg/default文件设置其中的PXE引导启动菜单加载信息包含如下内容
default linux
prompt 1
timeout 60
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label ub
kernel linux
append initrd=initrd.gz
include ../ubuntu-installer/i386/boot-screens/menu.cfg
default ../ubuntu-installer/i386/boot-screens/vesamenu.c32

  这样ubuntu网络安装的PXE引导部分就准备完成。
  接下来需要准备一下通过APACHE提供的ubuntu的网络安装树信息,操作很简单需要建立一个到软连接
ln -s /ub /var/www/html/ubuntu

  这访问http://pxe server ip/ubuntu就可以看到/ub目录下的内容了。
  到此通过本地PXE网络安装Ubuntu的准备工作就已经完成了。下面就是启动要安装系统的客户端,并选择从网络引导就可以进行网络安装操作。

以下是通过的截图:
虚拟机设置信息,仅有硬盘和网卡,这个也是使用网络安装的主机的一般的状态。

PXE安装引导菜单界面

下载PXE安装的引导启动信息

语言选择界面,看到这个界面大家应该熟悉之后的操作了,是不是很亲切呀

选择语言

开始加载网络配置,设置启用DHCP

主机名设置,默认是ubuntu,保持默认

选择安装用的Ubuntu archive位置,在这里将光标上移

移动到enter information manually手动指定一个安装所用的源

填写PXE安装服务器的IP地址

填写PXE网络安装的源的访问URL信息,默认是ubuntu

设置时区

选择一个时区

扫描磁盘信息进入磁盘分区操作

选择合适的磁盘分区类型和方式,格式化磁盘分区

安装基本的系统

设置用户和密码

设置密码信息

扫描本地安装的apt

配置安装包信息

在这里选择ubuntu desktop 否则安装的将是命令行环境

开始ubuntu desktop 的安装

安装结束了
ubuntu启动界面

ubuntu登录界面

Ubuntu 9.10的桌面
  通过PXE方式安装方式并结合上安装应答文件可以很大程度的节省安装耗费的时间,将更多的Linux系统的操作放在应用上面。欢迎开源爱好者共同来探讨网络安装Linux发行版本的方式和技巧。
作者简介:CU网友kns1024wh(百湖),目前从事Linux群集方面的具体工作,之前做过多年的IT技术支持、MCT讲师、及REDFLAG的技术合作,技术专长群集、unix主机、AD部署等,您可以通过电子邮件lvsheat@qq.com或者Chinaunix社区与他取得联系。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP