Archive:网络安装源

跳转至: 导航, 搜索

怎样从 ISO 创建网络安装源

此例中,假设你将 SUSE 10.0 Beta 1 ISO 下载到了 /srv/ftp/isos/suse10.0,而且你希望安装源地址也在 /srv/ftp/suse10.0。如果用的非 SUSE 发行版,按需调整你的地址。

用 YaST 快速创建本地 ftp 安装源服务器

你可以用 http,ftp 或 nfs 的安装源,这里以 FTP 为例。

这个方法将把ISO中文件解压到你硬盘上,这将会再使用相当于ISO大小的磁盘空间。如果你之后删除 ISO 也可以,但是如果你想留着它们,这份教程中的方法再适合不过。

  • 必须运行 FTP 服务器服务,比如 vsftp。这可以通过 Yast 的 "xinetd" 项配置。
  • 安装 yast2-instserver 软件包;
  • YaST --> Miscellaneous --> Installation Server。如果你什么(比如 vsftp)都装了,就要关闭 YaST 控制中心然后重新打开它;
  • 选择网络安装类型 (HTTP,FTP 或 NFS),用 FTP 作例子;
  • 选择你安装源的基目录,这里用 inst-source 做例子;
  • Choose to install using the ISOs and give a name specific to them. a new directory will be created under the preceding one;
  • You will now be prompted for the various ISOs until the server is done (Yast copies the cd content to the given directory)

This has been tested with SUSE Linux 10.0 stable as a client and 10.1 RC1 as version to install.

Manual Installation

Place the files with makeSUSEdvd

You can place the files from the ISOs with makeSUSEdvd. Just run the following:

# makeSUSEdvd -i -s /srv/ftp/suse10.0

This will put all the files in /srv/ftp/suse10.0. You then do not need to do the next two steps. If you can not run makeSUSEdvd for one reason or another,use the next two steps.

Mount the ISOs

The first thing you need to do is mount the ISOs themselves. Edit /etc/fstab and add these lines:

/srv/ftp/isos/suse10.0/SUSE-10.0-CD-i386-Beta1-CD1.iso /srv/ftp/suse10.0/cd1 auto loop,ro 0 0
/srv/ftp/isos/suse10.0/SUSE-10.0-CD-i386-Beta1-CD2.iso /srv/ftp/suse10.0/cd2 auto loop,ro 0 0
/srv/ftp/isos/suse10.0/SUSE-10.0-CD-i386-Beta1-CD3.iso /srv/ftp/suse10.0/cd3 auto loop,ro 0 0
/srv/ftp/isos/suse10.0/SUSE-10.0-CD-i386-Beta1-CD4.iso /srv/ftp/suse10.0/cd4 auto loop,ro 0 0
/srv/ftp/isos/suse10.0/SUSE-10.0-CD-i386-Beta1-CD5.iso /srv/ftp/suse10.0/cd5 auto loop,ro 0 0

Create the directories to mount them on and mount them:

cd /srv/ftp/suse10.0
mkdir cd{1,2,3,4,5}
mount -a

Set Up the Files YaST Needs

YaST needs some special files in the root of the network install point. Most of these are symlinked in from CD 1.

cd /srv/ftp/suse10.0
ln -s cd1/boot boot
ln -s cd1/content content
ln -s cd1/control.xml control.xml
ln -s cd1/media.1 media.1
ln -s cd1/suse suse
mkdir yast
echo cd1 cd1 > yast/instorder
echo cd1 cd1 > yast/order
ls > directory.yast

Announcing the Installation Source via SLP

This assumes that you have the openslp-server package installed on a host in your network and the server is running.

Create a file like /etc/slp.reg.d/suse100.reg (it has to end in .reg) on the openslp server with the following contents:

service:install.suse:ftp://your_ftp_server/your_directory
description=My Distribution

Then make openslp reload the configuration with rcslpd reload. "My Distribution" will appear in linuxrc (booting from CD/DVD or floppy) when you select SLP installation in the initial boot screen.

使用 NFS

You also can use NFS for network installation. After you set up the NFS server and enable it in firewall,you can start installing SUSE using NFS. First,set up the NFS server. Use yast nfs-server to enable nfs and open the port in firewall. Here's what you should add in /etc/exports,assuming you mount all suse10.0.iso in /srv/ftp/suse10.0/.

/srv/ftp/suse10.0/cd1   *(ro,root_squash,sync)
/srv/ftp/suse10.0/cd2   *(ro,root_squash,sync)
/srv/ftp/suse10.0/cd3   *(ro,root_squash,sync)
/srv/ftp/suse10.0/cd4   *(ro,root_squash,sync)
/srv/ftp/suse10.0/cd5   *(ro,root_squash,sync)

Make a Network Boot CD

Next you will need a network boot CD. The FTP install CD for SuSE Linux 9.3 is about 50 MB in size and has lots of weird and wonderful modules on it. But,for most modern hardware,you don't need all that. And to be honest,I'm not sure where you would get all that from these CDs either. But it's dead easy to make a boot CD from the boot area of CD 1.

mkdir /tmp/bootcd
cd /tmp/bootcd
cp -a /srv/ftp/suse10.0/cd1/boot/loader/* .
mkisofs -o ../netinst.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .

Then use your favorite CD recording program to burn the resulting /tmp/netinst.iso.

启动机器

It should be plain sailing from here on in. Boot from the CD. Once you have the install menu,you should be able to press F6 and select "ftp" as the installation source. Enter the name or IP address of your server and enter "suse10.0" as the installation directory. Of course,this assumes your FTP server is running,and its home is set to /srv/ftp.

If you use NFS,choose NFS,and add IP server and directory of cd1 in NFS server (shoud be /srv/ftp/suse10.0/cd1).

And you should be on the way.

以 Windows 作为服务器

  • 下载安装 Daemon Tools。这个程序允许你在 Windows 上的虚拟光驱挂载 ISO 到某盘符。
  • 挂载第一个 CD,把文件全部复制到一个目录,比如 d:\install\suse10.0
  • 对其它进行同样的操作,出现文件覆盖提示点“全部”
  • d:\install 目录共享,假设共享名叫 INSTALL
  • 如果你不能访问 Windows 共享,安装一个 FTP 服务器程序提供FTP共享服务。
  • 从网络安装启动镜像(boot.iso)做一个启动盘,开始安装。

祝你好运。