在操作系统安装结束后
安装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
以上步骤执行时间较长
| steellyz 回复于:2004-06-02 10:05:45 |
| 以上是raid1的做法。其实我本人只会做raid1,现在想把raid0,raid1+0,raid5等贴综合一下,方便我等新手学习借鉴。
哪些大侠有相关资料,跟一下贴,把做法贴上来吧。 谢谢! |
| nimysun 回复于:2004-06-02 10:17:47 |
| 好,我就搞个
raid 0 +1 metainit d1 1 3 c0t1d0s0 c0t2d0s0 c0t3d0s0 metainit d2 1 3 c0t4d0s0 c0t5d0s0 c0t6d0s0 # metainit d0 -m d1 # metattach d0 d2 raid 1 +0 metainit d1 3 1 c0t1d0s0 1 c0t2d0s0 1 c0t3d0s0 metainit d2 3 1 c0t4d0s0 1 c0t5d0s0 1 c0t6d0s0 # metainit d0 -m d1 # metattach d0 d2 raid 5比较简单 # metainit d0 -r 1 6 c0t1d0s0 1 c0t2d0s0 1 c0t3d0s0 c0t4d0s0 1 c0t5d0s0 1 c0t6d0s0 |
| steellyz 回复于:2004-06-02 10:28:14 |
| Stripe
This example shows a metadevice, /dev/md/dsk/d15, consisting of two slices. # metainit d15 1 2 c0t1d0s2 c0t2d0s2 -i 32k The number 1 indicates that one stripe is being created. Because the stripe is made of two slices, the number 2 fol- lows next. The optional -i followed by 32k specifies the interlace size as 32 Kbytes. If the interlace size were not specified, the stripe would use the default value of 16 Kbytes. 本楼文章来自man metainit.试译如下: 条带(raid 0) 这个例子显示了由两个分区组成的raid0硬盘设备: /dev/md/dsk/d15。 命令是:metainit d15 1 2 c0t1d0s2 c0t2d0s2 -i 32k 数字1表示一个条带区被创建。数字2表示这个条带由两个磁盘分区组成。 选项-i和紧跟的32k,表示条带在磁盘上使用时是以32k为单位。不加此选项则系统会使用缺省的16k为单位。 |
| zl520xx 回复于:2004-06-02 10:31:07 |
| 谢谢,支持!!!!! |
| yuansonghui 回复于:2004-06-02 10:34:27 |
| up |
| steellyz 回复于:2004-06-02 10:34:56 |
| 以前我在制作raid1 时,为了整齐划一,曾想第一个分区用d00,其组成是d01和d02,第二个分区是d10,其组成是d11和d12,以此类推,实际做不成。
原来, solaris的raid设备标识是由d0 ,d1 ,d2…………d126,d127组成的。没有一个设备名是d00,所以做不成。:-) 但是d01 是可用的。它就是d1。 这段是凭印象写的。如不对,请大侠指正,以免误事。 |
| sunmarmot 回复于:2004-06-02 10:51:34 |
| 你们就干脆再写些维护算了,例如:盘坏了怎么更换,偶比较懒........搬把凳子看你们写.hohohohoh~~~~~~~~~~ |
| sunmarmot 回复于:2004-06-02 10:56:37 |
| 斑竹这就设精了!%#!@#%@#!%$#^$%&,地球人都知道怎么做RAID,要知道怎么维护RAID 0+1 和RAID 5才可以的 :emn30: |
| steellyz 回复于:2004-06-02 11:00:26 |
| [quote:1c89bdde5c="sunmarmot"]你们就干脆再写些维护算了,例如:盘坏了怎么更换,偶比较懒........搬把凳子看你们写.hohohohoh~~~~~~~~~~[/quote:1c89bdde5c]
第一个贴里有相关内容。 另外,是否设精与我无关。 我只是喜欢在这里学习和交流。 |
| sunmarmot 回复于:2004-06-02 11:12:14 |
| 当然啦,关于斑竹为什么会设精和你是一点关系也没有的。
RAID 1+0和RAID 1 RAID 5的维护是8一样的。所以,你们还是写全了比较好,方便你自己也方便别人咯 |
| steellyz 回复于:2004-06-02 11:33:35 |
| 老兄,麻烦你贴上来吧。
我是真的不知道而十分想知道。:-) |
| bear 回复于:2004-06-02 11:46:53 |
| 顶楼的步骤怎么像我1年多以前贴过的............. |
| steellyz 回复于:2004-06-02 12:00:51 |
| 有可能。
这个贴的内容是神州数码工作师在今年元月份给我们安装服务器时给我的。 |
| x3y4z5 回复于:2004-06-02 12:45:15 |
| best to post the mantain of vxvm volume. |
| nimysun 回复于:2004-06-02 14:01:03 |
| 最好不要打击楼主的积极性。
只要斑竹把好关就行了。 |
| xiaorui15 回复于:2004-06-02 18:33:38 |
| 天啊,,跪拜啊,,,救命的文张啊 |
| sunmarmot 回复于:2004-06-03 10:29:56 |
| [quote:83e5c440af="nimysun"]好,我就搞个
raid 0 +1 metainit d1 1 3 c0t1d0s0 c0t2d0s0 c0t3d0s0 metainit d2 1 3 c0t4d0s0 c0t5d0s0 c0t6d0s0 # metainit d0 -m d1 # metattach d0 d2 raid 1 +0 metainit d1 3 1 c0t1d0s0 1 c0t2d0s..........[/quote:83e5c440af] 你做RAID 5的方法是错误的,自己改一下 |
| ORA-600 回复于:2004-06-03 10:34:24 |
| 手册上说conca/stripe的maintenance状态无法修复,因为没有replicas,看下面的错误
bash-2.03# metastat -s storage storage/d0: Mirror Submirror 0: storage/d10 State: Needs maintenance Submirror 1: storage/d20 State: Needs maintenance Pass: 1 Read option: roundrobin (default) Write option: parallel (default) Size: 142239915 blocks storage/d10: Submirror of storage/d0 State: Needs maintenance Invoke: metareplace storage/d0 c1t1d0s0 <new device> Size: 142239915 blocks Stripe 0: (interlace: 32 blocks) Device Start Block Dbase State Hot Spare c1t0d0s0 0 No Okay c1t1d0s0 0 No Maintenance storage/d20: Submirror of storage/d0 State: Needs maintenance Invoke: after replacing "Maintenance" components: metareplace storage/d0 c1t9d0s0 <new device> Size: 142239915 blocks Stripe 0: (interlace: 32 blocks) Device Start Block Dbase State Hot Spare c1t8d0s0 0 No Okay c1t9d0s0 0 No Last Erred 这是不是就要从backup里还原数据,重建raid 0+1了? |
| x3y4z5 回复于:2004-06-03 10:50:13 |
| Two submirror all need mainten. Maybe you can first replace the error disk then use metareplace command to resync the disk.If failed,I think the only way is to rebulid the mirror and backup data from tape. |
| 韦小宝 回复于:2004-06-03 11:06:47 |
| SDS做的0+1实际上是1+0,系统做自动转换的,没有真正意义上的0+1 |
| ORA-600 回复于:2004-06-03 11:25:46 |
| 如果就这样metareplace的话,是会造成数据丢失得吧,虽然系统这么显示,但是关机然后开机,diskset依然可以使用,可以mount,fsck d10 d20 d0都没有问题,里面得数据也都是好得!不知道,怎么回事,先停掉数据库,冷备份先! |
| handsun 回复于:2004-06-03 14:12:23 |
| ok |
| roger0409 回复于:2004-06-03 17:10:32 |
| 不错 |