3320磁盘阵列,裸设备的使用
两台机器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: # 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: # 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: # 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
页:
[1]