You are on page 1of 7

10/23/2020 Document 1417827.

1
Copyright (c) 2020, Oracle. All rights reserved. Oracle Confidential.

Solaris Volume Manager (SVM): Best Practices for Creation and Implementation of Soft
Partitions (Doc ID 1417827.1)

In this Document

Goal
Solution
Creating Soft Partitions from a Single Disk or LUN
Creating Soft Partitions from a Mirror (How to Mirror Soft Partitions).
Creating Soft Partitions from a RAID-5 Metadevice
Growing Soft Partitions
Introduction to the metarecover Command
References

APPLIES TO:

Solstice DiskSuite Software - Version 4.2.1 to 4.2.1 [Release 4.0]


Sun Solaris Volume Manager (SVM) - Version 11.9.0 to 11.11 [Release 11.0]
Information in this document applies to any platform.

GOAL

Solaris Volume Manager (SVM) was originally implemented to allow creation of software RAID devices from disk drives or
LUNs. These RAID devices (or metadevices) were created from physical partitions on the disk. You could combine physical
disk partitions into stripes or concatentions, mirrors and RAID-5 metadevices.

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.

A soft partition is made up of one or more "extents." Each extent is preceded by an extent header, which is a consistency
record that contains such information as the metadevice (soft partition) name, its status, size, and a checksum. Each
extent header is 1 block (512 bytes) in size.

Soft partition configuration information is written in two places:

the state database replicas;

directly onto the disk, in the extent header.

Extent headers are also referred to as watermarks and are used in administration and recovery.

Several more points of interest:

Soft partitioning was introduced in Solaris 8 with SVM product patch 108693-06.

Soft partitions are managed with the md_sp kernel driver.

Note: Do not use Soft Partitions on Operating System file systems. Use only Raid-1 metadevices for root, /usr, /var,
and /opt.

# modinfo | grep md_sp


228 78328000 4743 - 1 md_sp (Meta disk soft partition module)
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=82skjboz1_119&id=1417827.1 1/7
10/23/2020 Document 1417827.1

There are new options to the metainit command. The -p option means that the command refers to soft partitions.

# metainit softpart -p [-e] component size


# metainit softpart -p component -o offset -b size

The metattach command now allows for growing soft partitions.

# metattach softpart size

There is a new command, metarecover, to administer the extents on a disk.

# metarecover [-n] [-v] component -p [-d|-m]

Do not use soft partitions unless you plan on making more than 8 metadevices from a disk drive. They serve no purpose
and introduce a new layer of complexity.

SOLUTION

The following examples show how to incorporate best practices when implementing soft partitions.

Creating Soft Partitions from a Single Disk or LUN

This approach can be used for individual disks and is also especially useful when a hardware RAID array presents a very
large LUN to the host.

# 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.
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=82skjboz1_119&id=1417827.1 2/7
10/23/2020 Document 1417827.1

NOTE: You can create soft partitions by specifying offsets and block lengths (-o and -b). However, this creates the
possibility of unused space and/or potential overlap. Offsets and lengths should only be specified during recovery
techniques not covered in this article.

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

Creating Soft Partitions from a Mirror (How to Mirror 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.

NOTE: The metainit command allows you to make mirror metadevices whose components are soft partitions. This
method is not recommended. Do not mirror soft partitions; instead, create them from larger slice-based mirror
metadevices.

Create your mirror first.

# metainit d10 1 1 c0t8d0s1


# metainit d11 1 1 c0t9d0s1
# metainit d1 -m d10
# metattach d1 d11

Create soft partitions from the mirror device.

# metainit d100 -p d1 1gb


d100: Soft Partition is setup
# metainit d101 -p d1 2gb
d101: Soft Partition is setup
etc......

View results with metastat and metastat -p

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=82skjboz1_119&id=1417827.1 3/7
10/23/2020 Document 1417827.1

# metastat -p
d1 -m d10 d11 1
d10 1 1 c0t8d0s1
d11 1 1 c0t9d0s1
d100 -p d1 -o 32 -b 2097152
d101 -p d1 -o 2097216 -b 4194304

# 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
d101: Soft Partition
Device: d1
State: Okay
Size: 4194304 blocks (2.0 GB)
Extent Start Block Block count
0 2097216 4194304

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.

NOTE: The metainit command allows you to make RAID-5 metadevices whose components are soft partitions. This
method is not recommended. Do not configure RAID-5 metadevices using soft partitions; instead, create them from
larger slice-based RAID-5 metadevices.

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
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=82skjboz1_119&id=1417827.1 4/7
10/23/2020 Document 1417827.1

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

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.

When additional space is added to an existing soft partition, the additional space is taken from any available space
on the same device. It might not be contiguous to the existing soft partition.

Growing soft partitions must be done with free space on the same device as the current soft partition.

In the following example, d100 cannot be contiguously grown, as the extents for d101 are "in the way." Therefore, a
second extent is created in the same slice.

# metainit d100 -p c0t8d0s1 2gb


d100: Soft Partition is setup
# metainit d101 -p c0t8d0s1 2gb
d101: Soft Partition is setup

# metastat
d101: Soft Partition
Device: c0t8d0s1
State: Okay
Size: 4194304 blocks (2.0 GB)
Device Start Block Dbase Reloc
c0t8d0s1 0 No Yes

Extent Start Block Block count


0 4194306 4194304

d100: Soft Partition

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=82skjboz1_119&id=1417827.1 5/7
10/23/2020 Document 1417827.1
Device: c0t8d0s1
State: Okay
Size: 4194304 blocks (2.0 GB)
Device Start Block Dbase Reloc
c0t8d0s1 0 No Yes

Extent Start Block Block count


0 1 4194304

Notice the new size and additional extent added to d100.

# metattach d100 4gb


d100: Soft Partition has been grown

# metastat
d101: Soft Partition
Device: c0t8d0s1
State: Okay
Size: 4194304 blocks (2.0 GB)
Device Start Block Dbase Reloc
c0t8d0s1 0 No Yes

Extent Start Block Block count


0 4194306 4194304

d100: Soft Partition


Device: c0t8d0s1
State: Okay
Size: 12582912 blocks (6.0 GB)
Device Start Block Dbase Reloc
c0t8d0s1 0 No Yes

Extent Start Block Block count


0 1 4194304
1 8388611 8388608

Introduction to the metarecover Command

metarecover, with the -n and -v options, will list out the soft partitions in a given slice.

The command actually scans the disk slice for extent headers and prints the information that it finds about those
headers.

It will also identify free space and gaps within the slice.

Lastly, metarecover will make sure that the information on the extent matches the information in the replica. When
they do not match, metarecover may be used to effect repairs.

The metarecover command may be run on a "layered" metadevice, such as a mirror, which has soft partitions created
from it. For example:

# metarecover -v -n d1 -p

The following example shows the output of the previous soft partitions (d100 and d101) created from a single slice:

# metarecover -v -n c0t8d0s1 -p
Verifying on-disk structures on c0t8d0s1.
The following extent headers were found on c0t8d0s1.
Name Seq# Type Offset Length
d100 0 ALLOC 0 4194305
d100 1 ALLOC 8388610 8388609
d101 0 ALLOC 4194305 4194305
NONE 0 END 17468014 1
NONE 0 FREE 16777219 690795
Found 2 soft partition(s) on c0t8d0s1.
Checking sequence numbers.
c0t8d0s1: Validating soft partition metadb entries.
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=82skjboz1_119&id=1417827.1 6/7
10/23/2020 Document 1417827.1

Verifying device d101.


d101: Status "Okay" is valid.
Extent Number Virtual Offset Physical Offset Length
0 0 4194306 4194304

Verifying device d100.


d100: Status "Okay" is valid.
Extent Number Virtual Offset Physical Offset Length
0 0 1 4194304
1 4194304 8388611 8388608
c0t8d0s1: Soft Partition metadb configuration is valid

c0t8d0s1: Verifying metadb allocations match extent headers.


Metadb extent:
Name Seq# Type Offset Length
d100 0 ALLOC 0 4194305
Extent header extent:
Name Seq# Type Offset Length
d100 0 ALLOC 0 4194305

Metadb extent:
Name Seq# Type Offset Length
d101 0 ALLOC 4194305 4194305
Extent header extent:
Name Seq# Type Offset Length
d101 0 ALLOC 4194305 4194305

Metadb extent:
Name Seq# Type Offset Length
d100 1 ALLOC 8388610 8388609
Extent header extent:
Name Seq# Type Offset Length
d100 1 ALLOC 8388610 8388609

c0t8d0s1: Soft Partition metadb matches extent header configuration

For troubleshooting Softpartitions see:

How to Troubleshoot and Repair SVM Soft Partitions (Softpartitions) Resolution Path (Doc ID 1494494.1)

REFERENCES

Didn't find what you are looking for?

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=82skjboz1_119&id=1417827.1 7/7

You might also like