Sun Cluster 系統管理指南(適用於 Solaris 作業系統)

復原叢集檔案

ufsrestore(1M) 指令從使用 ufsdump(1M) 指令建立的備份將檔案複製到與目前工作目錄相關的磁碟中。您可以使用 ufsrestore,從層次 0 傾印以及之後的增量傾印重新載入檔案系統階層,或從任何傾印磁帶復原一個或多個單一檔案。如果以超級使用者身份或等效角色執行 ufsrestore,則檔案將復原為原來的所有者、上一次修改時間及模式 (權限)。

在開始復原檔案或檔案系統之前,您必須知道下列資訊。

表 11–2 對應作業:復原叢集檔案

作業 

操作說明 

至於 Solaris Volume Manager,會以互動的方式復原檔案 

如何以互動方式復原個別的檔案 (Solaris Volume Manager)

針對 Solaris Volume Manager,復原 root (/) 檔案系統

如何復原根 (/) 檔案系統 (Solaris Volume Manager)

  

如何復原 Solstice DiskSuite 元式裝置上或 Solaris Volume Manager 磁碟區上的根 (/) 檔案系統

對於 VERITAS Volume Manager,請復原非封裝的根 (/) 檔案系統

SPARC: 如何復原非封裝的根 (/) 檔案系統 (VERITAS Volume Manager)

對於 VERITAS Volume Manager,請復原封裝的根 (/) 檔案系統

SPARC: 如何復原封裝的根 (/) 檔案系統 (VERITAS Volume Manager)

Procedure如何以互動方式復原個別的檔案 (Solaris Volume Manager)

使用此程序復原一個或多個個別檔案。請先確定叢集執行時沒有任何錯誤,再執行復原程序。

  1. 成為超級使用者,或在您正在復原的叢集節點上成為提供 solaris.cluster.admin RBAC 授權的角色

  2. 停止所有使用要儲存之檔案的資料服務。


    # clresourcegroup offline 資源群組
    
  3. 復原檔案。


    # ufsrestore
    

Procedure如何復原根 (/) 檔案系統 (Solaris Volume Manager)

使用此程序將根 (/) 檔案系統復原至新的磁碟,如替代故障根磁碟後。要復原的節點應該不在啟動狀態。請先確定叢集執行時沒有任何錯誤,再執行復原程序。


備註 –

由於您必須使用與故障磁碟相同的格式分割新磁碟,因此請在開始此程序前識別分割方案,然後相應地重新建立檔案系統。


此程序提供長形式的 Sun Cluster 指令。大多指令也有短的形式。除了指令名稱有長形式和短形式之分外,指令本身是相同的。如需指令及其短形式的清單,請參閱附錄 ASun Cluster 以物件為導向的指令

  1. 成為超級使用者,或成為在可存取磁碟組的叢集節點上提供 solaris.cluster.modify RBAC 授權的角色。(要復原的節點也會連結到這個磁碟組。)

    使用您正在復原的節點以外 的節點。

  2. 從所有中介集合移除要復原的節點的主機名稱。

    從 metaset 中的節點執行這個指令,而不是從您正在移除的節點執行。由於回復的節點目前為離線,因此系統會顯示 RPC: Rpcbind failure - RPC: Timed out 錯誤。忽略此錯誤並繼續下一個步驟。


    # metaset -s setname -f -d -h nodelist
    
    -s setname

    指定磁碟組名稱。

    -f

    從磁碟組刪除最後一個主機。

    -d

    從磁碟組刪除。

    -h nodelist

    指定要從磁碟組刪除之節點的名稱。

  3. 復原 root (/) 和 /usr 檔案系統。

    若要復原根 (root) 和 /usr 檔案系統,請按照「System Administration Guide: Devices and File Systems 」中的第 26 章「Restoring Files and File Systems (Tasks)」的程序進行。忽略 Solaris 作業系統程序中的步驟以重新啟動系統。


    備註 –

    確定您有建立 /global/.devices/node@nodeid 檔案系統。


  4. 以多使用者模式重新啟動節點。


    # reboot
    
  5. 更換磁碟 ID。


    # cldevice repair root 磁碟
    
  6. 使用 metadb(1M) 指令重新建立狀態資料庫複本。


    # metadb -c copies -af raw-disk-device
    
    -c copies

    指定要建立的複本數目。

    -f raw-disk-device

    要在其上建立複本的原始裝置。

    -a

    新增複本。

  7. 從已復原的節點以外的叢集節點,將已復原的節點增加至所有磁碟組。


    phys-schost-2# metaset -s setname -a -h nodelist
    
    -a

    建立並增加主機至磁碟組。

    節點重新啟動為叢集模式。叢集已經備妥可以使用。


範例 11–6 復原根(/) 檔案系統 (Solaris Volume Manager)

以下範例顯示 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 上重新建立三個狀態資料庫的複本。


[在要復原的節點以外的叢集節點上成為超級使用者,或成為提供 solaris.cluster.modify RBAC 授權的角色
.]
[從中介集合移除節點:]
phys-schost-2# metaset -s schost-1 -f -d -h phys-schost-1
[更換故障的磁碟並啟動節點:]
使用 Solaris 系統管理文件中的程序來復原 (/) 和 /usr 檔案系統
 [重新開機:]
# reboot
[更換磁碟 ID:]
# cldevice repair /dev/dsk/c0t0d0
[Re-create state database replicas:]
# metadb -c 3 -af /dev/rdsk/c0t0d0s4
[將節點新增回中介集合:]
phys-schost-2# metaset -s schost-1 -a -h phys-schost-1

Procedure如何復原 Solstice DiskSuite 元式裝置上或 Solaris Volume Manager 磁碟區上的根 (/) 檔案系統

執行備份時,使用此程序復原 Solstice DiskSuite 中介裝置上或 Solaris Volume Manager 磁碟區上的根 (/) 檔案系統。在根磁碟毀損而換成新磁碟等情況下執行這個程序。要復原的節點應該不在啟動狀態。請先確定叢集執行時沒有任何錯誤,再執行復原程序。


備註 –

由於您必須使用與故障磁碟相同的格式分割新磁碟,因此請在開始此程序前識別分割方案,然後相應地重新建立檔案系統。


此程序提供長形式的 Sun Cluster 指令。大多指令也有短的形式。除了指令名稱有長形式和短形式之分外,指令本身是相同的。如需指令及其短形式的清單,請參閱附錄 ASun Cluster 以物件為導向的指令

  1. 在可存取磁碟組的叢集節點 (除了您復原的節點以外) 上,成為超級使用者,或成為提供 solaris.cluster.modifiy RBAC 授權的角色。

    使用您正在復原的節點以外 的節點。

  2. 從所有磁碟組移除要復原的節點的主機名稱。


    # metaset -s setname -f -d -h nodelist
    
    -s setname

    指定 metaset 名稱。

    -f

    從磁碟組刪除最後一個主機。

    -d

    從 metaset 刪除。

    -h nodelist

    指定要從 metaset 刪除之節點的名稱。

  3. 置換節點上要復原 root (/) 檔案系統的故障磁碟。

    請參閱隨附伺服器之文件中敘述的磁碟置換程序。

  4. 啟動您要復原的節點。

    • 如果您使用的是 Solaris 作業系統 CD,請注意以下事項:

      • SPARC:鍵入:


        ok boot cdrom -s
        
      • x86:將 CD 插入系統的 CD 光碟機中,並透過關閉系統之後再開啟系統來啟動系統。在 [Current Boot Parameters] (目前啟動參數) 畫面上,鍵入 bi


                             <<< Current Boot Parameters >>>
        Boot path: /pci@0,0/pci8086,2545@3/pci8086,1460@1d/pci8086,341a@
        7,1/sd@0,0:a
        Boot args:
        
        Type b [file-name] [boot-flags] <ENTER> to boot with options
        or   i <ENTER>                          to enter boot interpreter
        or   <ENTER>                            to boot with defaults
        
                         <<< timeout in 5 seconds >>>
        Select (b)oot or (i)nterpreter: b -s
        
    • 如果您使用的是 Solaris JumpStartTM 伺服器,請注意以下事項:

      • SPARC:鍵入:


        ok boot net -s
        
      • x86:將 CD 插入系統的 CD 光碟機中,並透過關閉系統之後再開啟系統來啟動系統。在 [Current Boot Parameters] (目前啟動參數) 畫面上,鍵入 bi


                             <<< Current Boot Parameters >>>
        Boot path: /pci@0,0/pci8086,2545@3/pci8086,1460@1d/pci8086,341a@
        7,1/sd@0,0:a
        Boot args:
        
        Type b [file-name] [boot-flags] <ENTER> to boot with options
        or   i <ENTER>                          to enter boot interpreter
        or   <ENTER>                            to boot with defaults
        
                         <<< timeout in 5 seconds >>>
        Select (b)oot or (i)nterpreter: b -s
        
  5. 使用 format 指令,在根磁碟上建立所有的分割區與交換空間。

    重新建立故障磁碟的原始分割機制。

  6. 使用 newfs 指令,適當建立根 (/) 檔案系統以及其他檔案系統

    重新建立故障磁碟的原始檔案系統。


    備註 –

    確定您有建立 /global/.devices/node@nodeid 檔案系統。


  7. 將 root (/) 檔案系統裝載到暫時裝載點。


    # mount device temp-mountpoint
    
  8. 使用下列指令復原根 (/) 檔案系統。


    # cd temp-mountpoint
    # ufsrestore rvf dump-device
    # rm restoresymtable
    
  9. 在新磁碟上安裝新的啟動區塊。


    # /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk 
    raw-disk-device
    
  10. 移除在 /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)
  11. 編輯 /temp-mountpoint/etc/vfstab 檔案,以將根項目從 Solstice DiskSuite 元式裝置或 Solaris Volume Manager 磁碟區變更為針對屬於該元式裝置或磁碟區的根磁碟上每個檔案系統的相應一般片段。


    Example: 
    Change from—
    /dev/md/dsk/d10   /dev/md/rdsk/d10    /      ufs   1     no       -
    
    Change to—
    /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0  /      ufs   1     no       -
  12. 卸載暫時檔案系統,並檢查原始磁碟裝置。


    # cd /
    # umount temp-mountpoint
    # fsck raw-disk-device
    
  13. 以多使用者模式重新啟動節點。


    # reboot
    
  14. 更換磁碟 ID。


    # cldevice repair root 磁碟
    
  15. 使用 metadb 指令重新建立狀態資料庫副本。


    # metadb -c copies -af raw-disk-device
    
    -c copies

    指定要建立的複本數目。

    -af raw-disk-device

    在指名的原始磁碟裝置上建立初始狀態資料庫複本。

  16. 從已復原的節點以外的叢集節點,將已復原的節點新增至所有磁碟組。


    phys-schost-2# metaset -s setname -a -h nodelist
    
    -a

    新增 (建立) metaset。

    依照 Solstice DiskSuite 文件,為根 (/) 設置中介裝置或磁碟區/鏡像。

    節點重新啟動為叢集模式。叢集已經備妥可以使用。


範例 11–7 復原 Solstice DiskSuite 中介裝置或 Solaris Volume Manager 磁碟區上的根 (/) 檔案系統

以下範例顯示 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 上重新建立三個狀態資料庫的複本。


[在可存取中介集合的叢集節點上 (除了要復原的節點以外) 成為超級使用者,或成為提供 solaris.cluster.modify RBAC 授權的角色.]
[從中介集合移除節點:]
phys-schost-2# metaset -s schost-1 -f -d -h phys-schost-1
[更換故障的磁碟並啟動節點:]

從 Solaris 作業系統 CD 啟動節點︰


[Use format and newfs to re-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
[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:]
# reboot
[Replace the disk ID:]
# cldevice repair /dev/rdsk/c0t0d0
[Re-create state database replicas:]
# metadb -c 3 -af /dev/rdsk/c0t0d0s4
[Add the node back to the metaset:]
phys-schost-2# metaset -s schost-1 -a -h phys-schost-1

ProcedureSPARC: 如何復原非封裝的根 (/) 檔案系統 (VERITAS Volume Manager)

使用此程序將非封裝的根 (/) 檔案系統復原至節點。要復原的節點應該不在啟動狀態。請先確定叢集執行時沒有任何錯誤,再執行復原程序。


備註 –

由於您必須使用與故障磁碟相同的格式分割新磁碟,因此請在開始此程序前識別分割方案,然後相應地重新建立檔案系統。


此程序提供長形式的 Sun Cluster 指令。大多指令也有短的形式。除了指令名稱有長形式和短形式之分外,指令本身是相同的。如需指令及其短形式的清單,請參閱附錄 ASun Cluster 以物件為導向的指令

  1. 替代節點上要復原根檔案系統的故障磁碟。

    請參閱隨附伺服器之文件中敘述的磁碟置換程序。

  2. 啟動您要復原的節點。

    • 如果您使用的是 Solaris 作業系統 CD,請在 OpenBoot PROM ok 提示符號下,鍵入以下指令:


      ok boot cdrom -s
      
    • 如果您使用的是 Solaris JumpStart 伺服器,在出現 OpenBoot PROM ok 提示符號時,請鍵入以下指令︰


      ok boot net -s
      
  3. 使用 format 指令,在根磁碟上建立所有分割區與交換空間。

    重新建立故障磁碟的原始分割機制。

  4. 使用 newfs 指令,適當建立根 (/) 檔案系統以及其他檔案系統。

    重新建立故障磁碟的原始檔案系統。


    備註 –

    確定您有建立 /global/.devices/node@nodeid 檔案系統。


  5. 將 root (/) 檔案系統裝載到暫時裝載點。


    # mount device temp-mountpoint
    
  6. 從備份復原 root (/) 檔案系統,同時卸載並檢查檔案系統。


    # cd temp-mountpoint
    # ufsrestore rvf dump-device
    # rm restoresymtable
    # cd /
    # umount temp-mountpoint
    # fsck raw-disk-device
    

    檔案系統現在完成復原。

  7. 在新磁碟上安裝新的啟動區塊。


    # /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk raw-disk-device
    
  8. 以多使用者模式重新啟動節點。


    # reboot
    
  9. 更新磁碟 ID。


    # cldevice repair /dev/rdsk/磁碟裝置
    
  10. 按下 Ctrl-d 重新啟動為多重使用者模式。

    節點將重新啟動為叢集模式。叢集已經備妥可以使用。


範例 11–8 SPARC: 復原非封裝的根 (/) 檔案系統 (VERITAS Volume Manager)

以下範例顯示從磁帶裝置 /dev/rmt/0 復原至節點 phys-schost-1 的非封裝根 (/) 檔案系統。


[替換發生故障的磁碟並啟動節點:]

從 Solaris 作業系統 CD 啟動節點︰出現 OpenBoot PROM ok 提示符號時,請鍵入以下指令︰


ok boot cdrom -s
...
[使用 format  newfs 來建立分割區和檔案系統]
[將根檔案系統掛載到一個暫存掛載點:]
# mount /dev/dsk/c0t0d0s0 /a
[復原根檔案系統:]
# cd /a
# ufsrestore rvf /dev/rmt/0
# rm restoresymtable
# cd /
# umount /a
# fsck /dev/rdsk/c0t0d0s0
[安裝新的啟動區塊:]
# /usr/sbin/installboot /usr/platform/`uname \
-i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0

[重新開機:]
# reboot
[更新磁碟 ID:]
# cldevice repair /dev/rdsk/c0t0d0

ProcedureSPARC: 如何復原封裝的根 (/) 檔案系統 (VERITAS Volume Manager)

使用此程序將封裝的根 (/) 檔案系統復原至節點。要復原的節點應該不在啟動狀態。請先確定叢集執行時沒有任何錯誤,再執行復原程序。


備註 –

由於您必須使用與故障磁碟相同的格式分割新磁碟,因此請在開始此程序前識別分割方案,然後相應地重新建立檔案系統。


此程序提供長形式的 Sun Cluster 指令。大多指令也有短的形式。除了指令名稱有長形式和短形式之分外,指令本身是相同的。如需指令及其短形式的清單,請參閱附錄 ASun Cluster 以物件為導向的指令

  1. 替代節點上要復原根檔案系統的故障磁碟。

    請參閱隨附伺服器之文件中敘述的磁碟置換程序。

  2. 啟動您要復原的節點。

    • 如果您使用的是 Solaris 作業系統 CD,請在 OpenBoot PROM ok 提示符號下,鍵入以下指令:


      ok boot cdrom -s
      
    • 如果您使用的是 Solaris JumpStart 伺服器,在出現 OpenBoot PROM ok 提示符號時,請鍵入以下指令︰


      ok boot net -s
      
  3. 使用 format 指令,在根磁碟上建立所有的分割區與交換空間。

    重新建立故障磁碟的原始分割機制。

  4. 使用 newfs 指令,適當建立根 (/) 檔案系統以及其他檔案系統。

    重新建立故障磁碟的原始檔案系統。


    備註 –

    確定您要建立 /global/.devices/node@nodeid 檔案系統。


  5. 將 root (/) 檔案系統裝載到暫時裝載點。


    # mount device temp-mountpoint
    
  6. 從備份復原 root (/) 檔案系統。


    # cd temp-mountpoint
    # ufsrestore rvf dump-device
    # rm restoresymtable
    
  7. 建立空的 install-db 檔。

    此檔案將使節點在下次重新啟動時進入 VxVM 安裝模式。


    # touch \
    /temp-mountpoint/etc/vx/reconfig.d/state.d/install-db
    
  8. / temp-mountpoint/etc/system 檔案中移除以下條目。


    * rootdev:/pseudo/vxio@0:0
    * set vxio:vol_rootdev_is_volume=1
  9. 編輯 /temp-mountpoint /etc/vfstab 檔案,並使用根磁碟的標準磁碟裝置替代所有 VxVM 掛載點,例如 /dev/dsk/c0t0d0s0


    Example: 
    Change from—
    /dev/vx/dsk/rootdg/rootvol /dev/vx/rdsk/rootdg/rootvol /      ufs   1     no -
    
    Change to—
    /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0  / ufs   1     no       -
  10. 卸載暫時檔案系統,並檢查檔案系統。


    # cd /
    # umount temp-mountpoint
    # fsck raw-disk-device
    
  11. 在新磁碟上安裝啟動區塊。


    # /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk raw-disk-device
    
  12. 以多使用者模式重新啟動節點。


    # reboot
    
  13. 使用 scdidadm(1M) 更新磁碟 ID。


    # cldevice repair /dev/rdsk/c0t0d0
    
  14. 執行 vxinstall 指令以封裝磁碟並重新開機。

  15. 如果有某個次要編號和其他系統發生衝突,請卸載全域裝置並重新指定磁碟群組。

    • 卸載叢集節點上的全域裝置檔案系統。


      # umount /global/.devices/node@nodeid
      
    • 重新指定叢集節點上的 rootdg 磁碟群組的次要編號。


      # vxdg reminor rootdg 100
      
  16. 在叢集模式下關閉,並重新啟動節點。


    # shutdown -g0 -i6 -y
    

範例 11–9 SPARC: 復原封裝的根 (/) 檔案系統 (VERITAS Volume Manager)

以下範例顯示封裝的 root (/) 檔案系統復原至節點 phys-schost-1 (從磁帶裝置 /dev/rmt/0)。


[替換發生故障的磁碟並啟動節點:]

從 Solaris 作業系統 CD 啟動節點︰出現 OpenBoot PROM ok 提示符號時,請鍵入以下指令︰


ok boot cdrom -s
...
[使用 format  newfs 建立分割區和檔案系統]
[將根檔案系統掛載到一個暫存的掛載點:]
# mount /dev/dsk/c0t0d0s0 /a
[復原根檔案系統:]
# cd /a
# ufsrestore rvf /dev/rmt/0
# rm restoresymtable
[建立空 install-db 檔案:]
# touch /a/etc/vx/reconfig.d/state.d/install-db
[編輯暫存檔案系統上的 /etc/system 並移除以下項目或在項目前加上 # 號:]
	# rootdev:/pseudo/vxio@0:0
	# set vxio:vol_rootdev_is_volume=1
[編輯暫存檔案系統上的 /etc/vfstab:]
Example: 
Change from—
/dev/vx/dsk/rootdg/rootvol /dev/vx/rdsk/rootdg/rootvol / ufs 1 no-

Change to—
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0  / ufs   1     no       -
[卸載暫存檔案系統,然後檢查檔案系統:]
# cd /
# umount /a
# fsck /dev/rdsk/c0t0d0s0
[安裝新的啟動區塊:]
# /usr/sbin/installboot /usr/platform/`uname \
-i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0

[重新開機:]
# reboot
[更新磁碟 ID:]
# cldevice repair /dev/rdsk/c0t0d0
[封裝磁碟::]
# vxinstall
Choose to encapsulate the root disk.
[如果鏡像數目發生衝突,請對 rootdg 磁碟群組使用 reminor 指令
:]
# umount /global/.devices/node@nodeid
# vxdg reminor rootdg 100
# shutdown -g0 -i6 -y

另請參閱

如需有關如何鏡像封裝的根磁碟之說明,請參閱「Sun Cluster 軟體安裝指南 (適用於 Solaris 作業系統)」