b) 为Solaris CD们准备一个映象目录,需要的空间大概2G吧。本例中为/export/home/sol9_rinst:
# cd /export/home
# mkdir sol9_rinst
c) 先将Solaris 9 Software 1 CD 装入SVR光驱中:
# cd /cdrom/cdrom0/s0/Solaris_9/Tools
# ./setup_install_server /export/home/sol9_rinst ;此目录为前面准备的映象目录
Verifying target directory...
Calculating the required disk space for the Solaris_9 product
Calculating space required for the installation boot image
Copying the CD image to disk...
Copying Install Boot Image hierarchy...
\
Install Server setup complete
# cd /
# eject
d) 更换为 Software 2 of 2 CD:
# cd /cdrom/cdrom0/Solaris_9/Tools
# ./add_to_install_server /export/home/sol9_rinst
The following Products will be copied to /export/home/sol9_inst/Solaris_9/Product:
Solaris_2_of_2
If only a subset of products is needed enter Control-C
and invoke ./add_to_install_server with the -s option.
说明:这里提示可以用add_to_install_server -s选项,仅将盘中需要的部分产品加入到安装映象中。事实上,Software 2 CD上的产品没有可展开的子项,因此这里用不用-s选项都一样
Checking required disk space...
Copying the Early Access products...
Copying Top Level installer...
Copying Tools Directory...
Processing completed successfully.
#
# cd
# eject
e) 更换为 LANG CD
# cd /cdrom/cdrom/Tools ;注意:这3张盘Tools目录位置都不一样
# ./add_to_install_server -s /export/home/sol9_inst ;由于语言包肯定是多个的,因此这里使用了-s选项。否则全装……就联合国大会了哦……
Enter the number of the product(s) you want to add
to /export/home/sol9_inst/Solaris_9/Product or 'all' for all products.
The following are valid products:
1 Simplified_Chinese
2 French
3 German
4 Italian
5 Japanese
6 Korean
7 Spanish
8 Swedish
9 Traditional_Chinese
10 shared
1,9,10<回车>
Checking required disk space...
Copying SimplifiedChinese packages...
Copying TraditionalChinese packages...
Copying shared packages...
Skipping SUNWabcp it has already been copied. ;似乎10已经包含在上面两个中间了
Skipping SUNWudct it has already been copied.
Processing completed successfully.
# cd
# eject
f) 更换为 install CD。这步主要将图形界面加入到启动模块miniboot的映象中去。
安装过Solaris 9(Sol 8也是)的朋友都知道,不管是字符界面还是图形界面,安装过程中都是先将一个miniboot(可理解为一个小型的OS)复制到被安装机器的swap中,然后从它引导被安装机器,执行安装过程。我们的miniboot是使用Software 1盘的setup_inistall_server建立安装服务器时生成的,位于<安装映象目录>/Solaris_9/Tools/Boot目录中。但Software 1盘上的miniboot是字符界面的,webstart图形界面在install盘上。(回忆:使用Software 1盘来boot cdrom和用install盘的boot cdrom有何不同)
因此,如果被安装机器带有显示器键盘鼠标,可以通过图形界面更方便地安装,这就需要使用install盘上s0下的modify_install_server工具来修改miniboot。webstart内容在盘的s1目录中(s0目录下有一个链接将Boot指向../s1,但……似乎不好用——不但没有modify成功,原来的miniboot也丢了……为避免这类意外,可以使用modify_install_server的-p选项——把miniboot即Boot目录更个名先。本例中没用-p,可以看到,它上来就removing miniboot!)
# cd /cdrom/cdrom0/s0
# ./modify_install_server /export/home/sol9_inst /cdrom/cdrom0/s1
Setting up installer net image
removing existing miniroot
Setup complete
# cd
# eject
a) 为CLN准备一个临时IP地址和主机名。临时IP地址应与SVR上提供安装服务的网口IP地址在同一网段上。这是因为在远程安装开始时,将需要通过rarp来把临时IP赋给CLN,而arp/rarp只能工作在单一网段上(SUN认证考试中可是有此概念的题目哦)。CLN的临时主机名仅在SVR上起对应临时IP的作用,与安装中CLN的正式主机名无关(对/etc/hosts理解透彻的朋友在后面的操作中当然可以直接使用临时IP而无须临时主机名);
b) 修改SVR上/etc/hosts文件,暂时加入CLN的临时主机名和临时IP。本例中为192.168.1.9和CLN9(SVR连网网口为192.168.1.10):
# vi /etc/hosts
......
192.168.1.9 CLN9
~
:wq!
"hosts" N行,M个字符
c) 记录下CLN上与SVR相连网口的mac地址。这可以对CLN加电,在ok下得到,或者CLN原有系统,启动后用ifconfig -a得到;
说明:从这里我们可以稍微理解为什么SUN机器上OBP参数中local_mac_address?要设置成false的好处了吧?倘若那值是true,机器上又无预装系统,那么要获得这个mac地址就够麻烦的了。
d) 为安装服务器增加一台客户机
# cd /export/home/sol9_rinst
# cd Solaris_9/Tools
# ./add_install_client -e <CLN mac地址> CLN9 sun4u
说明:sun4u是CLN的结构平台,即通常用uname -m显示出来的名称。目前SUN的机器基本都是sun4u。
Adding Ethernet number for CLN9 to /etc/ethers
saving original /etc/dfs/dfstab in /etc/dfs/dfstab.orig
Adding "share -F nfs -o ro,anon=0 /export/home/sol9_rinst" to /etc/dfs/dfstab
making /tftpboot
enabling tftp in /etc/inetd.conf
Converting /etc/inetd.conf
enabling network/tftp/udp6 service
enabling network/rarp service
enabling network/rpc/bootparams service
updating /etc/bootparams
copying inetboot to /tftpboot
#
上面一堆的屏幕输出,安装服务器都做了些什么配置工作?我们一一看来:
i) Adding Ethernet number for CLN9 to /etc/ethers
这一步将增加的客户机CLN的mac地址写进了/etc/ethers文件。这个文件是rarp(reverse address resolution protocol)用的。一旦rarp发现网上有这个mac地址的RARP请求,它将进行回答。将对应的IP地址告诉对方。对方有了mac地址和IP地址,就可以在网上进行TCP/UDP的一些工作了。这真有点象一曲IT版的《赶牲灵》:
“……你若是我的服务器哟,给我的那个IP。
哎呀你不是我的服务器哟,忙你的那个去。……”
/etc/ethers文件缺省是没有的。我们可以检查一下,如果上面的操作后没有生成该文件或者没有将CLN的mac地址写入,可以手工建立或者加入。文件格式为<客户机mac地址> <临时客户机名或IP>:
# cat /etc/ethers
8:0:20:ab:cd:ef CLN9
ii) saving original /etc/dfs/dfstab in /etc/dfs/dfstab.orig
Adding "share -F nfs -o ro,anon=0 /export/home/sol9_rinst" to /etc/dfs/dfstab
这一步将安装服务器的Solaris映象目录通过NFS方式共享出来。Solaris 8以后要求在/etc/dfs/dfstab中至少有一条记录,才能启动NFS server服务器进程。在系统启动时,如该文件中有记录,则NFS server自动启动,将其中的目录共享出来。检查一下,如没有则手工加入:
# cd /etc/dfs
# cat dfstab
……
share -F nfs -o ro,anon=0 /export/home/sol9_rinst
iii) making /tftpboot
enabling tftp in /etc/inetd.conf
Converting /etc/inetd.conf
enabling network/tftp/udp6 service
enabling network/rarp service
enabling network/rpc/bootparams service
updating /etc/bootparams
copying inetboot to /tftpboot
这里打开安装服务器上系统的rarp和tftp(trivial file transfer protocol)服务的启动设置和参数设置。前面说过,rarp负责响应客户机的IP请求,建立TCP/IP连接后,tftp负责将启动映象传送到客户机。在客户机无文件系统的情况下,无法使用ftp来送文件,因此要用到tftp。in.rarpd和in.tftpd的启动都要求存在/tftpboot目录(系统缺省无此目录),而且/etc/inetd.conf中tftp那行行首的“#”要去掉。我们也可以手工检查一下:
3、开始远程安装
下面的过程就简单了:
a) SVR与CLN间网线连好。直联用交叉线,通过hub或switch用直通线(写这帖子才弄清楚,两种网线头子的线序标准叫ANSI EIA/TIA 568A 和 568B);
b) CLN上电,到ok下:
ok boot net
Resetting ...
Sun Fire Vxx0, Keyboard present
Copyright 2005 Sun Microsystems, Inc. All rights reserved.
OpenBoot 4.1x.xx, 4096 MB memory installed, Serial #85583740.
Ethernet address 8:0:20:ab:cd:ef, Host ID: 80abcdef.
Rebooting with command: boot net
Boot device: /pci@1f,700000/network@1,1 File and args:
2aa00
Use is subject to license terms.
whoami: no domain name
Configuring /dev and /devices
Using RPC Bootparams for network configuration information.
Configured interface ce0
Searching for configuration file(s)...
Search complete.
Select a Language
0. English
……
c) 看到这个Select a Language,说明安装过程已经开始。注意上面的“2aa00”,在实际操作中时是一个不断闪动变化的数字,这说明安装服务器的配置正确,服务器和客户机已经谈妥,正在转送文件。如果这时在SVR上使用snoop,可以看到双方的问答,相当有趣:
……
33 14.44174 OLD-BROADCAST -> (broadcast) RARP C Who is 8:0:20:ab:cd:ef ?
34 0.00523 SVR -> CLN9 RARP R 8:0:20:ab:cd:ef is 192.168.1.9, CLN9
35 0.00219 CLN9 -> SVR TFTP Read "C0A80109" (octet)
36 0.05943 SVR -> CLN9 TFTP Data block 1 (512 bytes)
37 0.00702 CLN9 -> SVR TFTP Ack block 1
38 0.00013 SVR -> CLN9 TFTP Data block 2 (512 bytes)
39 0.00964 CLN9 -> SVR TFTP Ack block 2
40 0.00010 SVR -> CLN9 TFTP Data block 3 (512 bytes)
41 0.00968 CLN9 -> SVR TFTP Ack block 3
……
650 0.00010 SVR -> CLN9 TFTP Data block 308 (512 bytes)
651 0.01073 CLN9 -> SVR TFTP Ack block 308
652 0.00010 SVR -> CLN9 TFTP Data block 309 (512 bytes)
653 0.01072 CLN9 -> SVR TFTP Ack block 309
654 0.00010 SVR -> CLN9 TFTP Data block 310 (0 bytes) (last block)
655 0.00516 CLN9 -> SVR TFTP Ack block 310
656 2.19446 OLD-BROADCAST -> (broadcast) RARP C Who is 8:0:20:ab:cd:ef ?
657 0.00151 SVR -> CLN9 RARP R 8:0:20:ab:cd:ef is 192.168.1.9, CLN9
……
662 0.01348 CLN9 -> SVR PORTMAP C GETPORT prog=100005 (MOUNT)
vers=1 proto=UDP
663 0.00070 SVR -> CLN9 PORTMAP R GETPORT port=32781
664 0.01350 CLN9 -> SVR SYSLOG R port=32781
665 0.01423 SVR -> CLN9 SYSLOG C port=32781 BAD.FMT:
666 0.01106 CLN9 -> SVR NFS C LOOKUP2 FH=0BD5 platform
667 0.00056 SVR -> CLN9 NFS R LOOKUP2 OK FH=C94C
……
d) 到此为止,远程启动过程非常顺利。此后的安装步骤与本机安装基本相同,就不重复了。只是有一点稍有不同:
……
Please specify the media from which you will install the Solaris Operating
Environment.
Please specify the path to the network file system from which you will install
the Solaris Operating Environment.
Example: server:/path_to_Solaris_image
Example: server:/path_to_flash_archive_directory
Example: server:/path_to_flash_archive_file enter B to go Back.
[192.168.1.10:/export/home/sol9_rinst]<回车>
The system is being initialized, please wait... -
……
本机上用CD安装的时候,上面的Media菜单缺省选择是“1”,这里自动变成了“2”,直接回车就好。接下来的network file system path选择是CD安装时不出现的,也已经自动配置成了SVR的IP和路径,还是直接回车。至于后面的是否要eject CD等选择,无论y或n都没关系了。||