以下是本章所介紹逐步程序的列表。
作業 |
如需相關說明,請參閱... |
---|---|
尋找您要備份的檔案系統名稱。 | |
計算完整備份所需的磁帶數。 | |
備份根檔案系統 | |
執行鏡像或診測檔案系統的線上備份。 | |
請使用這個程序來判斷您要備份之檔案系統的名稱。
顯示 /etc/vfstab 檔的內容。
您不必是超級使用者才能夠執行這個指令。
% more /etc/vfstab |
在裝載點欄位尋找您要備份之檔案系統的名稱。
請在備份檔案系統時使用這個名稱。
% more /etc/vfstab |
在以下範例中,列示在 /etc/vfstab 檔中的可用檔案系統會顯示出來。
% more /etc/vfstab #device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # #/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes - f - /dev/fd fd - no - /proc - /proc proc - no - /dev/dsk/c1t6d0s1 - - swap - no - /dev/dsk/c1t6d0s0 /dev/rdsk/c1t6d0s0 / ufs 1 no - /dev/dsk/c1t6d0s3 /dev/rdsk/c1t6d0s3 /cache ufs 2 yes - swap - /tmp tmpfs - yes - |
請使用這個程序來計算您備份檔案系統時所需的磁帶數。
在您要備份之叢集節點上成為超級使用者。
以位元組預估備份大小。
# ufsdump S filesystem |
顯示執行備份時的預計位元組數。
指定您要備份之檔案系統的名稱。
將預估大小除以磁帶容量來求出所需的磁帶數。
在以下範例中,905,881,620 位元組的檔案系統可以輕易地放入 4 GB 磁帶(905,881,620 4,000,000,000)。
# ufsdump S /global/phys-schost-1 905881620 |
請使用這個程序來備份叢集節點的 root (/) 檔案系統。請先確定叢集執行時沒有任何錯誤,再執行備份程序。
在您要備份的叢集節點上成為超級使用者。
將每個執行的資料服務從要備份的節點切換到叢集中的另一節點上。
# scswitch -z -D disk-device-group -h nodelist |
執行切換。
要進行切換的磁碟裝置群組名稱。
指定要當作磁碟裝置群組切換目標的叢集節點名稱。 此節點會成為新的主要節點。
停止節點。
# shutdown -g0 -y -i0 |
在 ok 提示,重新啟動為非叢集模式。
ok boot -x |
備份 root (/) 檔案系統。
如果根磁碟為未密封,請使用下列指令。
# ufsdump 0ucf dump-device / |
如果根磁碟為密封,請使用下列指令。
# ufsdump 0ucf dump-device /dev/vx/rdsk/rootvol |
請參閱 ufsdump(1M) 線上援助頁,以取得詳細資訊。
將節點重新啟動為叢集模式。
# init 6 |
在以下範例中,root (/) 檔案系統是備份到磁帶裝置 /dev/rmt/0。
# ufsdump 0ucf /dev/rmt/0 / DUMP: Writing 63 Kilobyte records DUMP: Date of this level 0 dump: Tue Apr 18 18:06:15 2000 DUMP: Date of last level 0 dump: the epoch DUMP: Dumping /dev/rdsk/c0t0d0s0 (phys-schost-1:/) to /dev/rmt/0 DUMP: Mapping (Pass I) [regular files] DUMP: Mapping (Pass II) [directories] DUMP: Estimated 859086 blocks (419.48MB). DUMP: Dumping (Pass III) [directories] DUMP: Dumping (Pass IV) [regular files] DUMP: 859066 blocks (419.47MB) on 1 volume at 2495 KB/sec DUMP: DUMP IS DONE DUMP: Level 0 dump on Tue Apr 18 18:06:15 2000 |
備份鏡像複合裝置時不必先卸載,也不必將整個鏡像設成離線。 有一個子鏡像必須暫時設成離線,因此會失去鏡像功能,但可在備份完成後重新使它進入線上狀態並同步,這樣便可以不必關機或拒絕使用者存取資料。 使用鏡像來執行線上備份可建立作用中檔案系統的"快照"備份。
如果程式在執行 lockfs 指令之前將資料寫入容體,可能會發生問題。 要避免這個問題,請先暫時停止在這個節點上執行的所有服務。 另外,請先確認叢集執行時沒有任何錯誤,再執行備份程序。
在您要備份的叢集節點上成為超級使用者。
使用 metaset(1M) 指令來判斷哪一個節點擁有已備份容體的所有權。
# metaset -s setname |
指定磁碟組名稱。
使用 lockfs(1M) 指令以及 -w 選項,使檔案系統進入防寫的鎖定狀態。
# lockfs -w mountpoint |
只有當 UFS 檔案系統位於鏡像上時,才需要鎖定檔案系統。 例如,如果複合裝置設成資料庫管理軟體或其它特定應用程式的原始裝置,則不需要使用 lockfs 指令。不過,您可能要執行適當的廠商相關公用程式,來清除任何緩衝區以及鎖定存取。
使用 metastat(1M) 指令來判斷子鏡像的名稱。
# metastat -s setname -p |
以類似 md.tab 檔的格式顯示狀態。
使用 metadetach(1M) 指令,使一個子鏡像從鏡像離線。
# metadetach -s setname mirror submirror |
讀取作業將從其它子鏡像持續進行。 不過,離線的子鏡像將在第一次寫入其它鏡像時失去同步。 這種不一致可在離線子鏡像重回線上時更正。 您不需要執行 fsck
使用 lockfs 指令以及 -u 選項解除檔案系統的鎖定以容許繼續寫入。
# lockfs -u mountpoint |
執行檔案系統檢查。
# fsck /dev/md/diskset/rdsk/submirror |
將離線子鏡像備份到磁帶或其它媒體。
請使用 ufsdump(1M) 指令或其它常用的備份公用程式。
# ufsdump 0ucf dump-device submirror |
請使用子鏡像的原始裝置 (/rdsk) 名稱,而不是區塊裝置 (/dsk) 名稱。
使用 metattach(1M) 指令將複合裝置重新設回線上狀態。
# metattach -s setname mirror submirror |
複合裝置進入線上狀態後,將自動和鏡像同步。
使用 metastat 指令來驗證子鏡像是否同步。
# metastat -s setname mirror |
在下列範例中,叢集節點 phys-schost-1 為 metaset schost-1 的所有者,因此備份程序是從 phys-schost-1 開始執行。 鏡像 /dev/md/schost-1/dsk/d0 是由 d10、d20 和 d30 等子鏡像所組成。
[Determine the owner of the metaset:] # metaset -s schost-1 Set name = schost-1, Set number = 1 Host Owner phys-schost-1 Yes ... [Lock the file system from writes:] # lockfs -w /global/schost-1 [List the submirrors:] # metastat -s schost-1 -p schost-1/d0 -m schost-1/d10 schost-1/d20 schost-1/d30 1 schost-1/d10 1 1 d4s0 schost-1/d20 1 1 d6s0 schost-1/d30 1 1 d8s0 [Take a submirror offline:] # metadetach -s schost-1 d0 d30 [Unlock the file system:] # lockfs -u / [Check the file system:] # fsck /dev/md/schost-1/rdsk/d30 [Copy the submirror to the backup device:] # ufsdump 0ucf /dev/rmt/0 /dev/md/schost-1/rdsk/d30 DUMP: Writing 63 Kilobyte records DUMP: Date of this level 0 dump: Tue Apr 25 16:15:51 2000 DUMP: Date of last level 0 dump: the epoch DUMP: Dumping /dev/md/schost-1/rdsk/d30 to /dev/rdsk/c1t9d0s0. ... DUMP: DUMP IS DONE [Bring the submirror back online:] # metattach -s schost-1 d0 d30 schost-1/d0: submirror schost-1/d30 is attached [Resync the submirror:] # metastat -s schost-1 d0 schost-1/d0: Mirror Submirror 0: schost-0/d10 State: Okay Submirror 1: schost-0/d20 State: Okay Submirror 2: schost-0/d30 State: Resyncing Resync in progress: 42% done Pass: 1 Read option: roundrobin (default) ... |
「VERITAS 容體管理者」將鏡像容體視為診測裝置。 備份診測裝置時不必先卸載,也不必將整個容體設成離線。 這是透過建立容體的快照副本以及備份這個暫時容體的方式來完成,不必關閉系統也不必拒絕使用者存取資料。
請先確定叢集執行時沒有任何錯誤,再執行備份程序。
登入叢集中任一個節點,同時在叢集上之磁碟群組的現行主要節點上成為超級使用者。
列出磁碟群組資訊。
# vxprint -g diskgroup |
執行 scstat(1M) 指令,檢查哪一個節點擁有目前匯入的磁碟群組,表示它就是磁碟群組的主要節點。
# scstat -D |
顯示所有磁碟裝置群組的狀態。
使用 vxassist(1M) 指令來建立容體的快照。
# vxassist -g diskgroup snapstart volume |
建立快照所需的時間視您容體的大小而定,有可能會很久。
確認已建立新的容體。
# vxprint -g diskgroup |
當快照完成時,Snapdone 的狀態會顯示在選定磁碟群組的 State 欄位中。
停止任何存取檔案系統的資料服務。
# scswitch -z -g resource-group -h "" |
停止資料服務,以確保資料檔案系統備份正常執行。 如果沒有任何資料服務正在執行,您便不需要執行 步驟 6 和 步驟 8。
建立名為 bkup-vol 的備份容體,並連接快照容體 (使用 vxassist 指令)。
# vxassist -g diskgroup snapshot volume bkup-vol |
重新啟動所有在 步驟 6 中停止的資料服務 (使用 scswitch 指令)。
# scswitch -z -g resource-group -h nodelist |
驗證連接到新容體 bkup-vol 的容體 (使用 vxprint 指令)。
# vxprint -g diskgroup |
註冊磁碟群組的配置變更。
# scconf -c -D name=diskgroup,sync |
使用 fsck 指令來檢查備份容體。
# fsck -y /dev/vx/rdsk/diskgroup/bkup-vol |
執行備份作業,將容體 bkup-vol 複製到磁帶或其它媒體。
請使用 ufsdump(1M) 指令或其它常用的備份公用程式。
# ufsdump 0ucf dump-device /dev/vx/dsk/diskgroup/bkup-vol |
使用 vxedit(1M) 來移除暫時容體。
# vxedit -rf rm bkup-vol |
使用 scconf 指令來註冊磁碟群組的配置變更。
# scconf -c -D name=diskgroup,sync |
在下列範例中,叢集節點 phys-schost-2 為 metaset 磁碟群組 schost-1 的主要所有者,因此備份程序從 phys-schost-2 開始執行。 複製 /vo101 容體並讓它和新容體 bkup-vol 關聯。
[Become superuser on the primary node.] [Identify the current primary node for the disk group:] # scstat -D -- Device Group Servers -- Device Group Primary Secondary ------------ ------- --------- Device group servers: rmt/1 - - Device group servers: schost-1 phys-schost-2 phys-schost-1 -- Device Group Status -- Device Group Status ------------ ------ Device group status: rmt/1 Offline Device group status: schost-1 Online [List the disk group information:] # vxprint -g schost-1 TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0 dg schost-1 schost-1 - - - - - - dm schost-101 c1t1d0s2 - 17678493 - - - - dm schost-102 c1t2d0s2 - 17678493 - - - - dm schost-103 c2t1d0s2 - 8378640 - - - - dm schost-104 c2t2d0s2 - 17678493 - - - - dm schost-105 c1t3d0s2 - 17678493 - - - - dm schost-106 c2t3d0s2 - 17678493 - - - - v vol01 gen ENABLED 204800 - ACTIVE - - pl vol01-01 vol01 ENABLED 208331 - ACTIVE - - sd schost-101-01 vol01-01 ENABLED 104139 0 - - - sd schost-102-01 vol01-01 ENABLED 104139 0 - - - pl vol01-02 vol01 ENABLED 208331 - ACTIVE - - sd schost-103-01 vol01-02 ENABLED 103680 0 - - - sd schost-104-01 vol01-02 ENABLED 104139 0 - - - pl vol01-03 vol01 ENABLED LOGONLY - ACTIVE - - sd schost-103-02 vol01-03 ENABLED 5 LOG - - - [Start the snapshot operation:] # vxassist -g schost-1 snapstart vol01 [Verify the new volume was created:] # vxprint -g schost-1 TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0 dg schost-1 schost-1 - - - - - - dm schost-101 c1t1d0s2 - 17678493 - - - - dm schost-102 c1t2d0s2 - 17678493 - - - - dm schost-103 c2t1d0s2 - 8378640 - - - - dm schost-104 c2t2d0s2 - 17678493 - - - - dm schost-105 c1t3d0s2 - 17678493 - - - - dm schost-106 c2t3d0s2 - 17678493 - - - - v vol01 gen ENABLED 204800 - ACTIVE - - pl vol01-01 vol01 ENABLED 208331 - ACTIVE - - sd schost-101-01 vol01-01 ENABLED 104139 0 - - - sd schost-102-01 vol01-01 ENABLED 104139 0 - - - pl vol01-02 vol01 ENABLED 208331 - ACTIVE - - sd schost-103-01 vol01-02 ENABLED 103680 0 - - - sd schost-104-01 vol01-02 ENABLED 104139 0 - - - pl vol01-03 vol01 ENABLED LOGONLY - ACTIVE - - sd schost-103-02 vol01-03 ENABLED 5 LOG - - - pl vol01-04 vol01 ENABLED 208331 - SNAPDONE - - sd schost-105-01 vol01-04 ENABLED 104139 0 - - - sd schost-106-01 vol01-04 ENABLED 104139 0 - - - [Stop data services, if necessary:] # scswitch -z -g nfs-rg -h "" [Create a copy of the volume:] # vxassist -g schost-1 snapshot vol01 bkup-vol [Restart data services, if necessary:] # scswitch -z -g nfs-rg -h phys-schost-1 [Verify bkup-vol was created:] # vxprint -g schost-1 TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0 dg schost-1 schost-1 - - - - - - dm schost-101 c1t1d0s2 - 17678493 - - - - ... v bkup-vol gen ENABLED 204800 - ACTIVE - - pl bkup-vol-01 bkup-vol ENABLED 208331 - ACTIVE - - sd schost-105-01 bkup-vol-01 ENABLED 104139 0 - - - sd schost-106-01 bkup-vol-01 ENABLED 104139 0 - - - v vol01 gen ENABLED 204800 - ACTIVE - - pl vol01-01 vol01 ENABLED 208331 - ACTIVE - - sd schost-101-01 vol01-01 ENABLED 104139 0 - - - sd schost-102-01 vol01-01 ENABLED 104139 0 - - - pl vol01-02 vol01 ENABLED 208331 - ACTIVE - - sd schost-103-01 vol01-02 ENABLED 103680 0 - - - sd schost-104-01 vol01-02 ENABLED 104139 0 - - - pl vol01-03 vol01 ENABLED LOGONLY - ACTIVE - - sd schost-103-02 vol01-03 ENABLED 5 LOG - - - [Synchronize the disk group with cluster framework:] # scconf -c -D name=schost-1,sync [Check the file systems:] # fsck -y /dev/vx/rdsk/schost-1/bkup-vol [Copy bkup-vol to the backup device:] # ufsdump 0ucf /dev/rmt/0 /dev/vx/rdsk/schost-1/bkup-vol DUMP: Writing 63 Kilobyte records DUMP: Date of this level 0 dump: Tue Apr 25 16:15:51 2000 DUMP: Date of last level 0 dump: the epoch DUMP: Dumping /dev/vx/dsk/schost-2/bkup-vol to /dev/rmt/0. ... DUMP: DUMP IS DONE [Remove the bkup-volume:] # vxedit -rf rm bkup-vol [Synchronize the disk group:] # scconf -c -D name=schost-1,sync |
fsrestore 指令可從使用 ufsdump 指令建立的備份,將檔案複製到磁碟 (相對於目前的工作目錄)。 您可以使用 ufsrestore,從層次 0 傾印以及之後的增量傾印重新載入檔案系統階層,或從任何傾印磁帶復原一個或多個單一檔案。 如果以超級使用者身份執行 ufsrestore,檔案將復原為原來的所有者、最後修改時間以及模式 (許可權)。
在開始復原檔案或檔案系統之前,您必須知道下列資訊。
您需要的磁帶
您要復原之檔案系統所在的原始裝置名稱
您要使用的磁帶機類型
磁帶機的裝置名稱 (本機或遠端)
任何故障磁碟的分割區機制,因為分割區與檔案系統必須完全複製到置換磁碟上
作業 |
如需相關說明,請參閱... |
---|---|
在 Sun Cluster,依 Solaris 復原程序以互動方式復原檔案。 | |
在 Sun Cluster,請復原 root(/)檔案系統。 | |
| |
在 Sun Cluster,請復原非密封的 root (/) 檔案系統。 | |
在 Sun Cluster,請復原密封的 root (/) 檔案系統。 |
請使用這個程序來復原一個或多個個別的檔案。 請先確定叢集執行時沒有任何錯誤,再執行復原程序。
請使用這個程序將將 root (/) 檔案系統復原到新磁碟,例如在更換損壞的根磁碟之後。要復原的節點不應該在啟動狀態。 請先確定叢集執行時沒有任何錯誤,再執行復原程序。
由於您必須將新磁碟分割成和故障磁碟相同的格式,請在進行本程序之前先識別分割區機制,同時適當地重新建立檔案系統。
在可存取 metaset 的叢集節點上,而不是您要復原的節點上,成為超級使用者。
從所有 metaset 中移除已復原的節點主機名稱。
從 metaset 中的節點執行這個指令,而不是從您正在移除的節點執行。
# metaset -s setname -f -d -h nodelist |
指定磁碟組名稱。
強制。
從磁碟組刪除。
指定要從磁碟組刪除之節點的名稱。
置換節點上要復原 root (/) 檔案系統的故障磁碟。
請參閱伺服器隨附文件中敘述的磁碟置換程序。
啟動正在復原的節點。
如果您使用 Solaris CD-ROM,請執行下列指令:
ok boot cdrom -s |
如果您使用 JumpStartTM 伺服器,請執行下列指令:
ok boot net -s |
使用 format(1M) 指令,在根磁碟上建立所有的分割區與交換區。
重新建立故障磁碟的原始分割機制。
建立適當的 root (/) 檔案系統和其它的檔案系統 (使用 newfs(1M) 指令)。
重新建立故障磁碟的原始檔案系統。
請務必要建立 /global/.devices/node@nodeid 檔案系統。
將 root(/)檔案系統裝載到暫時裝載點。
# mount device temp-mountpoint |
使用下列指令來復原根 (/) 檔案系統。
# cd temp-mountpoint # ufsrestore rvf dump-device # rm restoresymtable # cd / # umount temp-mountpoint # fsck raw-disk-device |
檔案系統現在完成復原。
在新磁碟上安裝新的啟動區塊。
# /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk raw-disk-device |
將節點重新啟動為單使用者模式。
# reboot -- "-s" |
使用 scdidadm 指令來置換磁碟 ID。
# scdidadm -R rootdisk |
使用 metadb(1M) 指令重新建立狀態資料庫複本。
# metadb -c copies -af raw-disk-device |
指定要建立的複本數目。
要在其上建立複本的原始磁碟裝置。
新增複本。
將節點重新啟動為叢集模式。
從復原的節點以外的叢集節點,使用 metaset(1M) 指令將復原的節點新增到所有 metaset。
phys-schost-2# metaset -s setname -a -h nodelist |
建立並新增主機到磁碟組。
節點重新啟動為叢集模式。 叢集已經備妥可以使用。
以下範例顯示 root (/) 檔案系統復原至節點 phys-schost-1 ( 從磁帶裝置 /dev/rmt/0)。metaset 指令是從叢集 phys-schost-2 的另一個節點執行,以便先移除而後將 phys-schost-1 節點重新加入 schost-1 磁碟組中。 所有其它指令是由 phys-schost-1 執行。 在 /dev/rdsk/c0t0d0s0 上建立新的啟動區塊,並在 /dev/rdsk/c0t0d0s4 上重新建立三個狀態資料庫的複本。
[Become superuser on a cluster node other than the node to be restored.] [Remove the node from the metaset:] phys-schost-2# metaset -s schost-1 -f -d -h phys-schost-1 [Replace the failed disk and boot the node:] ok boot cdrom -s [Use format and newfs to recreate partitions and file systems.] [Mount the root file system on a temporary mount point:] # mount /dev/dsk/c0t0d0s0 /a [Restore the root file system:] # cd /a # ufsrestore rvf /dev/rmt/0 # rm restoresymtable # cd / # umount /a # fsck /dev/rdsk/c0t0d0s0 [Install a new boot block:] # /usr/sbin/installboot /usr/platform/`uname \ -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0 [Reboot in single-user mode:] # reboot -- "-s" [Replace the disk ID:] # scdidadm -R /dev/dsk/c0t0d0 [Recreate state database replicas:] # metadb -c 3 -af /dev/rdsk/c0t0d0s4 # reboot Press CTL-d to boot into multiuser mode. [Add the node back to the metaset:] phys-schost-2# metaset -s schost-1 -a -h phys-schost-1 |
請使用這個程序來復原執行備份時在複合裝置上的 root (/) 檔案系統。 在根磁碟毀損而換成新磁碟等情況下執行這個程序。 要復原的節點不應該在啟動狀態。 請先確定叢集執行時沒有任何錯誤,再執行復原程序。
由於您必須將新磁碟分割成和故障磁碟相同的格式,請在進行本程序之前先識別分割區機制,同時適當地重新建立檔案系統。
在可存取 metaset 的叢集節點上,而不是您要復原的節點上,成為超級使用者。
從所有 metaset 中移除已復原的節點主機名稱。
# metaset -s setname -f -d -h nodelist |
指定 metaset 名稱。
強制。
從 metaset 刪除。
指定要從 metaset 刪除之節點的名稱。
置換節點上要復原 root (/) 檔案系統的故障磁碟。
請參閱伺服器隨附文件中敘述的磁碟置換程序。
啟動正在復原的節點。
如果您使用 Solaris CD-ROM,請執行下列指令:
ok boot cdrom -s |
如果您使用 JumpStart 伺服器,請執行下列指令:
ok boot net -s |
使用 format(1M) 指令,在根磁碟上建立所有的分割區與交換區。
重新建立故障磁碟的原始分割區機制。
建立適當的 root (/) 檔案系統以及其它檔案系統 (使用 newfs(1M) 指令)。
重新建立故障磁碟的原始檔案系統。
請務必要建立 /global/.devices/node@nodeid 檔案系統。
將 root(/)檔案系統裝載到暫時裝載點。
# mount device temp-mountpoint |
使用下列指令來復原 root (/) 檔案系統。
# cd temp-mountpoint # ufsrestore rvf dump-device # rm restoresymtable |
在新磁碟上安裝新的啟動區塊。
# /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk raw-disk-device |
移除在 /temp-mountpoint/etc/system 檔中 MDD 根資訊的行。
* Begin MDD root info (do not edit) forceload: misc/md_trans forceload: misc/md_raid forceload: misc/md_mirror forceload: misc/md_hotspares forceload: misc/md_stripe forceload: drv/pcipsy forceload: drv/glm forceload: drv/sd rootdev:/pseudo/md@0:0,10,blk * End MDD root info (do not edit) |
編輯 /temp-mount-point/etc/vfstab 檔,將在複合裝置部份的根磁碟上,用來作為每個檔案系統的根登錄從複合裝置變更為對應的一般片段。
Example: Change from- /dev/md/dsk/d10 /dev/md/rdsk/d10 / ufs 1 no - Change to- /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 /usr ufs 1 no - |
卸載暫時檔案系統,並檢查原始磁碟裝置。
# cd / # umount temp-mountpoint # fsck raw-disk-device |
將節點重新啟動為單使用者模式。
# reboot -- "-s" |
使用 scdidadm 指令來置換磁碟 ID。
# scdidadm -R rootdisk |
使用 metadb(1M) 指令重新建立狀態資料庫複本。
# metadb -c copies -af raw-disk-device |
指定要建立的複本數目。
在指名的原始磁碟裝置上建立初始狀態資料庫複本。
將節點重新啟動為叢集模式。
在復原的節點以外的叢集節點上,使用 metaset(1M) 指令將復原的節點新增到所有的 metaset。
phys-schost-2# metaset -s setname -a -h nodelist |
新增 (建立) metaset。
依照 Solstice DiskSuite 說明文件,設定 root (/) 的 metadevice/mirror 。
節點重新啟動為叢集模式。 叢集已經備妥可以使用。
以下範例顯示 root (/) 檔案系統復原至節點 phys-schost-1 (從磁帶裝置 /dev/rmt/0) 。metaset 指令是由叢集 phys-schost-2 的另一個節點執行,以便先移除而後將 phys-schost-1 節點重新加入 metaset schost-1 中。所有其它指令是由 phys-schost-1 執行。 在 /dev/rdsk/c0t0d0s0 上建立新的啟動區塊,並在 /dev/rdsk/c0t0d0s4 上重新建立三個狀態資料庫的複本。
[Become superuser on a cluster node with access to the metaset, other than the node to be restored.] [Remove the node from the metaset:] phys-schost-2# metaset -s schost-1 -f -d -h phys-schost-1 [Replace the failed disk and boot the node:] ok boot cdrom -s [Use format and newfs to recreate partitions and file systems.] [Mount the root file system on a temporary mount point:] # mount /dev/dsk/c0t0d0s0 /a [Restore the root file system:] # cd /a # ufsrestore rvf /dev/rmt/0 # rm restoresymtable [Install a new boot block:] # /usr/sbin/installboot /usr/platform/`uname \ -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0 [Remove the lines in /temp-mountpoint/etc/system file for MDD root information:] * Begin MDD root info (do not edit) forceload: misc/md_trans forceload: misc/md_raid forceload: misc/md_mirror forceload: misc/md_hotspares forceload: misc/md_stripe forceload: drv/pcipsy forceload: drv/glm forceload: drv/sd rootdev:/pseudo/md@0:0,10,blk * End MDD root info (do not edit) [Edit the /temp-mountpoint/etc/vfstab file] Example: Change from- /dev/md/dsk/d10 /dev/md/rdsk/d10 / ufs 1 no - Change to- /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 /usr ufs 1 no - [Unmount the temporary file system and check the raw disk device:] # cd / # umount /a # fsck /dev/rdsk/c0t0d0s0 [Reboot in single-user mode:] # reboot -- "-s" [Replace the disk ID:] # scdidadm -R /dev/dsk/c0t0d0 [Recreate state database replicas:] # metadb -c 3 -af /dev/rdsk/c0t0d0s4 # reboot Type CTRL-d to boot into multiuser mode. [Add the node back to the metaset:] phys-schost-2# metaset -s schost-1 -a -h phys-schost-1 |
請使用這個程序將非密封的 root (/) 檔案系統復原到節點。要復原的節點不應該在啟動狀態。 請先確定叢集執行時沒有任何錯誤,再執行復原程序。
由於您必須將新磁碟分割成和故障磁碟相同的格式,請在進行本程序之前先識別分割區機制,同時適當地重新建立檔案系統。
置換節點上要復原根檔案系統的故障磁碟。
請參閱伺服器隨附文件中敘述的磁碟置換程序。
啟動正在復原的節點。
如果您使用 Solaris CD-ROM,請執行下列指令:
ok boot cdrom -s |
如果您使用 JumpStart 伺服器,請執行下列指令:
ok boot net -s |
使用 format(1M) 指令,在根磁碟上建立所有的分割區與交換區。
重新建立故障磁碟的原始分割區機制。
建立適當的 root (/) 檔案系統和其它的檔案系統 (使用 newfs(1M) 指令)。
重新建立故障磁碟的原始檔案系統。
請務必要建立 /global/.devices/node@nodeid 檔案系統。
將 root(/)檔案系統裝載到暫時裝載點。
# mount device temp-mountpoint |
從備份復原 root (/) 檔案系統,同時卸載並檢查檔案系統。
# cd temp-mountpoint # ufsrestore rvf dump-device # rm restoresymtable # cd / # umount temp-mountpoint # fsck raw-disk-device |
檔案系統現在完成復原。
在新磁碟上安裝新的啟動區塊。
# /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk raw-disk-device |
將節點重新啟動為單使用者模式。
判斷根磁碟群組是否在根磁碟的單一片段上。
如果是,請建立並設定根磁碟群組。
# vxdctl init # vxdg init rootdg # vxdctl add disk diskslice type=simple # vxdisk -f init diskslice type=simple # vxdg adddisk diskslice # vxdctl enable |
如果不是,請跳到 步驟 10。
使用 scdidadm 指令更新磁碟 ID。
# scdidadm -R /dev/rdsk/disk-device |
按 CTRL-d 重新啟動為多使用者模式。
節點重新啟動為叢集模式。 叢集已經備妥可以使用。
以下範例顯示從磁帶裝置 /dev/rmt/0 復原至節點 phys-schost-1 的非密封 root (/) 檔案系統。
[Replace the failed disk and boot the node:] ok boot cdrom -s [Use format and newfs to create partitions and file systems] [Mount the root file system on a temporary mount point:] # mount /dev/dsk/c0t0d0s0 /a [Restore the root file system:] # cd /a # ufsrestore rvf /dev/rmt/0 # rm restoresymtable # cd / # umount /a # fsck /dev/rdsk/c0t0d0s0 [Install a new boot block:] # /usr/sbin/installboot /usr/platform/`uname \ -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0 [Reboot in single-user mode:] # reboot -- "-s" [If the root disk group is on a single slice on the root disk, create the new root disk group:] # vxdctl init # vxdg init rootdg # vxdctl add disk c0t0d0s4 type=simple # vxdisk -f init c0t0d0s4 type=simple # vxdg adddisk c0t0d0s4 # vxdctl enable [Update the disk ID:] # scdidadm -R /dev/rdsk/c0t0d0 [Press CTRL-d to resume in multiuser mode] |
使用這個程序將密封的 root (/) 檔案系統復原到節點。要復原的節點不應該在啟動狀態。 請先確定叢集執行時沒有任何錯誤,再執行復原程序。
由於您必須將新磁碟分割成和故障磁碟相同的格式,請在進行本程序之前先識別分割區機制,同時適當地重新建立檔案系統。
置換節點上要復原根檔案系統的故障磁碟。
請參閱伺服器隨附文件中敘述的磁碟置換程序。
啟動正在復原的節點。
如果您使用 Solaris CD-ROM,請執行下列指令:
ok boot cdrom -s |
如果您使用 JumpStart 伺服器,請執行下列指令:
ok boot net -s |
使用 format(1M) 指令,在根磁碟上建立所有的分割區與交換區。
重新建立故障磁碟的原始分割區機制。
建立適當的 root (/) 檔案系統和其它的檔案系統 (使用 newfs(1M) 指令)。
重新建立故障磁碟的原始檔案系統。
請務必要建立 /global/.devices/node@nodeid 檔案系統。
將 root (/) 檔案系統裝載到暫時裝載點。
# mount device temp-mountpoint |
從備份復原 root (/) 檔案系統。
# cd temp-mountpoint # ufsrestore rvf dump-device # rm restoresymtable |
建立空的 install-db 檔。
如此將使節點在下次重新啟動時進入 VxVM 安裝模式。
# touch /temp-mountpoint/etc/vx/reconfig.d/state.d/install-db |
從 /temp-mountpoint/etc/system 檔案移除下列指令或為指令下註解。
* rootdev:/pseudo/vxio@0:0 * set vxio:vol_rootdev_is_volume=1 |
編輯 /temp-mountpoint/etc/vfstab 檔,並將所有的 VxVM 裝載點換成根磁碟的標準磁碟裝置,例如 /dev/dsk/c0t0d0s0。
Example: Change from- /dev/vx/dsk/rootdg/rootvol /dev/md/rdsk/rootdg/rootvol / ufs 1 no - Change to- /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no - |
卸載暫時檔案系統,並檢查檔案系統。
# cd / # umount temp-mountpoint # fsck raw-disk-device |
在新磁碟上安裝啟動區塊。
# /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk raw-disk-device |
將節點重新啟動為單使用者模式。
# reboot -- "-s" |
使用 scdidadm(1M) 來更新磁碟 ID。
# scdidadm -R /dev/rdsk/c0t0d0 |
執行 vxinstall 以密封磁碟並重新啟動。
# vxinstall |
如果有某個次要號碼和其它系統衝突,請卸載整體裝置並重新指定磁碟群組。
卸載叢集節點上的整體裝置檔案系統。
# umount /global/.devices/node@nodeid |
重新指定叢集節點上的 rootdg 磁碟群組。
# vxdg reminor rootdg 100 |
在叢集模式下關閉,並重新啟動節點。
# shutdown -g0 -i6 -y |
以下範例顯示密封 root (/) 檔案系統復原至節點 phys-schost-1 (從磁帶裝置 /dev/rmt/0) 。
[Replace the failed disk and boot the node:] ok boot cdrom -s [Use format and newfs to create partitions and file systems] [Mount the root file system on a temporary mount point:] # mount /dev/dsk/c0t0d0s0 /a [Restore the root file system:] # cd /a # ufsrestore rvf /dev/rmt/0 # rm restoresymtable [Create an empty install-db file:] # touch /a/etc/vx/reconfig.d/state.d/install-db [Edit /etc/system on the temporary file system and remove or comment out the following entries:] # rootdev:/pseudo/vxio@0:0 # set vxio:vol_rootdev_is_volume=1 [Edit /etc/vfstab on the temporary file system:] Example: Change from- /dev/vx/dsk/rootdg/rootvol /dev/md/rdsk/rootdg/rootvol / ufs 1 no- Change to- /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no - [Unmount the temporary file system, then check the file system:] # cd / # umount /a # fsck /dev/rdsk/c0t0d0s0 [Install a new boot block:] # /usr/sbin/installboot /usr/platform/`uname \ -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0 [Reboot in single-user mode:] # reboot -- "-s" [Update the disk ID:] # scdidadm -R /dev/rdsk/c0t0d0 [Run vxinstall:] # vxinstall Choose to encapsulate the root disk. [If there is a conflict in minor number, reminor the rootdg disk group:] # umount /global/.devices/node@nodeid # vxdg reminor rootdg 100 # shutdown -g0 -i6 -y |
有關如何鏡像密封的根磁碟的指示,請參閱 Sun Cluster 3.0 12/01 軟體安裝手冊。復原叢集檔案