下列範例顯示在節點 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 m ount mount #to mount to fsck point type pass a t boot options # /dev/md/dsk/d1 /dev/md/rdsk/d1 /usr ufs 2 n o global (Reboot the node) # scswitch -S -h phys-schost-1 # shutdown -g0 -y -i6 (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 |