Why Soft Partitions ?
An obvious question in everybody’s mind – why the hell do we need the soft partitions. Well, the simple answer is – A limitation existed in that a disk can only have 8 partitions, thus limiting the number of metadevices to 8 per disk. This may have originally been an acceptable limitation, but as disk sizes increased, the restriction became unmanageable. This is where soft partitions come into play. Soft partitioning allows a disk to be subdivided into many partitions which are controlled and maintained by SVM, thereby removing the 8-metadevice limitation per disk.
Soft partition configuration information is written in two places :
– the state database replicas
– directly onto the disk, in the extent header
Interesting facts about soft partitions
– Soft partitioning was introduced in Solaris 8 with SVM product patch 108693-06.
– Soft partitions are managed with the md_sp kernel driver.
# modinfo | grep md_sp 228 78328000 4743 - 1 md_sp (Meta disk soft partition module)
Creating a soft partition
The -p option in the metainit command refers to a soft partition.
# metainit softpart -p [-e] component size
Creating Soft Partitions from a Single Disk
# metainit d100 -p -e c1t10d0 2gb
- The -e option requires that the name of the disk supplied be in the form c#t#d#. - The last parameter (2gb) specifies the initial size of the soft partition. - The sizes can be specified in blocks, kilobytes, megabytes, gigabytes, and terabytes. - The -e option causes the disk to be repartitioned. One partition (other than 0) will contain enough space to hold a replica (although no replica is actually created) and slice 0 will be the remainder of the drive. The soft partition that is being created is put into slice 0. - Further soft partitions can be created on slice 0. See the next example.
# metainit d200 -p c0t10d0s0 3gb
This will create a soft partition on the specified slice. No repartitioning of the disk is done. This soft partition starts where the previous soft partition ended. No overlap will occur. Soft partitions may be continually created, providing space is available on the drive.
A subsequent metastat (-p) will show the soft partitions, and their respective locations on the disk.
# metastat -p d200 -p c0t10d0s0 -o 4194306 -b 6291456 d100 -p c0t10d0s0 -o 1 -b 4194304 # metastat d200: Soft Partition Device: c0t10d0s0 State: Okay Size: 6291456 blocks (3.0 GB) Device Start Block Dbase Reloc c0t10d0s0 0 No Yes Extent Start Block Block count 0 4194306 6291456 d100: Soft Partition Device: c0t10d0s0 State: Okay Size: 4194304 blocks (2.0 GB) Device Start Block Dbase Reloc c0t10d0s0 0 No Yes Extent Start Block Block count 0 1 4194304
Mirroring Soft partitions
The proper method to mirror soft partitions begins with creating a large mirror metadevice from slices, which you then divide into multiple soft partitions.
Create your mirror first :
# metainit d10 1 1 c0t8d0s1 # metainit d11 1 1 c0t9d0s1 # metainit d1 -m d10 # metattach d1 d11
Create soft partition from mirror :
# metainit d100 -p d1 1gb d100: Soft Partition is setup
View results with metastat and metastat -p
# metastat -p d1 -m d10 d11 1 d10 1 1 c0t8d0s1 d11 1 1 c0t9d0s1 d100 -p d1 -o 32 -b 2097152 # metastat d1: Mirror Submirror 0: d10 State: Okay Submirror 1: d11 State: Okay Pass: 1 Read option: roundrobin (default) Write option: parallel (default) Size: 17465344 blocks (8.3 GB) d10: Submirror of d1 State: Okay Size: 17465344 blocks (8.3 GB) Stripe 0: Device Start Block Dbase State Reloc Hot Spare c0t8d0s1 0 No Okay Yes d11: Submirror of d1 State: Okay Size: 17465344 blocks (8.3 GB) Stripe 0: Device Start Block Dbase State Reloc Hot Spare c0t9d0s1 0 No Okay Yes d100: Soft Partition Device: d1 State: Okay Size: 2097152 blocks (1.0 GB) Extent Start Block Block count 0 32 2097152
Creating Soft Partitions from a RAID-5 Metadevice
The proper method to configure soft partitions for use in a RAID-5 metadevice begins with creating a large RAID-5 metadevice from slices, which you then divide into multiple soft partitions.
Create your RAID-5 metadevice :
# metainit d5 -r c0t8d0s1 c0t9d0s1 c0t10d0s1
Create soft partitions from the RAID-5 metadevice :
# metainit d200 -p d5 1gb d200: Soft Partition is setup # metainit d201 -p d5 3gb d201: Soft Partition is setup
View results with metastat and metastat -p :
# metastat -p d5 -r c0t8d0s1 c0t9d0s1 c0t10d0s1 -k -i 32b d200 -p d5 -o 32 -b 2097152 d201 -p d5 -o 2097216 -b 6291456 # metastat d5: RAID State: Okay Interlace: 32 blocks Size: 34930688 blocks (16 GB) Original device: Size: 34935360 blocks (16 GB) Device Start Block Dbase State Reloc Hot Spare c0t8d0s1 330 No Okay Yes c0t9d0s1 330 No Okay Yes c0t10d0s1 330 No Okay Yes d200: Soft Partition Device: d5 State: Okay Size: 2097152 blocks (1.0 GB) Extent Start Block Block count 0 32 2097152 d201: Soft Partition Device: d5 State: Okay Size: 6291456 blocks (3.0 GB) Extent Start Block Block count 0 2097216 6291456