跳過導航連結 | |
結束列印檢視 | |
![]() |
Oracle Solaris 10 1/13 安裝指南:Live Upgrade 與升級規劃 Oracle Solaris 10 1/13 Information Library (繁體中文) |
4. 使用 Live Upgrade 建立啟動環境 (作業)
8. 在已安裝非全域區域的系統上升級 Oracle Solaris 作業系統
第 2 部分使用 Live Upgrade 升級和遷移至 ZFS 根集區
11. 針對 ZFS 執行 Live Upgrade (規劃)
此程序說明如何將 UFS 檔案系統遷移至 ZFS 檔案系統。透過建立啟動環境,可將重要檔案系統從使用中 UFS 啟動環境複製到 ZFS 根集區。 lucreate 指令會將重要檔案系統複製到現有 ZFS 根集區中的新啟動環境。使用者定義的 (可共用的) 檔案系統並不會複製,也不會與來源 UFS 啟動環境共用。此外,UFS 檔案系統和 ZFS 根集區不會共用 /swap。如需重要檔案系統和可共用檔案系統的簡介,請參閱檔案系統類型。
備註 - 若要將使用中 UFS 根 (/) 檔案系統遷移至 ZFS 根集區,您必須提供根集區的名稱。重要檔案系統均會複製到根集區。
最新的套裝軟體和修補程式可確保您有此發行版本中的所有最新錯誤修正程式和新功能。在繼續建立新啟動環境之前,請確定您已安裝與您系統相關的所有修補程式。
下列子步驟描述 My Oracle Support 知識文件 1004881.1 - Live Upgrade Software Patch Requirements (之前為 206844) 中的步驟。
備註 - 使用 Live Upgrade 建立新 ZFS 啟動環境,至少需要安裝 Solaris 10 10/08 發行版本。舊版沒有 ZFS 和 Live Upgrade 軟體可執行這些作業。
備註 - 身份包含授權指令與特權指令。如需角色的更多資訊,請參閱「System Administration Guide: Security Services」中的「Configuring RBAC (Task Map)」。
三種 Live Upgrade 套裝軟體 SUNWluu、SUNWlur 和 SUNWlucfg 組成了使用 Live Upgrade 進行升級所需的軟體。這些套裝軟體包含現有軟體、新功能和錯誤修正。若您在使用 Live Upgrade 前未移除現有套裝軟體並在系統上安裝新套裝軟體,則升級至目標發行版本時會失敗。從 Solaris 10 8/07 發行版本開始,會新增 SUMWlucfg 套裝軟體。如果您是使用 Solaris 10 8/07 之前發行版本的 Live Upgrade 套裝軟體,並不需要移除此套裝軟體。
# pkgrm SUNWlucfg SUNWluu SUNWlur
請參閱 My Oracle Support,以確定您有最近更新的修補程式清單。在 My Oracle Support 網站上,搜尋知識文件 1004881.1 - Live Upgrade Software Patch Requirements (之前為 206844)。
如果您要在本機磁碟上儲存修補程式,請建立如 /var/tmp/lupatches 的目錄,然後將修補程式下載至該目錄中。
從 My Oracle Support 網站,取得修補程式清單。
變更至修補程式目錄。
# cd /var/tmp/lupatches
使用 patchadd 指令安裝修補程式。
# patchadd patch_id
patch_id 為修補程式編號。請以空格分隔多個修補程式名稱。
備註 - 必須依照知識文件 1004881.1 - Live Upgrade Software Patch Requirements (之前為 206844) 中指定的順序套用修補程式。
如有必要,請重新啟動系統。部分修補程式需要重新啟動後才會生效。
僅限 x86:必須重新啟動系統,否則 Live Upgrade 會失敗。
# init 6
您現在已經有成功遷移所需的套裝軟體和修補程式。
ZFS 根集區必須位於單一磁碟片段上,才能啟動和升級。
# zpool create rpool c0t1d0s5
指定要建立的新 ZFS 根集區之名稱。
在磁碟片段 c0t1d0s5 上建立新根集區。
如需建立新根集區的資訊,請參閱「Oracle Solaris ZFS Administration Guide 」。
# lucreate [-c ufsBE] -n new-zfsBE -p rpool
目前的 UFS 啟動環境的名稱。此選項不是必要選項,它僅在建立第一個啟動環境時使用。如果您是首次執行 lucreate 指令,並省略了 -c 選項,則軟體會為您建立一個預設名稱。
欲建立的啟動環境名稱。該名稱在此系統上必須是唯一的。
將新建立的 ZFS 根 (/) 檔案系統置於 rpool 所定義的 ZFS 根集區中。
建立新 ZFS 啟動環境可能需要一些時間。UFS 檔案系統資料將複製到 ZFS 根集區。在建立非使用中的啟動環境後,您可以使用 luupgrade 或 luactivate 指令,來升級或啟動新的 ZFS 啟動環境。
# lustatus boot environment Is Active Active Can Copy Name Complete Now OnReboot Delete Status ----------------------------------------------------------------- ufsBE yes yes yes no - new-zfsBE yes no no yes -
list 指令會顯示系統上所有資料集的名稱。在此範例中,rpool 為 ZFS 集區的名稱,new-zfsBE 為新建立的 ZFS 啟動環境名稱。
# zfs list NAME USED AVAIL REFER MOUNTPOINT rpool 11.4G 2.95G 31K /rpool rpool/ROOT 4.34G 2.95G 31K legacy rpool/ROOT/new-zfsBE 4.34G 2.95G 4.34G / rpool/dump 2.06G 5.02G 16K - rpool/swap 5.04G 7.99G 16K -
在執行 luactivate 指令之前,所列出的新啟動環境掛載點都是暫時的掛載點。/dump 和 /swap 磁碟區不會與原始 UFS 啟動環境共用,但是會在 ZFS 根集區中與根集區中的啟動環境共用。
您現在可以升級及啟動新的啟動環境。
範例 12-1 將 UFS 根 (/) 檔案系統遷移至 ZFS 根集區
在此範例中,新 ZFS 根集區 rpool 會建立在獨立磁碟片段 C0t0d0s4 上。lucreate 指令會將目前執行中的 UFS 啟動環境 c0t0d0 遷移至新 ZFS 啟動環境 new-zfsBE,並且將新啟動環境置於 rpool 中。
# zpool create rpool C0t0d0s4 # zfs list NAME USED AVAIL REFER MOUNTPOINT rpool 9.29G 57.6G 20K /rpool # lucreate -c c0t0d0 -n new-zfsBE -p rpool Determining types of file systems supported Validating file system requests Preparing logical storage devices Preparing physical storage devices Configuring physical storage devices Configuring logical storage devices Analyzing system configuration. No name for current boot environment. Current boot environment is named <c0t0d0>. Creating initial configuration for primary boot environment <c0t0d0>. INFORMATION: No BEs are configured on this system. The device </dev/dsk/c1t0d0s0> is not a root device for any boot environment; cannot get BE ID. PBE configuration successful: PBE name <c0t0d0> PBE Boot Device </dev/dsk/c1t0d0s0>. Updating boot environment description database on all BEs. Updating system configuration files. The device </dev/dsk/c1t0d0s6> is not a root device for any boot environment; cannot get BE ID. Creating configuration for boot environment <new-zfsBE>. Source boot environment is <c0t0d0>. Creating file systems on boot environment <new-zfsBE>. Creating <zfs> file system for </> in zone <global> on <rpool/ROOT/new-zfsBE>. Populating file systems on boot environment <new-zfsBE>. Analyzing zones. Mounting ABE <new-zfsBE>. Generating file list. Copying data from PBE <c0t0d0> to ABE <new-zfsBE>. 100% of filenames transferred Finalizing ABE. Fixing zonepaths in ABE. Unmounting ABE <new-zfsBE>. Fixing properties on ZFS datasets in ABE. Reverting state of zones in PBE <c0t0d0>. Making boot environment <new-zfsBE> bootable. Creating boot_archive for /.alt.tmp.b-Cjh.mnt updating /.alt.tmp.b-Cjh.mnt/platform/sun4u/boot_archive Population of boot environment <new-zfsBE> successful. Creation of boot environment <new-zfsBE> successful. # lustatus boot environment Is Active Active Can Copy Name Complete Now OnReboot Delete Status ------------------------------------------------------------------------ c0t0d0 yes yes yes no - new-zfsBE yes no no yes - # zfs list NAME USED AVAIL REFER MOUNTPOINT rpool 11.4G 2.95G 31K /rpool rpool/ROOT 4.34G 2.95G 31K legacy rpool/ROOT/new-zfsBE 4.34G 2.95G 4.34G / rpool/dump 2.06G 5.02G 16K - rpool/swap 5.04G 7.99G 16K -
您現在可以升級或啟動新的啟動環境。
在此範例中,會使用 luupgrade 指令,從儲存於 -s 選項所指示之位置的映像檔升級新的啟動環境。
# luupgrade -n zfsBE -u -s /net/install/export/s10/combined.s10 51135 blocks miniroot filesystem is <lofs> Mounting miniroot at </net/install/export/solaris_10/combined.solaris_10_wos /Solaris_10/Tools/Boot> Validating the contents of the media </net/install/export/s10/combined.s10>. The media is a standard Solaris media. The media contains an operating system upgrade image. The media contains Solaris version <10_1008>. Constructing upgrade profile to use. Locating the operating system upgrade program. Checking for existence of previously scheduled Live Upgrade requests. Creating upgrade profile for BE <zfsBE>. Determining packages to install or upgrade for BE <zfsBE>. Performing the operating system upgrade of the BE <zfsBE>. CAUTION: Interrupting this process may leave the boot environment unstable or unbootable. Upgrading Solaris: 100% completed Installation of the packages from this media is complete. Adding operating system patches to the BE <zfsBE>. The operating system patch installation is complete. INFORMATION: The file /var/sadm/system/logs/upgrade_log on boot environment <zfsBE> contains a log of the upgrade operation. INFORMATION: The file var/sadm/system/data/upgrade_cleanup on boot environment <zfsBE> contains a log of cleanup operations required. INFORMATION: Review the files listed above. Remember that all of the files are located on boot environment <zfsBE>. Before you activate boot environment <zfsBE>, determine if any additional system maintenance is required or if additional media of the software distribution must be installed. The Solaris upgrade of the boot environment <zfsBE> is complete.
在建立新的啟動環境之後,隨時都可以加以啟動。
# luactivate new-zfsBE A Live Upgrade Sync operation will be performed on startup of boot environment <new-zfsBE>. ********************************************************************** The target boot environment has been activated. It will be used when you reboot. NOTE: You MUST NOT USE the reboot, halt, or uadmin commands. You MUST USE either the init or the shutdown command when you reboot. If you do not use either init or shutdown, the system will not boot using the target BE. ********************************************************************** In case of a failure while booting to the target BE, the following process needs to be followed to fallback to the currently working boot environment: 1. Enter the PROM monitor (ok prompt). 2. Boot the machine to Single User mode using a different boot device (like the Solaris Install CD or Network). Examples: At the PROM monitor (ok prompt): For boot to Solaris CD: boot cdrom -s For boot to network: boot net -s 3. Mount the Current boot environment root slice to some directory (like /mnt). You can use the following command to mount: mount -Fufs /dev/dsk/c1t0d0s0 /mnt 4. Run <luactivate> utility with out any arguments from the current boot environment root slice, as shown below: /mnt/sbin/luactivate 5. luactivate, activates the previous working boot environment and indicates the result. 6. Exit Single User mode and reboot the machine. ********************************************************************** Modifying boot archive service Activation of boot environment <new-zfsBE> successful.
將系統重新啟動至 ZFS 啟動環境。
# init 6 # svc.startd: The system is coming down. Please wait. svc.startd: 79 system services are now being stopped. . . .
如果要轉至備用 UFS 啟動環境,則必須再次匯入在 ZFS 啟動環境中建立的所有 ZFS 儲存集區,因為在 UFS 啟動環境中不會自動提供這些儲存集區。當您切換回 UFS 啟動環境時,將會看到類似下列範例的訊息。
# luactivate c0t0d0 WARNING: The following files have changed on both the current boot environment <new-zfsBE> zone <global> and the boot environment to be activated <c0t0d0>: /etc/zfs/zpool.cache INFORMATION: The files listed above are in conflict between the current boot environment <zfsBE> zone <global> and the boot environment to be activated <c0t0d0>. These files will not be automatically synchronized from the current boot environment <new-zfsBE> when boot environment <c0t0d0>