Sun Cluster 3.0 安裝手冊

若檔案系統無法卸載時,要如何鏡映

使用此程序可以鏡映無法在正常系統使用期間卸載的檔案系統,如 /usr/optswap

  1. 成為叢集中某個節點的高階使用者。

  2. 將不可卸載的檔案系統所在的片段,放置於單片段(單向)接合。


    # metainit -f submirror1 1 1 disk-slice
    
  3. 建立第二接合。


    # metainit -f submirror2 1 1 submirror-disk-slice
    
  4. 建立一個具有子鏡映的單向鏡映。


    註解 -

    鏡映的 metadevice 名稱在叢集中 not 需要是唯一的。



    # metainit mirror -m submirror1
    
  5. 對於要鏡映的所有無法卸載的檔案系統,重複 步驟 1步驟 4

  6. 在每一個節點上,編輯您鏡映的所有無法卸載的檔案系統 /etc/vfstab 的檔案登錄。

    以鏡映名稱取代 device mount 中的名稱和 device fsck 一欄。


    # vi /etc/vfstab
    #device        device          mount           FS      fsck    mount   mount
    #to mount      to fsck         point           type    pass    at boot options
    #
    /dev/md/dsk/mirror /dev/md/rdsk/mirror /file-system  ufs     2       no      global
  7. 從節點撤出所有的資源群組或裝置群組。


    # scswitch -S -h node
    
    -S

    撤出全部的資源群組和裝置群組

    -h node

    指定要撤出資源或裝置群組的節點名稱

  8. 重新啟動節點。


    # shutdown -g 0 -y -i 6
    
  9. 連接鏡映及第二個子鏡映。

    此連接會啟動子鏡映的同步作業。


    # metattach mirror submirror2
    
  10. 等待鏡映的同步作業(在 步驟 9 中啟動)完成。

    使用 metastat(1M) 指令檢視鏡映狀態。


    # metastat mirror
    
  11. 如果用來鏡映無法卸載檔案系統的磁碟,實際連接至一個以上的節點 (多埠連接),請啟用用來鏡映無法卸載檔案系統之磁碟的原始磁碟裝置群組的 localonly 屬性。

    您必須啟用 localonly 屬性,在啟動裝置連接多個節點時,可以避免在無意中將節點與其啟動裝置隔離。

    1. 必要時,使用 scdidadm -L 指令,顯示原始磁碟裝置群組的完整裝置 ID (DID) 虛擬驅動程式名稱。

      在下列範例中,原始磁碟裝置群組名稱 dsk/d2 是輸出第三欄 (完整 DID 虛擬驅動程式名稱) 的一部份。


      # scdidadm -L
      ...
      1            phys-schost-3:/dev/rdsk/c1t1d0    /dev/did/rdsk/d2
      # scconf -c -D name=dsk/d2,localonly=true
      

      有關 localonly 屬性的其他資訊,請參照 scconf_dg_rawdisk(1M) 線上援助頁。

    2. 使用 scconf(1M) 指令啟用 localonly 屬性。


      # scconf -c -D name=rawdisk_groupname,localonly=true
      
      -D name=rawdisk_groupname

      指定原始磁碟裝置群組的名稱

範例-鏡映無法卸載的檔案系統

下列範例顯示在節點 d1 phys-schost-1 建立鏡映,以便鏡映 /usr,這是位於 c0t0d0s1 上。鏡映 d1 包含分割區 c0t0d0s1 上的子鏡映 d11 和分割區 c2t2d0s1 上的 子鏡映 d21/usr/etc/vfstab 檔案登錄會更新為使用鏡映名稱 d1。 磁碟 c2t2d0 是多埠連接的磁碟,所以啟用 localonly 屬性。


(Create the mirror:)
# metainit -f d11 1 1 c0t0d0s1
d11: Concat/Stripe is setup
# metainit -f d21 1 1 c2t2d0s1
d21: Concat/Stripe is setup
# metainit d1 -m d11
d1: Mirror is setup
 
(Edit the /etc/vfstab file:)
# vi /etc/vfstab
#device        device          mount           FS      fsck    mount   mount
#to mount      to fsck         point           type    pass    at boot options
#
/dev/md/dsk/d1 /dev/md/rdsk/d1 /usr            ufs     2       no      global
 
(Reboot the node:)
# scswitch -S -h phys-schost-1
# shutdown -g 0 -y -i 6
 
(Attach the second submirror:)
# metattach d1 d21
d1: Submirror d21 is attached
 
(View the sync status:)
# metastat d1
d1: Mirror
      Submirror 0: d11
         State: Okay
      Submirror 1: d21
         State: Resyncing
      Resync in progress: 15 % done
...
 
(Identify the DID name of the mirrored disk's raw disk device group:)
# scdidadm -L
...
1         phys-schost-3:/dev/rdsk/c2t2d0     /dev/did/rdsk/d2
 
(Enable the localonly property of the mirrored disk's raw disk device group:)
# scconf -c -D name=dsk/d2,localonly=true

下一步

若要鏡映使用者定義的檔案系統,請至 "如何鏡映使用者定義的檔案系統"。若要建立磁碟組,請至 "如何建立磁碟組"