Solaris 10 5/08 安裝指南:Solaris Live Upgrade 與升級規劃

使用 Solaris Live Upgrade 的升級範例

在此範例中,會使用執行 Solaris 9 發行版本之系統的 lucreate 指令建立新啟動環境。使用 luupgrade 指令將新啟動環境升級到 Solaris 10 5/08 發行版本。將使用 luactivate 指令啟動升級後的啟動環境。並提供返回至原始啟動環境的範例。

安裝必要的修補程式

說明 

更多資訊 


注意 – 注意 –

Solaris Live Upgrade 的正確運作需要特定作業系統版本先安裝限定的一組修補程式修訂版。安裝或執行 Solaris Live Upgrade 之前,必須安裝這些修補程式。



僅適用於 x86 –

從 Solaris 10 1/06 發行版本開始,如果未安裝這組修補程式,Solaris Live Upgrade 會失敗且您可能會看到下列錯誤訊息。如果沒有看到下列錯誤訊息,還是有可能未安裝必要的修補程式。請務必驗證 Sunsolve 資訊文件上所列的所有修補程式都已安裝,然後再嘗試安裝 Solaris Live Upgrade。


ERROR: Cannot find or is not 
executable: </sbin/biosdev>.
ERROR: One or more patches required by 
Live Upgrade has not been installed.

資訊文件 72099 中所列的修補程式隨時會變更。這些修補程式可能會修正 Solaris Live Upgrade 中的缺陷,以及修正 Solaris Live Upgrade 相依之元件中的缺陷。如果使用 Solaris Live Upgrade 出現任何問題,請檢查並確定已安裝最新的 Solaris Live Upgrade 修補程式。 

請參閱 http://sunsolve.sun.com,確定您有最近更新的修補程式清單。在 SunSolve 網站上搜尋資訊文件 72099。

如果您執行的是 Solaris 8 或 Solaris 9 作業系統,則可能無法執行 Solaris Live Upgrade 安裝程式。這些發行版本不包含執行 Java 2 執行期間環境所需要的修補程式集。您必須擁有適用於 Java 2 執行階段環境所建議的修補程式叢集,執行 Solaris Live Upgrade 安裝程式及安裝套裝軟體時建議在此環境下進行。 

若要安裝 Solaris Live Upgrade 套裝軟體,請使用 pkgadd 指令。或者,安裝 Java 2 執行階段環境的建議修補程式叢集。修補程式叢集可以從 http://sunsolve.sun.com 上取得。

執行下列步驟以安裝必要的修補程式。

請從 SunSolve 網站取得修補程式清單。


# patchadd /net/server/export/patches
# init 6

在使用中啟動環境中安裝 Solaris Live Upgrade


備註 –

本程序假定系統正在執行磁碟區管理程式。如需有關使用磁碟區管理程式來管理可移除媒體的詳細資訊,請參閱「System Administration Guide: Devices and File Systems」


  1. 插入 Solaris Operating System DVD 或 Solaris Software - 2 CD。

  2. 針對您所使用的媒體,執行相應步驟。

    • 如果使用 Solaris Operating System DVD,請變更至安裝程式目錄,然後執行該安裝程式。

      • 若為基於 SPARC 的系統


        # cd /cdrom/cdrom0/s0/Solaris_10/Tools/Installers
        # ./liveupgrade20
        
      • 若為基於 x86 的系統


        # cd /cdrom/cdrom0/Solaris_10/Tools/Installers
        # ./liveupgrade20
        

      會顯示 Solaris 安裝程式 GUI。

    • 如果使用 Solaris Software - 2 CD,請執行該安裝程式。


      % ./installer
      

      會顯示 Solaris 安裝程式 GUI。

  3. 從 [選取安裝類型] 面板中,按一下 [自訂]。

  4. 在 [選取語言環境] 面板上,按一下欲安裝的語言。

  5. 選擇欲安裝的軟體。

    • 使用 DVD 安裝時,請在 [選取元件] 面板上按 [下一步],以安裝套裝軟體。

    • 使用 CD 安裝時,請在 [選取產品] 面板上按一下 [Solaris Live Upgrade 的預設安裝],在其他產品選項上按一下會取消選取此軟體。

  6. 請遵循 Solaris 安裝程式面板上的指示來安裝軟體。

建立啟動環境

使用 -c 選項,將來源啟動環境命名為 c0t4d0s0。僅當建立第一個啟動環境時,才需要命名來源啟動環境。如需有關使用 -c 選項命名的更多資訊,請參閱「首次建立啟動環境」步驟 2 中的說明。

新的啟動環境名稱為 c0t15d0s0-A 選項會建立與啟動環境名稱關聯的一段描述。

根 (/) 檔案系統會複製到新的啟動環境。另外,系統會建立新的交換磁碟片段,而不是共用來源啟動環境的交換磁碟片段。


# lucreate -A 'BE_description' -c /dev/dsk/c0t4d0s0 -m /:/dev/dsk/c0t15d0s0:ufs\
-m -:/dev/dsk/c0t15d0s1:swap -n /dev/dsk/c0t15d0s0

升級非使用中的啟動環境

非使用中啟動環境將命名為 c0t15d0s0。升級時要使用的作業系統影像取自網路。


# luupgrade -n c0t15d0s0 -u -s /net/ins-svr/export/Solaris_10 \ 
combined.solaris_wos

檢查啟動環境是否可啟動

lustatus 會報告是否已建立啟動環境。lustatus 指令也將顯示啟動環境是否可以啟動。


# lustatus
boot environment   Is        Active  Active     Can	    Copy
Name               Complete  Now	 OnReboot   Delete	 Status
------------------------------------------------------------------------
c0t4d0s0           yes       yes      yes      no      -
c0t15d0s0          yes       no       no       yes     -

啟動非使用中啟動環境

c0t15d0s0 啟動環境已使用 luactivate 指令成為可啟動環境。然後,系統重新啟動,c0t15d0s0 變為使用中啟動環境。c0t4d0s0 啟動環境現在是非使用中狀態。


# luactivate c0t15d0s0
# init 6

(可選擇) 轉至備用來源啟動環境

依據新啟動環境的啟動狀況,存在下列備用程序:


範例 10–1 SPARC: 在成功建立啟動環境的情況下轉至備用環境

在此範例中,儘管原始的 c0t4d0s0 啟動環境已成功啟動,但它仍會復原成使用中啟動環境。裝置名稱是 first_disk


# /sbin/luactivate first_disk 
# init 6


範例 10–2 SPARC: 從失敗的啟動環境啟動中轉至備用環境

在此範例中,新的啟動環境無法啟動,在從原始啟動環境 (c0t4d0s0) 啟動之前,您必須以單一使用者模式返回至 OK 提示符號。


OK boot net -s
# /sbin/luactivate first_disk
Do you want to fallback to activate boot environment c0t4d0s0 
(yes or no)? yes
# init 6

原始啟動環境即 c0t4d0s0 將成為使用中啟動環境。



範例 10–3 SPARC: 使用 DVD、CD 或網路安裝影像轉至備用原始啟動環境

在此範例中,新的啟動環境無法啟動,並且您無法從原始啟動環境啟動,必須使用媒體或網路安裝影像進行啟動。裝置是 /dev/dsk/c0t4d0s0。原始啟動環境即 c0t4d0s0 將成為使用中啟動環境。


OK boot net -s
# fsck /dev/dsk/c0t4d0s0
# mount /dev/dsk/c0t4d0s0 /mnt 
# /mnt/sbin/luactivate
Do you want to fallback to activate boot environment c0t4d0s0 
(yes or no)? yes
# umount /mnt 
# init 6


範例 10–4 x86: 使用 GRUB 功能表轉至備用原始啟動環境

從 Solaris 10 1/06 發行版本開始,下列範例提供藉由使用 GRUB 功能表轉至備用環境的步驟。

在此範例中,GRUB 功能表會正確顯示,但是不會啟動新的啟動環境。若要啟用備用環境,請以單一使用者模式啟動原始啟動環境。

  1. 成為超級使用者,或者假定一個對等身份。

  2. 若要顯示 GRUB 功能表,請重新啟動系統。


    # init 6
    

    會顯示 GRUB 功能表。


    GNU GRUB version 0.95 (616K lower / 4127168K upper memory)
    +-------------------------------------------------------------------+
    |Solaris                                                            |
    |Solaris failsafe                                                   |
    |second_disk                                                        |
    |second_disk failsafe                                               |
    +-------------------------------------------------------------------+
    Use the ^ and v keys to select which entry is highlighted. Press
    enter to boot the selected OS, 'e' to edit the commands before
    booting, or 'c' for a command-line.
  3. 請從 GRUB 功能表選取原始啟動環境。啟動環境必須已使用 GRUB 軟體建立。Solaris 10 1/06 發行版本之前版本建立的啟動環境,不是 GRUB 啟動環境。若您沒有可啟動的 GRUB 啟動環境,請跳至範例 10–5

  4. 鍵入下列項目來編輯 GRUB 功能表:e

  5. 使用箭頭鍵選取 kernel /boot/multiboot,然後鍵入 e。如此會顯示 GRUB 編輯功能表。


    grub edit>kernel /boot/multiboot
  6. 鍵入 -s 以啟動為單一使用者模式。


    grub edit>kernel /boot/multiboot -s
    
  7. 啟動與掛載啟動環境。然後加以啟動。


# b
# fsck /dev/dsk/c0t4d0s0
# mount /dev/dsk/c0t4d0s0 /mnt 
# /mnt/sbin/luactivate
Do you want to fallback to activate boot environment c0t4d0s0
(yes or no)? yes
# umount /mnt
# init 6


範例 10–5 x86: 使用 DVD 或 CD 以 GRUB 功能表轉至備用原始啟動環境

從 Solaris 10 1/06 發行版本開始,下列範例提供使用 DVD 或 CD 轉至備用環境的步驟。

在此範例中,新的啟動環境無法啟動,此外,不會顯示 GRUB 功能表。若要啟用備用環境,請以單一使用者模式啟動原始啟動環境。

  1. 請插入 Solaris Operating System for x86 Platforms DVD 或 Solaris Software for x86 Platforms - 1 CD。

  2. 成為超級使用者,或者假定一個對等身份。

  3. 從 DVD 或 CD 啟動。


    # init 6
    

    會顯示 GRUB 功能表。


    GNU GRUB version 0.95 (616K lower / 4127168K upper memory)
    +-------------------------------------------------------------------+
    |Solaris 10 5/08                                                    |
    |Solaris 10 5/08 Serial Console ttya                                |
    |Solaris 10 5/08 Serial Console ttyb (for lx50, v60x and v65x       |
    +-------------------------------------------------------------------+
    Use the ^ and v keys to select which entry is highlighted. Press
    enter to boot the selected OS, 'e' to edit the commands before
    booting, or 'c' for a command-line.
  4. 等待啟動預設選項,或選擇顯示的任何選項。

    會顯示安裝畫面。


    +-------------------------------------------------------------------+
    
    |Select the type of installation you want to perform:                |
    |                                                                    |
    |         1 Solaris Interactive                                      |
    |         2 Custom JumpStart                                         |
    |         3 Solaris Interactive Text (Desktop session)               |
    |         4 Solaris Interactive Text (Console session)               |
    |         5 Apply driver updates                                     |
    |         6 Single user shell                                        |
    |                                                                    |
    |        Enter the number of your choice followed by the <ENTER> key.|
    |        Alternatively, enter custom boot arguments directly.        |
    |
    |         If you wait 30 seconds without typing anything,            |
    |         an interactive installation will be started.               |
    +----------------------------------------------------------------- --+
  5. 選擇 [Single user shell] (單一使用者 shell) 選項。

    會顯示下列訊息。


    Do you wish to automatically update the boot archive? y /n
  6. 鍵入:n


    Starting shell...
    #

    您現在處於單一使用者模式。

  7. 掛載啟動環境。然後啟動並重新啟動。


    # fsck /dev/dsk/c0t4d0s0
    # mount /dev/dsk/c0t4d0s0 /mnt 
    # /mnt/sbin/luactivate
    Do you want to fallback to activate boot environment c0t4d0s0
    (yes or no)? yes
    # umount /mnt
    # init 6