免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1320 | 回复: 0
打印 上一主题 下一主题

3320磁盘阵列,裸设备的使用 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-03 10:52 |只看该作者 |倒序浏览
两台机器SUN 445(4块72G硬盘),接一台3320磁盘阵列,磁盘阵列做成Raid 5之后,划分出2个LUN,对应format中的4和5。
两台机器名。分别为center-1 和center-2,center-1 机器安装sybase,并起sybase服务;机器center-2安装其他应用程序。给磁盘阵列划分软分区的时候,让两台机器,都可以使用(当然只能一台在线使用)。方法如下:
# format  查看机器的硬盘
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c1t0d0
          /pci@1f,700000/scsi@2/sd@0,0
       1. c1t1d0
          /pci@1f,700000/scsi@2/sd@1,0
       2. c1t2d0
          /pci@1f,700000/scsi@2/sd@2,0
       3. c1t3d0
          /pci@1f,700000/scsi@2/sd@3,0
       4. c2t0d0
          /pci@1d,700000/scsi@2/sd@0,0
       5. c2t0d1
          /pci@1d,700000/scsi@2/sd@0,1
center-1# metadb -a -f -c 3 c1t0d0s7 c1t2d0s7   在2块磁盘的系统上创建状态数据库
center-1# metadb                                查看metadb信息
center-1# metaset -s sybase_data -M -a -h center-1 center-2  创建多属主磁盘集sybase_data
center-1# metaset -s sybase_data -a /dev/rdsk/c2t0d0  将共享磁盘/dev/rdsk/c2t0d0添加到磁盘集sybase_data
center-1# metaset -s sybase_data -a /dev/rdsk/c2t0d1  将共享磁盘/dev/rdsk/c2t0d1添加到磁盘集sybase_data
center-1# metaset -s sybase_data     查看磁盘集sybase_data的属性
           
下面开始创建软分区,在任意一个节点都可以:
center-1# metainit -s sybase_data d30 1 1 /dev/rdsk/c2t0d0  初始化/dev/rdsk/c2t0d0为metadevice
center-1# metainit -s sybase_data d40 1 1 /dev/rdsk/c2t0d1  初始化/dev/rdsk/c2t0d1为metadevice
center-1# metainit -s sybase_data d51 -p d30 32g
center-1# metainit -s sybase_data d52 -p d30 32g
center-1# metainit -s sybase_data d53 -p d30 32g
center-1# metainit -s sybase_data d54 -p d30 32g
center-1# metainit -s sybase_data d55 -p d30 5g
center-1# metainit -s sybase_data d56 -p d30 5g
center-1# metainit -s sybase_data d57 -p d30 5g
center-1# metainit -s sybase_data d58 -p d30 5g
center-1# metainit -s sybase_data d59 -p d30 32g
center-1# metainit -s sybase_data d60 -p d30 32g
center-1# metainit -s sybase_data d61 -p d30 32g
center-1# metainit -s sybase_data d62 -p d30 32g
center-1# metainit -s sybase_data d63 -p d30 2g
center-1# metainit -s sybase_data d64 -p d30 2g
center-1# metainit -s sybase_data d65 -p d30 32g
center-1# metainit -s sybase_data d66 -p d30 32g
center-1# metainit -s sybase_data d67 -p d30 32g
center-1# metainit -s sybase_data d68 -p d30 32g
center-1# metainit -s sybase_data d69 -p d30 32g
center-1# metainit -s sybase_data d70 -p d30 32g
还有一部分剩余空间,作为以后扩展
最d40进行软分区:
center-1# metainit -s sybase_data d91 -p d40 32g
center-1# metainit -s sybase_data d92 -p d40 32g
center-1# metainit -s sybase_data d93 -p d40 32g
center-1# metainit -s sybase_data d94 -p d40 32g
center-1# metainit -s sybase_data d95 -p d40 32g
center-1# metainit -s sybase_data d96 -p d40 32g
center-1# metainit -s sybase_data d97 -p d40 32g
center-1# metainit -s sybase_data d98 -p d40 32g

center-1# metainit -s sybase_data d51 -p d30 32g
d30如果剩余空间还有300G,可以从300G里面,划分部分空间作为软分区d51的增加空间,可以从剩余300G空间里面,再划出16G出来:
center-1# metattach d51 16g

Growing Soft Partitions
A soft partition can be grown by the use of the metattach command. There is no mechanism to shrink a soft partition.
CODE:[Copy to clipboard]   # metattach d0 10m
   d0: Soft Partition has been grown
When additional space is added to an existing soft partition, the additional space is taken from any available space on the same device and might not be contiguous with the existing soft partition. Growing soft partitions must be done with free space in the same device as the current soft partition.
The following example shows how growing a soft partition will increase the size of the current extent:
CODE:[Copy to clipboard]   # metainit d1 -p c1t0d2s0 100m
   d1: Soft Partition is setup
   # metastat d1
   d1: Soft Partition
       Component: c1t0d2s0
       State: Okay
       Size: 204800 blocks
           Extent              Start Block              Block count
                0                        1                   204800
   # metattach d1 50m
   d1: Soft Partition has been grown
   # metastat d1
   d1: Soft Partition
       Component: c1t0d2s0
       State: Okay
       Size: 307200 blocks
           Extent              Start Block              Block count
                0                        1                   307200
Note how after the metattach is run, there is still only one extent, but the (block count) has grown from 204800 (100MB) to 307200 (150MB).
In the following example, the extent cannot be grown, as it was above, because another soft partition is "in the way". Therefore, a second extent is created in the same slice.
CODE:[Copy to clipboard]   # metainit d1 -p c1t0d2s0 100m
   d1: Soft Partition is setup
   # metainit d2 -p c1t0d2s0 10m
   d2: Soft Partition is setup
   # metastat
   d1: Soft Partition
       Component: c1t0d2s0
       State: Okay
       Size: 204800 blocks
           Extent              Start Block              Block count
                0                        1                   204800
   d2: Soft Partition
       Component: c1t0d2s0
       State: Okay
       Size: 20480 blocks
           Extent              Start Block              Block count
                0                   204802                    20480
   # metattach d1 50m
   d1: Soft Partition has been grown
   # metastat
   d1: Soft Partition
       Component: c1t0d2s0
       State: Okay
       Size: 307200 blocks
           Extent              Start Block              Block count
                0                        1                   204800
                1                   225283                   102400
   d2: Soft Partition
       Component: c1t0d2s0
       State: Okay
       Size: 20480 blocks
           Extent              Start Block              Block count
                0                   204802                    20480
Note how d1 now has two non-contiguous extents that together make up the 307200 (150MB) blocks.
NOTE: Growing the metadevice does not modify the data or the filesystem inside the metadevice. If the metadevice contains a filesystem, you must use the appropriate command(s) to grow that filesystem after the metadevice has been grown.


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/2027/showart_332969.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP