Sun Cluster 3.0 U1 系統管理手冊

8.3.3 如何復原複合裝置的根 (/)檔案系統 (Solstice DiskSuite)

請使用這個程序來復原執行備份時在複合裝置上的根 (/) 檔案系統。並在根磁碟毀壞而換成新磁碟等的情況執行這個程序。要復原的節點應該不在啟動狀態。請先確定叢集執行時沒任何錯誤,再執行復原程序。


註解 -

由於您必須將新磁碟的分割區製作成和故障磁碟完全相同的格式,請在開始本程序之前先識別分割機制,同時適當地重新建立檔案系統。


  1. 在可存取 metaset 的叢集節點上,而不是您要復原的節點上,成為超級使用者。

  2. 從所有 metasets 中移除已復原的節點主機名稱。


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

    -s setname

    指定 metaset 名稱。

    -f

    強迫。

    -d

    從 metaset 刪除。

    -h nodelist

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

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

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

  4. 啟動正在復原的節點。

    • 如果您使用 Solaris CD-ROM,請執行下列指令:


      ok boot cdrom -s
      

    • 如果您使用 JumpStart 伺服器,請執行下列指令:


      ok boot net -s
      

  5. 使用 format(1M) 指令,在根磁碟上建立所有的分割區與交換。

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

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

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


    註解 -

    請務必要建立 /global/.devices/node@nodeid 檔案系統。


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


    # mount device temp-mount-point
    

  8. 使用下列指令來復原根 (/) 檔案系統。


    # cd  temp-mount-point
    # ufsrestore rvf dump-device
    # rm restoresymtable
    

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


    # /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblkraw-disk-device
    

  10. 移除 /temp-mount-point/etc/system 檔中與 MDD root 資訊相關的行。


    * 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-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       -

  12. 卸載暫時檔案系統,並檢查原始磁碟裝置。


    # cd /
    # umount  temp-mount-point
    # fsck raw-disk-device
    

  13. 將節點重新開機為單使用者模式。


    # reboot -- '-s'
    

  14. 使用 scdidadm 指令置換磁碟 ID。


    # scdidadm -R rootdisk
    

  15. 使用 metadb(1M) 指令重新建立狀態資料庫複本。


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

    -c copies

    指定要建立的複本數目。

    -af raw-disk-device

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

  16. 將節點重新啟動為叢集模式。

    1. 啟動重新開機。


      # reboot
      

      啟動將會看到錯誤或警告訊息,結尾部份附有以下的指示:


      Type control-d to proceed with normal startup,
      (or give root password for system maintenance):

    2. 按 CTRL-d 重新開機為多使用者模式。

  17. 在復原的節點以外的叢集節點上,使用 metaset(1M) 指令將復原的節點新增至所有 metaset。


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

    -a

    新增 (建立) metaset。

    依照 Solstice DiskSuite 說明文件,將 metadevice/mirror 設成 root (/)。

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

8.3.3.1 範例 - 復原複合裝置上舊有的根 (/) 檔案系統 (Solstice DiskSuite)

以下範例顯示密封根 (/) 檔案系統從磁帶裝置 /dev/rmt/0 復原至節點 phys-schost-1metaset 指令是由叢集 phys-schost-2 另一節點執行,以便先移除而後將 phys-schost-1 節點重新加入 schost-1 metaset 中。所有其他指令是由 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-mount-point/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-mount-point/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