背景
由于硬盘变得越来越大,而且对于solaris系统来说磁盘阵列是一个比较大的逻辑设备,一些用户提出了需求:要求划分超过8个的细分硬盘和逻辑卷,并且创造易于管理的文件系统和分区大小。这样,soft partition技术就被引进到solaris系统中来了。
术语介绍:
Metadevices: 他们是类似物理硬盘分区的逻辑设备。他们习惯常常被用于描述一个单独的硬盘分区或是一组硬盘驱动器或硬盘分区。通常像下面一样命名metadevices设备:
/dev/md/(r)dsk/d[0-255]
Submirror: 一组由metadevice构成的逻辑设备。一个submirror不是striped就是concatenated的metadevices。
Metamirror: 一组submirrors的逻辑联合。系统创建的所有的metamirrors至少由两个submirrors组成。每个组中的submirror包含数据的全部拷贝并且位于一个不同的硬盘上。因此如果一个disk出问题,通过恢复其他硬盘上的submirror数据完整性不会受损。这种通过双submirror的数据的复制是DiskSuite实现镜像的习惯。一个metamirror可以包括3个submirror。
Soft Partition:Soft partitions被用来将一个disk slice或者逻辑卷划分成多个partition,具体数量根据需求来定。Soft partitions可以直接被放置在disk slice上,或者一个mirrror的顶端。Soft partitions被应用于除了根分区(root partition)和交换分区(swap partition)之外的所有分区上。
1. Snapshot for E3500 c0t0d0 and c2t4d0 as example
1.1 c0t0d0s0 and c2t4d0s0 ( / root partition , non-soft partition)
| |
d100 ----------- d101
|
d20
1.2. c0t0d0s1 and c2t4d0s1 ( swap partition , non-soft partition )
| |
d102 ----------- d103
|
d21
1.3. c0t0d0s3 and c2t4d0s3 ( soft partition )
| ---------|-----------| |----------|-----------|
d150 d152 d184 d151 d153 d185
( d104) ( d106 ) ( d222) ( d105) (d107) ( d223 )
| || ||| | || |||
|-----------||----------|||---------------- | || |||
d22 || ---------|||--------------------------|| |||
( /home ) d23 |||-------------------------------------|||
( /solbak) d61
( /dev/omc_db_temp )
2. How to setup disksuite with soft partition
Here , as E3500 c0d0t0 and c2t4d0 example , details how disksuite is setup in OMCR system.
2.1 c0t0d0s0 and c2t4d0s0 ( / root partition, non-soft partition )
Command line procedure to setup c0t0d0s0 / c2t4d0s0 disksuite .
metainit d100 1 1 /dev/dsk/c0t0d0s0
metainit d101 1 1 /dev/dsk/c2t4d0s0
metainit d20 -m d100
metattach d20 d101
metaroot /dev/md/dsk/d20
Metastat output for d20 .
# metastat d20
d20: Mirror
Submirror 0: d100
State: Okay
Submirror 1: d101
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 4506705 blocks
d100: Submirror of d20
State: Okay
Size: 4506705 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c0t0d0s0 0 No Okay
d101: Submirror of d20
State: Okay
Size: 4506705 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c2t4d0s0 0 No Okay
2.2 c0t0d0s1 and c2t4d0s1 ( swap partition, non-soft partition )
Command line procedure to setup c0t0d0s1 / c2t4d0s1 disksuite .
metainit d102 1 1 /dev/dsk/c0t0d0s1
metainit d103 1 1 /dev/dsk/c2t4d0s1
metainit d21 –m d102
metattach d21 d103
Metastat output for d21.
# metastat d21
d21: Mirror
Submirror 0: d102
State: Okay
Submirror 0: d103
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 2459835 blocks
d102: Submirror of d21
State: Okay
Size: 2459835 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c0t0d0s1 0 No Okay
d103: Submirror of d21
State: Okay
Size: 2459835 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c2t4d0s1 0 No Okay
2.3 c0t0d0s3 and c2t4d0s3 ( soft partition )
Command line procedure to setup c0t0d0s3 / c2t4d0s3 disksuite .
metainit d150 -p c0t0d0s3 -o 1 -b 2100735
metainit d152 -p c0t0d0s3 -o 2100737 -b 4197879
metainit d184 -p c0t0d0s3 -o 6298617 -b 4197879
metainit d104 1 1 d150
metainit d106 1 1 d152
metainit d 222 1 1 d184
metainit d151 –p c2t4d0s3 –o 1 –b 2100735
metainit d153 –p c2t4d0s3 -o 2100737 –b 4197879
metainit d185 –p c2t4d0s3 -o 6298617 -b 4197879
metainit d105 1 1 d151
metainit d107 1 1 d153
metainit d223 1 1 d185
metainit d22 –m d104
metattach d22 d105
metainit d23 –m d106
metattach d23 d107
metainit d61 –m d222
metattach d61 d223
Metastat output for d22.
d22: Mirror
Submirror 0: d104
State: Okay
Submirror 0: d105
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 2100735 blocks
d104: Submirror of d22
State: Okay
Size: 2100735 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
d150 0 No Okay
d150: Soft Partition
Component: c0t0d0s3
State: Okay
Size: 2100735 blocks
Extent Start Block Block count
0 1 2100735
d105: Submirror of d22
State: Okay
Size: 2100735 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
d151 0 No Okay
d151: Soft Partition
Component: c2t4d0s3
State: Okay
Size: 2100735 blocks
Extent Start Block Block count
0 1 2100735
Metastat output for d23.
# metastat d23
d23: Mirror
Submirror 0: d106
State: Okay
Submirror 0: d107
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 4197879 blocks
d106: Submirror of d23
State: Okay
Size: 4197879 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
d152 0 No Okay
d152: Soft Partition
Component: c0t0d0s3
State: Okay
Size: 4197879 blocks
Extent Start Block Block count
0 2100737 4197879
d107: Submirror of d23
State: Okay
Size: 4197879 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
d153 0 No Okay
d153: Soft Partition
Component: c2t4d0s3
State: Okay
Size: 4197879 blocks
Extent Start Block Block count
0 2100737 4197879
Metastat output for d61.
# metastat d61
d61: Mirror
Submirror 0: d222
State: Okay
Submirror 0: d223
State: Okay
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 4197879 blocks
d222: Submirror of d61
State: Okay
Size: 4197879 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
d184 0 No Okay
d184: Soft Partition
Component: c0t0d0s3
State: Okay
Size: 4197879 blocks
Extent Start Block Block count
0 6298617 4197879
d223: Submirror of d61
State: Okay
Size: 4197879 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
d185 0 No Okay
d185: Soft Partition
Component: c2t4d0s3
State: Okay
Size: 4197879 blocks
Extent Start Block Block count
0 6298617 4197879
Disksuite Commands Summary
metaclear Clears active metadevices
metadb Creates and deletes replics of the metadevice state database
metainit Configures metadevices
metaroot Sets up system files for root metadevices
metastat Prints status information for metadevice
metattach Attaches a metadevice to a metamirror
metadetach Detaches a metadevice from a metamirror
metareplace Replaces components of submirror
metasync Handles mirror resync during reboot