跳過導航連結 | |
結束列印檢視 | |
![]() |
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 (規劃)
13. 針對已安裝非全域區域的 ZFS 執行 Live Upgrade
本節提供有關從 UFS 根 (/) 檔案系統遷移至安裝非全域區域之系統上的 ZFS 根集區的逐步說明。在 UFS 檔案系統中,沒有任何非全域區域位於共用檔案系統上。
lucreate 指令會從 UFS 根 (/) 檔案系統建立 ZFS 根集區的啟動環境。在 lucreate 作業之前,ZFS 根集區必須存在,且必須使用磁碟片段 (而非整個磁碟) 加以建立,才能升級及啟動。此程序顯示與 UFS 根 (/) 檔案系統相關聯的現有非全域區域如何複製到 ZFS 根集區中的新啟動環境。
備註 - 使用 Live Upgrade 建立新 ZFS 啟動環境,至少需要安裝 Solaris 10 10/08 發行版本。舊版沒有 ZFS 和 Live Upgrade 軟體可執行這些作業。
三種 Live Upgrade 套裝軟體 SUNWluu、SUNWlur 和 SUNWlucfg 組成了使用 Live Upgrade 進行升級所需的軟體。這些套裝軟體包含現有軟體、新功能和錯誤修正。若您在使用 Live Upgrade 前未移除現有套裝軟體並在系統上安裝新套裝軟體,則升級至目標發行版本時會失敗。
# pkgrm SUNWlucfg SUNWluu SUNWlur
請參閱 My Oracle Support,以確定您有最近更新的修補程式清單。在 My Oracle Support 上搜尋知識文件 1004881.1 - Live Upgrade Software Patch Requirements (之前為 206844)。
成為超級使用者,或者假設一個對等身份。
備註 - 身份包含授權指令與特權指令。如需角色的更多資訊,請參閱「System Administration Guide: Security Services」中的「Configuring RBAC (Task Map)」。
如果您要在本機磁碟上儲存修補程式,請建立如 /var/tmp/lupatches 的目錄,然後將修補程式下載至該目錄中。
從 My Oracle Support 網站,取得修補程式清單。
變更至修補程式目錄。
# cd /var/tmp/lupatches
使用 patchadd 指令安裝修補程式。
# patchadd patch_id
patch_id 為修補程式編號。請以空格分隔多個修補程式名稱。
備註 - 必須依照 My Oracle Support 上知識文件 1004881.1 - Live Upgrade Software Patch Requirements (之前為 206844) 指定的順序套用修補程式。
如有必要,請重新啟動系統。部分修補程式需要重新啟動後才會生效。
僅限 x86:必須重新啟動系統,否則 Live Upgrade 會失敗。
# init 6
ZFS 根集區必須位於單一磁碟片段上,才能啟動和升級。
# zpool create rpool c3t0d0s0
在此範例中,要建立的新 ZFS 名稱為 rpool。該集區會建立於可啟動磁碟片段 c3t0d0s0 上。
如需建立新根集區的資訊,請參閱「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 指令會報告啟動環境的建立是否完整且可啟動。
# 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 根集區中與根集區中的啟動環境共用。
範例 13-1 從安裝非全域區域的 UFS 根 (/) 檔案系統遷移至 ZFS 根集區
在下列範例中,現有非全域區域 myzone 在 UFS 根 (/) 檔案系統中具有其非全域區域根。區域 zzone 在現有 ZFS 儲存集區 pool 中,於 ZFS 檔案系統中有其區域根。使用 Live Upgrade 將 UFS 啟動環境 c2t2d0s0 遷移至 ZFS 啟動環境 zfs2BE。以 UFS 為基礎的 myzone 區域會遷移至新 ZFS 儲存集區 mpool,即 Live Upgrade 作業之前所建立的儲存集區。會複製以 ZFS 為基礎的非全域區域 zzone (但仍會保留在 ZFS 集區 pool 中) 並遷移至新啟動環境 zfs2BE。
建立啟動環境的指令如下:
# zoneadm list -iv ID NAME STATUS PATH BRAND IP 0 global running / native shared - myzone installed /zones/myzone native shared - zzone installed /pool/zones native shared # zpool create mpool mirror c3t0d0s0 c4td0s0 # lucreate -c c1t2d0s0 -n zfs2BE -p mpool Checking GRUB menu... Analyzing system configuration. Updating boot environment description database on all BEs. Updating system configuration files. The device </dev/dsk/c1t1d0s0> is not a root device for any boot environment; cannot get BE ID. Creating configuration for boot environment <zfs2BE>. Source boot environment is <c1t2d0s0>. Creating file systems on boot environment <zfs2BE>. Creating <zfs> file system for </> in zone <global> on <mpool/ROOT/zfs2BE>. Populating file systems on boot environment <zfs2BE>. Analyzing zones. Mounting ABE <zfs2BE>. Generating file list. Copying data from PBE <c1t2d0s0> to ABE <zfs2BE>. 100% of filenames transferred Finalizing ABE. Fixing zonepaths in ABE. Unmounting ABE <zfs2BE>. Fixing properties on ZFS datasets in ABE. Reverting state of zones in PBE <c1t2d0s0>. Making boot environment <zfs2BE> bootable. Updating bootenv.rc on ABE <zfs2BE>. Saving existing file </boot/grub/menu.lst> in top level dataset for BE <zfs2BE> as <mount-point>//boot/grub/menu.lst.prev. File </boot/grub/menu.lst> propagation successful Copied GRUB menu from PBE to ABE No entry for BE <zfs2BE> in GRUB menu Population of boot environment <zfs2BE> successful. Creation of boot environment <zfs2BE> successful.
當 lucreate 作業完成,請使用 lustatus 指令檢視啟動環境狀態,如此範例中所示。
# lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- c1t2d0s0 yes yes yes no - zfsBE yes no no yes -
# zoneadm list -iv ID NAME STATUS PATH BRAND IP 0 global running / native shared - myzone installed /zones/myzone native shared - zzone installed /pool/zones native shared
接下來,請使用 luactivate 指令啟動新 ZFS 啟動環境。例如:
# luactivate zfsBE A Live Upgrade Sync operation will be performed on startup of boot environment <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 <zfsBE> successful.
將系統重新啟動至 ZFS BE。
# init 6 # svc.startd: The system is coming down. Please wait. svc.startd: 79 system services are now being stopped. . . .
確認新啟動環境和遷移區域的狀態,如此範例中所示。
# lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot Delete Status -------------------------- -------- ------ --------- ------ ---------- c1t2d0s0 yes yes yes no - zfsBE yes no no yes -
如果要轉至備用 UFS 啟動環境,則必須再次匯入在 ZFS 啟動環境中建立的所有 ZFS 儲存集區,因為在 UFS 啟動環境中不會自動提供這些儲存集區。當您切換回 UFS 啟動環境時,將會看到與如下內容類似的訊息。
# luactivate c1t2d0s0 WARNING: The following files have changed on both the current boot environment <ZFSbe> zone <global> and the boot environment to be activated <c1t2d0s0>: /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 <c1t2d0s0>. These files will not be automatically synchronized from the current boot environment <ZFSbe> when boot environment <c1t2d0s0>