對硬盤分區時應分出一個大概128M的分區供metadb使用,最佳使用s7分區。
用root用戶登陸,運行以下命令:
#prtvtoc /dev/rdsk/c1t0d0s2|fmthard –s – /dev/rdsk/c1t1d0s2
fmthard:New volume table of contents now in place
上面命令將第二塊硬盤(c1t1d0)的文件分區表調整為和引導盤一致。
一、RAID1
對各個分區逐一作鏡像:
①先生成replicas,這是svm內部用的。創建狀態數據庫。
#metadb –a –f –c 3 c1t0d0s7 c1t1d0s7
#metadb
cp /etc/vfstab /etc/vfstab.old
2 、創建/(root)系統鏡象
#metainit –f d10 1 1 c1t0d0s0
#metainit d20 1 1 c1t1d0s0
#metainit d0 –m d10
#metaroot d0
此命令自動更新/etc/vfstab文件
#lockfs –fa 此過程一定要做否則可能出錯
#reboot
Creating a mirror from swap
#metainit –f d11 1 1 c1t0d0s1
#metainit d21 1 1 c1t1d0s1
#metainit d1 –m d11
#vi /etc/vfstab
/dev/dsk/c1t0d0s1 - - swap – no –
should be changed to:
/dev/md/dsk/d1 - - swap – no -
③Creating a mirror from /usr
#metainit –f d13 1 1 c1t0d0s3
#metainit d23 1 1 c1t1d0s3
#metainit d3 –m d13
#vi /etc/vfstab
/dev/dsk/c1t0d0s3 /dev/rdsk/c1t0d0s3 /usr ufs 1 yes –
should be changed to:
/dev/md/dsk/d3 /dev/md/rdsk/d3 /usr ufs 1 yes –
④Creating a mirror from /opt
#metainit –f d14 1 1 c1t0d0s4
#metainit d24 1 1 c1t1d0s4
#metainit d4 –m d14
#vi /etc/vfstab
/dev/dsk/c1t0d0s4 /dev/rdsk/c1t0d0s4 /opt ufs 1 yes –
should be changed to:
/dev/md/dsk/d4 /dev/md/rdsk/d4 /opt ufs 1 yes –
⑤Creating a mirror from /var
#metainit –f d15 1 1 c1t0d0s5
#metainit d25 1 1 c1t1d0s5
#metainit d5 –m d15
#vi /etc/vfstab
/dev/dsk/c1t0d0s5 /dev/rdsk/c1t0d0s5 /var ufs 1 yes –
should be changed to:
/dev/md/dsk/d5 /dev/md/rdsk/d5 /var ufs 1 yes –
⑥Creating a mirror from /home
#metainit –f d16 1 1 c1t0d0s6
#metainit d26 1 1 c1t1t0s6
#metainit d6 –m d16
#vi /etc/vfstab
/dev/dsk/c1t0d0s6 /dev/rdsk/c1t0d0s6 /home ufs 1 yes –
should be changed to:
/dev/md/dsk/d6 /dev/md/rdsk/d6 /home ufs 1 yes –
#dumpadm -d /dev/md/dsk/d1
#reboot
#metattach d0 d20
#metattach d1 d21
#metattach d3 d23
#metattach d4 d24
#metattach d5 d25
#metattach d6 d26
installboot /usr/platform/`uname -
m`/lib/fs/ufs/bootblk /dev/rdsk/c1t1d0s0
#metastat |grep %(檢查鏡像進度)