作業 |
相關資訊,請進到 ... |
---|---|
尋找您要備份的檔案系統的名稱。 | |
計算完整備份所需的磁帶數。 | |
備份 root 檔案系統 | |
執行鏡映或診測檔案系統的線上備份。 | |
請使用這個程序來判斷您要備份之檔案系統的名稱。
顯示 /etc/vfstab 檔的內容。
您不必是超級使用者(superuser)才能夠指定這個指令。
% 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 - |
請使用這個程序來計算您備份檔案系統時所需的磁帶數。
在您要備份之叢集節點上成為超級使用者(superuser)。
以位元組預估備份大小。
# ufsdump S filesystem |
顯示執行備份時的預計位元組數。
指定您要備份之檔案系統的名稱。
將預估大小除以磁帶容量來求出所需的磁帶數。
在以下範例中,905,881,620 位元組的檔案系統可以輕易地放入 4 GB 磁帶(905,881,620 / 4,000,000,000)。
# ufsdump S /global/phys-schost-1 905881620 |
請使用這個程序來備份叢集節點的 root(/)檔案系統。請先確定叢集執行沒有任何錯誤再執行備份程序。
在您要備份之叢集節點上成為超級使用者(superuser)。
將要備份之節點的資料服務切換到叢集中的其他節點。
# scswitch -z -D disk-device-group -h node |
執行切換。
磁碟裝置群組的名稱,和磁碟組或磁碟群組名稱相同。
當作磁碟裝置群組主要節點的叢集節點的名稱。
停止節點。
# shutdown -g0 -y |
在 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 指令即將執行之前有程式寫入資料到容體,將可能發生問題。要避免這個問題,請先暫時停止這個節點上執行的所有服務。另外,請先確認叢集執行沒有任何錯誤再執行備份程序。
在您要備份之叢集節點上成為超級使用者(superuser)。
使用 metaset(1M) 指令來判斷哪一個節點擁有已備份容體的所有權。
# metaset -s setname |
指定磁碟組名稱。
使用 lockfs(1M) 指令以及 -w 選項來使檔案系統進入防寫的鎖定狀態。
# lockfs -w mount-point |
只有在 UFS 檔案系統常駐在鏡映上時,才需要鎖定檔案系統。例如,如果中繼裝置設成資料庫管理軟體或其他特定應用程式的原始裝置,則不需要使用 lockfs 指令。不過,您可能要執行適當的廠商相關公用程式來重設任何緩衝區以及鎖定存取。
使用 metastat(1M) 指令來判斷子鏡映的名稱。
# metastat -s setname -p |
以和 md.tab 檔相似的格式顯示狀態。
使用 metadetach(1M) 指令來使一個子鏡映從鏡映離線。
# metadetach -s setname mirror submirror |
讀取作業將從其他子鏡映持續進行。 不過,離線的子鏡映將在第一次寫入其他鏡映時失去同步。這種不一致可在離線子鏡映重回線上時更正。您不需要執行 fsck。
使用 lockfs 指令以及 -u 選項解除檔案系統的鎖定以容許繼續寫入。
# lockfs -u mount-point |
執行檔案系統檢查。
# fsck /dev/md/diskset/rdsk/submirror |
將離線子鏡映備份到磁帶或其他媒體。
請使用 ufsdump(1M) 指令或其他常用的備份公用程式。
請使用子鏡映的原始裝置(/rdsk)名稱,而不是區塊裝置(/dsk)名稱。
# ufsdump 0ucf dump-device submirror |
使用 metattach(1M) 指令將中繼裝置重新設回線上狀態。
# metattach -s setname mirror submirror |
中繼裝置進入線上狀態後,將自動和鏡映同步。
使用 metastat 指令來驗證子鏡映是否同步。
# metastat -s setname mirror |
在以下範例中,叢集節點 phys-schost-1 是中繼組 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 容體管理者將鏡映容體識別為診測裝置(plex)。備份診測裝置時不必先卸載,也不必將整個容體設成離線。這是透過建容體的快照副本以及備份這個暫時容體的方式來完成,不必關閉系統也不必拒絕使用者存取資料。
請先確定叢集執行沒有任何錯誤再執行備份程序。
登入叢集中任一個節點,同時在叢集上之磁碟群組的現行主要節點成為超級使用者(superuser)。
列出磁碟群組資訊。
# vxprint -g diskgroup |
執行 scstat(1M) 以檢查哪一個節點擁有目前匯入的磁碟群組,表示它就是磁碟群組的主要節點。
# scstat -D |
顯示所有磁碟裝置群組的狀態。
使用 vxassist(1M) 指令來建立容體的快照。
# vxassist -g diskgroup snapstart volume |
視您容體大小而定,建立快照可能需要一段長時間。
使用 vxprint(1M) 指令確認新建的容體。
# vxprint -g diskgroup |
當快照完成時,Snapdone的狀態會顯示在選取之磁碟群組的 State 欄位中。
使用 scswitch(1M) 停止任何存取檔案系統的資料服務。
# scswitch -z -g nfs-rg -h "" |
建議您停止資料服務以確保資料檔案系統備份正常執行。如果沒有任何資料服務正在執行,則您不需要執行 步驟 6 與 步驟 8。
使用 vxassist 指令建立名為 bkup-vol 的備份容體並將快照容體貼附到其中。
# vxassist -g diskgroup snapshot volume bkup-vol |
使用 scswitch 指令重新啟動您在 步驟 6 停止的資料服務。
# scswitch -z -g nfs-rg -h nodename |
使用 vxprint 指令驗證容體現在已經貼附到新容體 bkup-vol。
# vxprint -g diskgroup |
使用 scconf(1M) 指令來登錄磁碟群組配置變更。
# 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=disk-group,sync |
在以下範例中,叢集節點 phys-schost-2 是中繼組磁碟群組 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 - - - - 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 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 |