Sun Cluster 軟體安裝指南 (適用於 Solaris 作業系統)

如何鏡像無法卸載的檔案系統

使用此程序來鏡像無法卸載的使用者定義檔案系統。 在此程序中,節點不需要重新啟動。

  1. 成為叢集上某個節點的超級使用者。

  2. 卸載要鏡像的檔案系統。

    確保該檔案系統上沒有執行任何程序。


    # umount /mount-point
    

    請參閱 umount(1M) 線上援助頁和System Administration Guide: Basic Administration中的「Mounting and Unmounting File Systems」,以取得詳細資訊。

  3. 將可卸載之使用者定義檔案系統所在的片段放置於單一片段 (單向) 串接。

    指定磁碟片段的實體磁碟名稱 (cNtXdYsZ)。


    # metainit -f submirror1 1 1 diskslice
    

  4. 建立第二個串接。


    # metainit submirror2 1 1 submirror-diskslice
    

  5. 建立只含一個子鏡像的單向鏡像。


    # metainit mirror -m submirror1
    


    註解 –

    此鏡像的複合裝置或容體名稱在叢集中需要具有唯一性。


  6. 對於要鏡像的所有可裝載的檔案系統,重複步驟 1步驟 5

  7. 在每一個節點上,編輯您鏡像的每一個檔案系統的 /etc/vfstab 檔案項目。

    使用鏡像名稱替代 device to mountdevice to 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 /filesystem ufs 2 no global

  8. 連接第二子鏡像至鏡像。

    這個連接動作會啟動子鏡像的同步作業。


    # metattach mirror submirror2
    

  9. 等待步驟 8 中開始的鏡像同步作業完成。

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


    # metastat mirror
    

  10. 用來鏡像使用者定義檔案系統的磁碟是否實際連接到一個以上的節點 (多埠連接)?

    • 如果不是,請繼續至步驟 12

    • 如果是,請執行下列步驟,以便為用於鏡像使用者定義檔案系統的磁碟啟用原始磁碟裝置群組的 localonly 屬性。 如果某個節點的開機裝置連接至多個節點,您必須啟用 localonly 屬性,以避免不小心將節點與其開機裝置隔離開。

    1. 必要時,請使用 scdidadm -L 指令來顯示原始磁碟裝置群組的完整裝置 ID 路徑名稱。

      在下列範例中,原始磁碟裝置群組名稱 dsk/d4 是輸出第三欄 (完整裝置 ID 路徑名稱) 的一部分。


      # scdidadm -L
      …
      1         phys-schost-3:/dev/rdsk/c1t1d0     /dev/did/rdsk/d2
      

    2. 檢視原始磁碟裝置群組的節點清單。

      輸出結果如下所示。


      # scconf -pvv | grep dsk/d2
      Device group name:						dsk/d2
      …
        (dsk/d2) Device group node list:		phys-schost-1, phys-schost-3
      …

    3. 節點清單是否含有一個以上的節點名稱?

    4. 除了對其根磁碟進行鏡像的節點之外,將此原始磁碟裝置群組節點清單中的其他節點全部移除。

      唯有已經進行根磁碟鏡像的節點才應該保留在節點清單內。


      # scconf -r -D name=dsk/dN,nodelist=node
      
      -D name=dsk/dN

      指定原始磁碟裝置群組的叢集唯一名稱

      nodelist=node

      指定要從節點清單移除的節點名稱

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

      localonly 屬性啟用後,原始磁碟裝置群組便專門供其節點清單內的節點使用。 當開機裝置連接到多個節點時,這樣做可避免不小心將節點與其開機裝置隔離開。


      # scconf -c -D name=rawdisk-groupname,localonly=true
      
      -D name=rawdisk-groupname

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

      關於 localonly 屬性的詳細資訊,請參閱 scconf_dg_rawdisk(1M) 線上援助頁。

  11. 裝載鏡像的檔案系統。


    # mount /mount-point
    

    請參閱 mount(1M) 線上援助頁和System Administration Guide: Basic Administration中的「Mounting and Unmounting File Systems」,以取得詳細資訊。

  12. 建立磁碟組。

    移至如何建立磁碟組

範例 — 鏡像可卸載的檔案系統

下列範例顯示 d4 的建立,以鏡像 /export,這是位於 c0t0d0s4d4 鏡像是由分割區 c0t0d0s4 上的子鏡像 d14 和分割區 c2t2d0s4 上的子鏡像 d24 所組成。 /export/etc/vfstab 檔案項目會更新為使用鏡像名稱 d4。 磁碟 c2t2d0 是多埠連接的磁碟,所以啟用 localonly 屬性。


(Unmount the file system)
# umount /export
 
(Create the mirror)
# metainit -f d14 1 1 c0t0d0s4
d14: Concat/Stripe is setup
# metainit d24 1 1 c2t2d0s4
d24: Concat/Stripe is setup
# metainit d4 -m d14
d4: 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/d4 /dev/md/rdsk/d4 /export ufs 2 no	global
 
(Attach the second submirror)
# metattach d4 d24
d4: Submirror d24 is attached
 
(View the sync status)
# metastat d4
d4: Mirror
      Submirror 0: d14
         State: Okay
      Submirror 1: d24
         State: Resyncing
      Resync in progress: 15 % done
…
 
(Identify the device-ID name of the mirrored disk's raw-disk device group)
# scdidadm -L
…
1         phys-schost-3:/dev/rdsk/c2t2d0     /dev/did/rdsk/d2
 
(Display the device-group node list)
# scconf -pvv | grep dsk/d2
Device group name:						dsk/d2
…
  (dsk/d2) Device group node list:		phys-schost-1, phys-schost-3
…
 
(Remove phys-schost-3 from the node list)
# scconf -r -D name=dsk/d2,nodelist=phys-schost-3
 
(Enable the localonly property)
# scconf -c -D name=dsk/d2,localonly=true
 
(Mount the file system)
# mount /export