歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux綜合 >> Linux資訊 >> 更多Linux

Unix應用技巧:solaris raid 制作大集合

 在操作系統安裝結束後
  安裝DiskSuite_4.2.1軟件及相關補丁
  以下以實力的方式介紹“引導盤鏡像操作”
  例子中操作系統分區定義如下:
  c0t0d0s0 /
  c0t0d0s1 swap
  c0t0d0s3 /var
  c0t0d0s4 (metaDB*3)
  c0t0d0s5 /opt
  c0t0d0s6 /usr
  c0t0d0s7 /eXPort/home
  用root用戶登陸
  運行以下命令:
  # prtvtoc /dev/rdsk/c0t0d0s2 > boot-vtoc.tab
  # fmthard -s boot-vtoc.tab /dev/rdsk/c0t1d0s2
  以上命令將第2硬盤的文件分區表調整為和引導盤一致
  運行以下命令:
  # metadb -afc 3 c0t0d0s4
  # metadb -afc 3 c0t1d0s4
  # metainit -f d21 1 1 c0t0d0s0
  # metainit d22 1 1 c0t1d0s0
  # metainit -f d24 1 1 c0t0d0s1
  # metainit d25 1 1 c0t1d0s1
  # metainit -f d27 1 1 c0t0d0s3
  # metainit d28 1 1 c0t1d0s3
  # metainit -f d31 1 1 c0t0d0s5
  # metainit d32 1 1 c0t1d0s5
  # metainit -f d34 1 1 c0t0d0s6
  # metainit d35 1 1 c0t1d0s6
  # metainit -f d37 1 1 c0t0d0s7
  # metainit d38 1 1 c0t1d0s7
  
  # metainit d20 -m d21
  # metainit d23 -m d24
  # metainit d26 -m d27
  # metainit d30 -m d31
  # metainit d33 -m d34
  # metainit d36 -m d37
  
  # metaroot d20
  # lockfs -fa
  
  修改/etc/vfstab文件為如下:
  
  #device device mount FS fsck mount mount
  #to mount to fsck point type pass at boot options
  #
  #/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes -
  fd - /dev/fd fd - no -
  /proc - /proc proc - no -
  
  #/dev/dsk/c0t0d0s3 - - swap - no -
  /dev/md/dsk/d26 - - swap - no -
  
  #/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no -
  /dev/md/dsk/d20 /dev/md/rdsk/d20 / ufs 1 no -
  
  #/dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /usr ufs 1 no -
  /dev/md/dsk/d33 /dev/md/rdsk/d33 /usr ufs 1 no -
  
  #/dev/dsk/c0t0d0s1 /dev/rdsk/c0t0d0s1 /var ufs 1 no -
  /dev/md/dsk/d23 /dev/md/rdsk/d23 /var ufs 1 no -
  
  #/dev/dsk/c0t0d0s7 /dev/rdsk/c0t0d0s7 /export/home ufs 2 yes -
  /dev/md/dsk/d36 /dev/md/rdsk/d36 /export/home ufs 2 yes -
  
  #/dev/dsk/c0t0d0s5 /dev/rdsk/c0t0d0s5 /opt ufs 2 yes -
  /dev/md/dsk/d30 /dev/md/rdsk/d30 /opt ufs 2 yes -
  
  swap - /tmp tmpfs - yes -
  
  至此,引導盤鏡像操作的第一步完成
  
  運行以下命令重新引導操作系統
  
  # sync
  # sync
  # sync
  # reboot
  
  做數據同步
  # metattach d20 d22
  # metattach d23 d25
  # metattach d26 d28
  # metattach d30 d32
  # metattach d33 d35
  # metattach d36 d38
  以上步驟執行時間較長
  
  
  主引導盤損壞的恢復(主引導盤為c0t0d0)
  刪除損壞的replicas
  # metadb -i #查看狀態



  # metadb -d c0t0d0s4 #刪除replicas
  停機,換盤
  # sync
  # sync
  # init 5
  
  從備用盤引導系統(使用Stop+A 使系統進入ok狀態)
  ok boot disk1
  設置新盤分區
  # prtvtoc /dev/rdsk/c0t1d0s2 > boot-vtoc.tab
  # fmthard -f boot-vtoc.tab /dev/rdsk/c0t0d0s2
  再創建replicas
  # metadb -afc 3 c0t0d0s4
  重連接新設備到主mirror,並同步
  # metareplace -e d20 c0t0d0s0
  d20: device c0t0d0s0 is enabled
  # metareplace -e d23 c0t0d0s1
  d20: device c0t0d0s1 is enabled
  # metareplace -e d26 c0t0d0s3
  d20: device c0t0d0s3 is enabled
  # metareplace -e d30 c0t0d0s5
  d20: device c0t0d0s5 is enabled
  # metareplace -e d33 c0t0d0s6
  d20: device c0t0d0s6 is enabled
  # metareplace -e d36 c0t0d0s7
  d20: device c0t0d0s7 is enabled



Copyright © Linux教程網 All Rights Reserved