- 論壇徽章:
- 1
|
Solaris 9網(wǎng)絡(luò)安裝實(shí)例及說明[原創(chuàng)]
為慶祝即將到來的2007而發(fā)。歡迎引用,但請注明出處
應(yīng)用戶要求,在一臺機(jī)器上重裝Solaris 9。因該機(jī)器無光驅(qū),所以只能請用戶另找來一臺帶光驅(qū)的機(jī)器作為安裝服務(wù)器,進(jìn)行網(wǎng)絡(luò)安裝,F(xiàn)將安裝過程的記錄整理出來,加以適當(dāng)?shù)恼f明,以便于各位加深對于涉及的網(wǎng)絡(luò)協(xié)議及其在Solaris下表現(xiàn)的理解。相信對于需要做類似安裝或準(zhǔn)備SCNA考試的同仁都會有所裨益。
說明:安裝時(shí)參考了由 caiyue 發(fā)表于: 2005-9-3 16:43的《solaris9 網(wǎng)絡(luò)安裝記錄》
(http://72891.cn/viewthread.php?tid=605320),在此向作者表示感謝。
Solaris的遠(yuǎn)程安裝采用服務(wù)器/客戶端方式。必須先為被安裝的機(jī)器建立一臺安裝服務(wù)器,被安裝者作為它的客戶機(jī),通過rarp、tftp等協(xié)議與安裝服務(wù)器建立聯(lián)系,實(shí)現(xiàn)安裝。以下將安裝服務(wù)器簡稱為SVR,被安裝機(jī)器簡稱為CLN。SVR上運(yùn)行的是Solaris 10,CLN上準(zhǔn)備裝Solaris 9,使用Solaris 9 9/'05的install、software 1、software 2、language共4張CD盤
1、建立安裝服務(wù)器
Solaris系統(tǒng)盤上提供了一組關(guān)于系統(tǒng)遠(yuǎn)程啟動和安裝的工具(script),它們位于各張系統(tǒng)盤的Tools目錄中。主要有:
setup_install_server……建立啟動或安裝服務(wù)器
add_to_install_server……將CD映象加入到安裝服務(wù)器中
add_install_client……增加安裝服務(wù)器的客戶機(jī)
rm_install_client……刪除安裝服務(wù)器的客戶機(jī)
modify_install_server……修改安裝服務(wù)器上用于啟動的miniroot映象。僅install CD上用。
注意這些script與所在光盤的對應(yīng)性,換言之,必須使用本套CD中自帶的script來對本套盤進(jìn)行操作。本例中,SVR上是Solaris 10,CD是Solaris 9,不可因?yàn)镺S是S10而使用S10的工具來建立S9的安裝服務(wù)器。
a) 用root身份登錄SVR;
b) 為Solaris CD們準(zhǔn)備一個(gè)映象目錄,需要的空間大概2G吧。本例中為/export/home/sol9_rinst:
# cd /export/home
# mkdir sol9_rinst
c) 先將Solaris 9 Software 1 CD 裝入SVR光驅(qū)中:
# cd /cdrom/cdrom0/s0/Solaris_9/Tools
# ./setup_install_server /export/home/sol9_rinst ;此目錄為前面準(zhǔn)備的映象目錄
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選項(xiàng),僅將盤中需要的部分產(chǎn)品加入到安裝映象中。事實(shí)上,Software 2 CD上的產(chǎn)品沒有可展開的子項(xiàng),因此這里用不用-s選項(xiàng)都一樣
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 ;由于語言包肯定是多個(gè)的,因此這里使用了-s選項(xiàng)。否則全裝……就聯(lián)合國大會了哦……
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已經(jīng)包含在上面兩個(gè)中間了
Skipping SUNWudct it has already been copied.
Processing completed successfully.
# cd
# eject
f) 更換為 install CD。這步主要將圖形界面加入到啟動模塊miniboot的映象中去。
安裝過Solaris 9(Sol 8也是)的朋友都知道,不管是字符界面還是圖形界面,安裝過程中都是先將一個(gè)miniboot(可理解為一個(gè)小型的OS)復(fù)制到被安裝機(jī)器的swap中,然后從它引導(dǎo)被安裝機(jī)器,執(zhí)行安裝過程。我們的miniboot是使用Software 1盤的setup_inistall_server建立安裝服務(wù)器時(shí)生成的,位于<安裝映象目錄>/Solaris_9/Tools/Boot目錄中。但Software 1盤上的miniboot是字符界面的,webstart圖形界面在install盤上。(回憶:使用Software 1盤來boot cdrom和用install盤的boot cdrom有何不同)
因此,如果被安裝機(jī)器帶有顯示器鍵盤鼠標(biāo),可以通過圖形界面更方便地安裝,這就需要使用install盤上s0下的modify_install_server工具來修改miniboot。webstart內(nèi)容在盤的s1目錄中(s0目錄下有一個(gè)鏈接將Boot指向../s1,但……似乎不好用——不但沒有modify成功,原來的miniboot也丟了……為避免這類意外,可以使用modify_install_server的-p選項(xiàng)——把miniboot即Boot目錄更個(gè)名先。本例中沒用-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
2、為安裝服務(wù)器指定被安裝機(jī)器
網(wǎng)上做一臺安裝服務(wù)器,客戶機(jī)boot net時(shí),如果網(wǎng)上有許多機(jī)器,怎么知道哪臺機(jī)器要響應(yīng)呢?這是不少朋友開始接觸遠(yuǎn)程安裝時(shí)的疑惑。實(shí)際上,現(xiàn)在這步工作就是告知install server,哪些客戶是你負(fù)責(zé)響應(yīng)的。使用工具是安裝服務(wù)器上<安裝映象目錄>/Solaris_9/Tools中的 add_install_client。
a) 為CLN準(zhǔn)備一個(gè)臨時(shí)IP地址和主機(jī)名。臨時(shí)IP地址應(yīng)與SVR上提供安裝服務(wù)的網(wǎng)口IP地址在同一網(wǎng)段上。這是因?yàn)樵谶h(yuǎn)程安裝開始時(shí),將需要通過rarp來把臨時(shí)IP賦給CLN,而arp/rarp只能工作在單一網(wǎng)段上(SUN認(rèn)證考試中可是有此概念的題目哦)。CLN的臨時(shí)主機(jī)名僅在SVR上起對應(yīng)臨時(shí)IP的作用,與安裝中CLN的正式主機(jī)名無關(guān)(對/etc/hosts理解透徹的朋友在后面的操作中當(dāng)然可以直接使用臨時(shí)IP而無須臨時(shí)主機(jī)名);
b) 修改SVR上/etc/hosts文件,暫時(shí)加入CLN的臨時(shí)主機(jī)名和臨時(shí)IP。本例中為192.168.1.9和CLN9(SVR連網(wǎng)網(wǎng)口為192.168.1.10):
# vi /etc/hosts
......
192.168.1.9 CLN9
~
:wq!
"hosts" N行,M個(gè)字符
c) 記錄下CLN上與SVR相連網(wǎng)口的mac地址。這可以對CLN加電,在ok下得到,或者CLN原有系統(tǒng),啟動后用ifconfig -a得到;
說明:從這里我們可以稍微理解為什么SUN機(jī)器上OBP參數(shù)中l(wèi)ocal_mac_address?要設(shè)置成false的好處了吧?倘若那值是true,機(jī)器上又無預(yù)裝系統(tǒng),那么要獲得這個(gè)mac地址就夠麻煩的了。
d) 為安裝服務(wù)器增加一臺客戶機(jī)
# cd /export/home/sol9_rinst
# cd Solaris_9/Tools
# ./add_install_client -e <CLN mac地址> CLN9 sun4u
說明:sun4u是CLN的結(jié)構(gòu)平臺,即通常用uname -m顯示出來的名稱。目前SUN的機(jī)器基本都是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
#
上面一堆的屏幕輸出,安裝服務(wù)器都做了些什么配置工作?我們一一看來:
i) Adding Ethernet number for CLN9 to /etc/ethers
這一步將增加的客戶機(jī)CLN的mac地址寫進(jìn)了/etc/ethers文件。這個(gè)文件是rarp(reverse address resolution protocol)用的。一旦rarp發(fā)現(xiàn)網(wǎng)上有這個(gè)mac地址的RARP請求,它將進(jìn)行回答。將對應(yīng)的IP地址告訴對方。對方有了mac地址和IP地址,就可以在網(wǎng)上進(jìn)行TCP/UDP的一些工作了。這真有點(diǎn)象一曲IT版的《趕牲靈》:
“……你若是我的服務(wù)器喲,給我的那個(gè)IP。
哎呀你不是我的服務(wù)器喲,忙你的那個(gè)去。……”
/etc/ethers文件缺省是沒有的。我們可以檢查一下,如果上面的操作后沒有生成該文件或者沒有將CLN的mac地址寫入,可以手工建立或者加入。文件格式為<客戶機(jī)mac地址> <臨時(shí)客戶機(jī)名或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
這一步將安裝服務(wù)器的Solaris映象目錄通過NFS方式共享出來。Solaris 8以后要求在/etc/dfs/dfstab中至少有一條記錄,才能啟動NFS server服務(wù)器進(jìn)程。在系統(tǒng)啟動時(shí),如該文件中有記錄,則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
這里打開安裝服務(wù)器上系統(tǒng)的rarp和tftp(trivial file transfer protocol)服務(wù)的啟動設(shè)置和參數(shù)設(shè)置。前面說過,rarp負(fù)責(zé)響應(yīng)客戶機(jī)的IP請求,建立TCP/IP連接后,tftp負(fù)責(zé)將啟動映象傳送到客戶機(jī)。在客戶機(jī)無文件系統(tǒng)的情況下,無法使用ftp來送文件,因此要用到tftp。in.rarpd和in.tftpd的啟動都要求存在/tftpboot目錄(系統(tǒng)缺省無此目錄),而且/etc/inetd.conf中tftp那行行首的“#”要去掉。我們也可以手工檢查一下:
# cat /etc/inetd.conf | grep tftp
tftp dgram udp6 wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot
(確認(rèn)行首無“#”號)
# cd /
# ls
……tftpboot……
(確認(rèn)目錄存在)
# cd tftpboot
# ls -l
總數(shù) 350
lrwxrwxrwx 1 root root 26 12月 25日 18:35 C0A80109 -> inetboot.SUN4U.Solaris_9-1
lrwxrwxrwx 1 root root 26 12月 25日 18:35 C0A80109.SUN4U -> inetboot.SUN4U.Solaris_9-1
-rwxr-xr-x 1 root root 158208 12月 25日 18:35 inetboot.SUN4U.Solaris_9-1
-rw-r--r-- 1 root root 314 12月 25日 18:35 rm.192.168.1.9
lrwxrwxrwx 1 root root 1 12月 25日 18:35 tftpboot -> .
說明:這是增加了安裝客戶機(jī)后tftpboot目錄中的內(nèi)容,由add_install_client生成。如果需要手工做則必須按照此格式:
--核心文件是inetboot.SUN4U.Solaris_9-1,從<映象目錄>/Solaris_9/Tools/Boot/usr/platform/sun4u/lib/fs/nfs/inetboot拷貝而來
--rm.192.168.1.9是為rm_install_client刪除客戶機(jī)而用的,可不做
--tftpboot為鏈接,不用多說
--C0A80109和C0A80109.SUN4U也都是鏈接,好做。但“C0A80109”從何而來?簡單:C0、A8、01、09就是192.168.1.9的十六進(jìn)制表示法。如果這里需要手工再增加一個(gè)192.168.1.99的客戶,如法再做C0A80163和C0A80163.SUN4U兩個(gè)鏈接就好了。
/etc/bootparams目錄中保存的是安裝/啟動服務(wù)器的參數(shù)。SUN機(jī)器除了可遠(yuǎn)程安裝外,也可不安裝而遠(yuǎn)程啟動(如無盤工作站)。遠(yuǎn)程安裝實(shí)際是需要啟動和安裝2臺服務(wù)器,但一般具體操作時(shí)都合二為一了。啟動服務(wù)器必須與客戶機(jī)在同一網(wǎng)段,安裝服務(wù)器則可不在。
# cat /etc/bootparams
CLN9 root=SVR:/export/home/sol9_rinst/Solaris_9/Tools/Boot install=SVR:/export/home/sol9_rinst boottype=:in rootopts=:rsize=32768
配置完成。為保證上述配置生效,安裝服務(wù)器最好重新啟動一次。
3、開始遠(yuǎn)程安裝
下面的過程就簡單了:
a) SVR與CLN間網(wǎng)線連好。直聯(lián)用交叉線,通過hub或switch用直通線(寫這帖子才弄清楚,兩種網(wǎng)線頭子的線序標(biāo)準(zhǔn)叫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) 看到這個(gè)Select a Language,說明安裝過程已經(jīng)開始。注意上面的“2aa00”,在實(shí)際操作中時(shí)是一個(gè)不斷閃動變化的數(shù)字,這說明安裝服務(wù)器的配置正確,服務(wù)器和客戶機(jī)已經(jīng)談妥,正在轉(zhuǎn)送文件。如果這時(shí)在SVR上使用snoop,可以看到雙方的問答,相當(dāng)有趣:
……
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) 到此為止,遠(yuǎn)程啟動過程非常順利。此后的安裝步驟與本機(jī)安裝基本相同,就不重復(fù)了。只是有一點(diǎn)稍有不同:
……
Please specify the media from which you will install the Solaris Operating
Environment.
Media:
1. CD/DVD
2. Network File System
3. HTTP (Flash archive only)
4. FTP (Flash archive only)
5. Local Tape (Flash archive only)
Media [2]:<回車>
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... -
……
本機(jī)上用CD安裝的時(shí)候,上面的Media菜單缺省選擇是“1”,這里自動變成了“2”,直接回車就好。接下來的network file system path選擇是CD安裝時(shí)不出現(xiàn)的,也已經(jīng)自動配置成了SVR的IP和路徑,還是直接回車。至于后面的是否要eject CD等選擇,無論y或n都沒關(guān)系了。||
[ 本帖最后由 Philmoon 于 2006-12-28 14:32 編輯 ] |
|