在 x86/x64 平台上搭配使用 Solaris JumpStart 與 Solaris 10 作業系統Craig Winter 與 Dale Layfield,2007 年 3 月 摘要Sun Microsystems 的 Solaris JumpStart 技術可用於在多個網路節點上自動安裝 Solaris 作業系統與其他相關軟體。 在 x86/x64 平台與在 SPARC 平台上對 Solaris 10 作業系統使用 Solaris JumpStart 軟體,基本上方法相同。但若要正確運作,仍必須注意兩者之間的些微差異。 此文件將提供必要的步驟與說明,讓您瞭解如何為 Sun x86/x64 機器上的 Solaris 10 作業系統設定 JumpStart 伺服器,以及如何為兩個或更多用戶端配置 JumpStart。 如需一般性的參考資料,請參閱 Sun 線上文件使用自訂 JumpStart。 簡介此文提供可讓您使用 x86/x64 平台的 Solaris 10 作業系統建立 JumpStart 伺服器的逐步程序。這一版的 Solaris 10 作業系統適用於伺服器上執行的作業系統,以及 JumpStart 安裝伺服器上的作業系統。使用 AMD Opteron 與 Intel 處理器的機器皆可做為伺服器與用戶端,使用哪一種處理器對效果並無影響。 另提供下列作業的相關指示: 用戶端上必須啟用 Pre-boot Execution Environment (PXE),才能從網路開機。在某些用戶端上,PXE 必須在 BIOS 中啟用。 建立用戶端啟動檔案時所產生的錯誤,在「最終清除」一節中有相關說明。 Solaris JumpStart 程序這些指示可引導您設定 JumpStart 安裝伺服器,進而在兩個用戶端上安裝適用於 x86/x64 平台的 Solaris 10 作業系統。 在此練習中,JumpStart 伺服器的節點名稱為 如有需要,您可以下載 Solaris 10 作業系統。 a. 在伺服器上建立安裝目錄: # mkdir -p /export/install b. 將適用於 x86/x64 平台的 Solaris 10 作業系統 DVD 放入伺服器的 DVD 播放器中。移至 DVD 的 # cd /cdrom/cdrom0/Solaris_10/Tools # ./setup_install_server /export/install Verifying target directory... Calculating the required disk space for the Solaris_10 product \|/-\|/- Calculating space required for the installation boot image \|/-\|/- Copying the CD image to disk... \|/-\|/- Copying Install Boot Image hierarchy... \|/-\|/- Copying /boot x86 netboot hierarchy... \|/-\|/- Install Server setup complete # c. 驗證 # du -sk /export/install 3083278 /export/install d. 從 DVD 播放器取出 DVD。 # cd /;eject 用戶端配置檔案用於控制自訂 JumpStart 安裝。 a. 建立將用以存放檔案的配置目錄: # mkdir /export/config b. 建立 第一個要建立的檔案是 在作業系統安裝開始之前,JumpStart 用戶端會尋找名為
# cd /export/config
# mkdir sysidcfg1
# cd sysidcfg1
# vi sysidcfg
system_locale=en_US.ISO8859-1
timezone=US/Pacific
timeserver=localhost
terminal=vt100
name_service=NONE
security_policy=NONE
root_password=<encrypted from /etc/shadow>
network_interface=bge0 {hostname=client1
netmask=255.255.255.0
protocol_ipv6=no
default_route=172.16.64.1}
:wq
# cd ../
# mkdir sysidcfg2
# cd sysidcfg2
# vi sysidcfg
system_locale=en_US.ISO8859-1
timezone=US/Pacific
timeserver=localhost
terminal=vt100
name_service=NONE
security_policy=NONE
root_password=<encrypted from /etc/shadow>
network_interface=bge0 {hostname=client2
netmask=255.255.255.0
protocol_ipv6=no
default_route=172.16.64.1}
:wq
c. 建立 下一個要建立的檔案是
# cd /export/config # vi rules hostname client1 begin1 profile1 finish1 hostname client2 begin2 profile2 finish2 :wq
d. 建立
您可以視需要使用多個 # cd /export/config # vi begin1 #!/bin/sh echo "Begin Script for JumpStart client1..." :wq # vi begin2 #!/bin/sh echo "Begin Script for JumpStart client2..." :wq # chmod 755 begin* 在用戶端上進行安裝時, 「Solaris 10 Installation Guide」包含「Custom JumpStart Environment Variables」一節,其中描述可在 e. 建立
您可以視需要使用多個 # cd /export/config # vi finish1 #!/bin/sh echo "Finish Script for JumpStart client1..." echo "Get rid of the nfs prompt during the initial boot" touch /a/etc/.NFS4inst_state.domain :wq # vi finish2 #!/bin/sh echo "Finish Script for JumpStart client2..." echo "Get rid of the nfs prompt during the initial boot" touch /a/etc/.NFS4inst_state.domain :wq # chmod 755 finish* Solaris 安裝程式會在 JumpStart 目錄 (即
cp /tmp/install_config/<file_name> /a/<path_name>/ f. 建立
您可以建立多個 # cd /export/config # vi profile1 # install_type MUST be first install_type initial_install # start with the minimal required number of packages cluster SUNWCXall cluster SUNWCapache delete cluster SUNWCpcmc delete cluster SUNWCpcmcx delete cluster SUNWCthai delete cluster SUNWClp delete cluster SUNWCnis delete cluster SUNWCppp delete # format the entire disk for Solaris fdisk all solaris all # define how the disk is partitioned partitioning explicit filesys rootdisk.s0 6144 / filesys rootdisk.s1 1024 swap filesys rootdisk.s7 free /state/partition1 # install systems as standalone system_type standalone # specify patches to install patch 119281-06 nfs 172.16.64.194:/export/patches # specify packages to install package SPROcc add nfs 172.16.64.194:/export/packages :wq # vi profile2 # install_type MUST be first install_type initial_install # start with the minimal required number of packages cluster SUNWCXall cluster SUNWCapache delete cluster SUNWCpcmc delete cluster SUNWCpcmcx delete cluster SUNWCthai delete cluster SUNWClp delete cluster SUNWCnis delete cluster SUNWCppp delete # format the entire disk for Solaris fdisk all solaris all # define how the disk is partitioned partitioning explicit filesys rootdisk.s0 6144 / filesys rootdisk.s1 4096 swap filesys rootdisk.s7 free /state/partition1 # install systems as standalone system_type standalone # specify patches to install patch 119281-06 nfs 172.16.64.194:/export/patches # specify packages to install package SPROcc add nfs 172.16.64.194:/export/packages :wq g. 建立
# cd /export/config # cp /export/install/Solaris_10/Misc/jumpstart_sample/check . h. 執行檢查程序檔: # ./check Validating rules... Validating profile profile1... Validating profile profile2... The custom JumpStart configuration is ok. 若未發現錯誤,即會建立 # version=2 checksum=<num> a. 修改 b. 編輯 # vi /etc/dfs/dfstab # Place share(1M) commands here for automatic execution # on entering init state 3. # # Issue the command 'svcadm enable network/nfs/server' to # run the NFS daemon processes and the share commands, after # adding the very first entry to this file. # # share [-F fstype] [ -o options] [-d "<text>"] <pathname> # [resource] # for example, # share -F nfs -o rw=engineering -d "home dirs" /export/home2 share -F nfs -o ro,anon=0 /export/install share -F nfs -o ro,anon=0 /export/config share -F nfs -o ro,anon=0 /export/patches share -F nfs -o ro,anon=0 /export/packages :wq c. 啟動 NFS 伺服器。 # /etc/init.d/nfs.server start d. 共用目錄。 # shareall # share - /export/install ro,anon=0 "" - /export/config ro,anon=0 "" - /export/patches ro,anon=0 "" - /export/packages ro,anon=0 "" e. 驗證檔案共用。 # showmount -e localhost export list for localhost: /export/install (everyone) /export/config (everyone) /export/patches (everyone) /export/packages (everyone) a. 對每個用戶端執行 b. 移至 # cd /export/install/Solaris_10/Tools c. 對網路上每個執行 JumpStart 安裝的用戶端執行
# ./add_install_client \
-d \
-e 00:0a:e4:37:16:4d \
-s 172.16.64.194:/export/install \
-c 172.16.64.194:/export/config \
-p 172.16.64.194:/export/config/sysidcfg1 i86pc
enabling tftp in /etc/inetd.conf
Converting /etc/inetd.conf
enabling network/tftp/udp6 service
copying boot file to /tftpboot/pxegrub.I86PC.Solaris_10-1
If not already configured, enable PXE boot by creating
a macro named 01000AE429C1FD with:
Boot server IP (BootSrvA) : 172.16.64.194
Boot file (BootFile) : 01000AE429C1FD
# ./add_install_client \
-d \
-e 00:0a:e4:2a:33:f8 \
-s 172.16.64.194:/export/install \
-c 172.16.64.194:/export/config \
-p 172.16.64.194:/export/config/sysidcfg2 i86pc
enabling tftp in /etc/inetd.conf
Converting /etc/inetd.conf
enabling network/tftp/udp6 service
copying boot file to /tftpboot/pxegrub.I86PC.Solaris_10-1
If not already configured, enable PXE boot by creating
a macro named 01000AE42A33F8 with:
Boot server IP (BootSrvA) : 172.16.64.194
Boot file (BootFile) : 01000AE42A33F8
之後在 a. 執行 # /usr/sadm/admin/bin/dhcpmgr Java Accessibility Bridge for GNOME loaded. 會出現第一個畫面: b. 選取 [配置成 DHCP 伺服器],然後按一下 [確定]。 [DHCP 配置精靈] 隨即出現: c. 選取 [文字檔],然後按 [下一步]。 d. 驗證儲存路徑,然後按 [下一步]。 e. 選取名稱服務,然後按 [下一步]。 f. 驗證租用資訊,然後按 [下一步]。 g. 驗證 DNS 網域資訊,然後按 [下一步]。 h. 驗證網路資訊,然後按 [下一步]。 i. 選取網路類型與路由選項,然後按 [下一步]。 j. 驗證 NIS 網域資訊,然後按 [下一步]。 k. 驗證 NIS+ 網域資訊,然後按 [下一步]。 l. 檢閱設定,然後按一下 [完成]。 [DHCP 管理員] 隨即出現,並要求您啟動 [位址精靈]: m. 按一下 [是]。 [位址精靈] 隨即出現: n. 鍵入 IP 位址的數字,然後按 [下一步]。 o. 驗證伺服器資訊,然後按 [下一步]。 p. 驗證 IP 位址,然後按 [下一步]。 q. 驗證用戶端配置資訊,然後按 [下一步]。 r. 選取租用類型,然後按 [下一步]。 s. 檢閱設定,然後按一下 [完成]。 在 [建立巨集] 表單隨即出現: 在 [名稱] 欄位中鍵入由 u. 在 [選項值] 欄位中鍵入 JumpStart 伺服器的網路 IP 位址,以建立巨集的 v. 重複相同的程序以建立第二個巨集。 x. 按一下 [增加]。 y. 按一下 [增加],再按一下 [確定]。 z. 產生第二個巨集後,在 [DHCP 管理員] 視窗中選取 [檔案] -> [結束],以結束 當您執行 由於在建立 - install dhcp 因此,請將檔案由:
default=0
timeout=30
title Solaris_10 Jumpstart
kernel /I86PC.Solaris_10-1/multiboot kernel/unix -B \
install_config=172.16.64.194:/export/config, \
sysid_config=172.16.64.194:/export/config/sysidcfg1, \
install_media=172.16.64.194:/export/install, \
install_boot=172.16.64.194:/export/install/boot
module /I86PC.Solaris_10-1/x86.miniroot
變更為:
default=0
timeout=4
title Solaris_10 Jumpstart
kernel /I86PC.Solaris_10-1/multiboot kernel/unix - install dhcp -B \
install_config=172.16.64.194:/export/config, \
sysid_config=172.16.64.194:/export/config/sysidcfg1, \
install_media=172.16.64.194:/export/install, \
install_boot=172.16.64.194:/export/install/boot
module /I86PC.Solaris_10-1/x86.miniroot
啟動用戶端。 出現提示後,在用戶端的鍵盤上按下 F12。
Network Boot Request....
CLIENT MAC ADDR: 00 0A E4 2A 33 F8 GUID: 11223344 556 7788 99AA \
BBCCDDEEFF00
DHCP....\|/-\|/-
若所有項目皆已正確設定,安裝作業即可執行到結束為止。如有問題發生,安裝程式即會結束,並進入 shell 中。錯誤的成因會記錄在 安裝後以下是 JumpStart 安裝的記錄檔:
/var/sadm/system/logs/install_log
begin_log
finish_log
sysidtool.log
關於作者Craig Winter 與 Dale Layfield 是 Sun Microsystems, Inc. 之 Market Development Engineering 中 MDE Verticals Group 的工程師。 Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. |
BigAdmin SubscriptionsBigAdmin Areas
BigAdmin Sun Center
BigAdmin Topics |