Sun Cluster 3.0 系統管理手冊

8.3.4 如何復原非密封的 root(/)檔案系統(VERITAS 容體管理者)

請使用這個程序來復原非密封的 root(/)檔案系統到節點。要復原的節點應該不在啟動狀態。請先確定叢集執行沒任何錯誤再執行復原程序。


註解 -

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


  1. 置換節點上要復原 root 檔案系統的失效磁碟。

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

  2. 啟動正在復原的啟動。

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


      ok boot cdrom -s
      

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


      ok boot net -s
      

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

    重新建立失效磁碟的原始分割機制。

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

    重新建立失效磁碟的原始檔案系統。


    註解 -

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


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


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


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

    檔案系統現在完成復原。

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


    # /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk raw-disk-device
    
  8. 將節點重新開機為單用戶模式。

    1. 啟動重新開機。


      # reboot -- "-s"

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


      Type control-d to proceed with normal startup,
      (or give root password for system maintenance):
    2. 輸入root 密碼。

  9. 判斷根磁碟是否在根磁碟的一個單一片段上。

    • 如果是,請建立並設置根磁碟群組:


      # vxdctl init
      # vxdg init rootdg
      # vxdctl add disk diskslice type=simple
      # vxdisk -f init diskslice type=simple
      # vxdg adddisk diskslice
      # vxdctl enable
      
    • 如果沒有,請進到 步驟 10

  10. 使用 scdidadm 指令更新磁碟 ID。


    # scdidadm -R /dev/rdsk/diskdevice
  11. 按 CTRL-d 重新啟動為多用戶模式。

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

8.3.4.1 範例-復原非密封的 root(/)檔案系統(VERITAS 容體管理者)

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


[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]