Send in your Unix questions today! |
See additional Unix tips and tricks
Soft partitions provide a way to squeeze more than seven partitions onto a single disk on a Solaris system. First introduced into Solaris as a patch for Solstice DiskSuite on Solaris 8 and then bundled into Solaris 9 as a feature of Solaris Volume Manager, soft partitions provide a way to make more flexible use of the increasingly large disks showing up on Solaris servers. Prior to soft partitions, the maximum of seven partitions often had sysadmins weighing tradeoffs when setting up their systems. Which file systems demand separate slices and which can share disk space without running into problems? With soft partitions, sysadmins can pretty much set up as many partitions on a disk as they care to configure.
If you are looking at the soft partitioning on a Solaris server for the first time, you may find the information concerning the configuration of soft partitions a little hard to digest. First, you need to use the metastat command. Metastat will display all of the metadevices set up on a system -- all of the soft partitions, mirrors, submirrors and such that have been configured with metainit and similar commands. Then, you need to look for the sections of the metastat output that detail the size and location of the various soft partitions.
A soft partition that is set up within a conventional disk slice might look like this:
d23: Soft Partition
Device: c1t0d0s3
State: Okay
Size: 213696 blocks (104 MB)
Device Start Block Dbase Reloc
c1t0d0s3 0 No Yes
Extent Start Block Block count
0 1 213696
|
Notice that the disk slice in which this soft partition has been set up is c1t0d0s3. This particular soft partition is only using the first 213,696 blocks of the slice for a total of 104 MB (213,696 * 512) of space. Let's say that a second soft partition within the same slice looks like this:
d25: Soft Partition
Device: c1t0d0s3
State: Okay
Size: 417216 blocks (203 MB)
Device Start Block Dbase Reloc
c1t0d0s3 0 No Yes
Extent Start Block Block count
0 213698 417216
|
Finally, a third and more generally usable soft partition with 16 GB of disk space might look like this:
d27: Soft Partition
Device: c1t0d0s3
State: Okay
Size: 34415232 blocks (16 GB)
Device Start Block Dbase Reloc
c1t0d0s3 0 No Yes
Extent Start Block Block count
0 630915 34415232
|
For each of these three soft partitions, we see the block number of the first block and the number of blocks used.
If we want to view how these three partitions line up, we can examine the start blocks and block counts and calculate the end block like this:
Soft partition 1 runs from block 1 to 213696 with a total of 213696 blocks. Soft partition 2 runs from block 213698 to 630913 (expr 213698 + 417216 - 1) for a total of 417216 blocks. Soft partition 3 runs from block 630915 to 35046146 (expr 630915 + 34415232 - 1) for a total of 34415232 blocks. The need to subtract 1 is easy to see when contemplating the number of blocks between 1 and 10, but not so obvious when considering the number of blocks between 630915 and 35046146.
Here's what we have so far:
First Last Number of
Block Block Blocks
======= ======= =========
1 213696 213696
213698 630913 417216
630915 35046146 34415232
|
One thing you might be curious about when examining soft partitions is whether the entire slice or disk has been utilized or there is room for additional soft partitions. To find this out, you can use the format command to determine how many blocks exist on the slice and then look at your metastat output to see how much of that space is occupied by your soft partitions.
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 909 4.42GB (910/0/0) 9260160
1 unassigned wm 910 - 917 39.75MB (8/0/0) 81408
2 backup wu 0 - 14086 68.35GB (14087/0/0) 143349312
3 unassigned wm 8632 - 14086 26.47GB (5455/0/0) 55510080
4 var wm 918 - 1021 516.75MB (104/0/0) 1058304
5 unassigned wm 1022 - 1931 4.42GB (910/0/0) 9260160
6 unassigned wm 1932 - 2035 516.75MB (104/0/0) 1058304
7 swap wu 2036 - 8631 32.01GB (6596/0/0) 67120896
|
In this example, we can see that the slice containing our soft partitions (slice 3) spans 55,510,080 blocks. We can then calculate that we have 20,463,936 unused blocks after the slices shown have consumed 35,046,144 (34415232 + 417216 + 213696) blocks. Two of our unused blocks, however, are sandwiched between our three soft partitions.
Adding the unused blocks to our table of soft partitions,
First Last Number of
Block Block Blocks
======= ======= =========
1 213696 213696
213697 213697 1 <== gap
213698 630913 417216
630914 630914 1 <== gap
630915 35046146 34415232
|
The rest of the slice, from block 35046147 to the end of the slice, is also unused.
You can check on the status of a single soft partition by using the command "metastat d#" where d# is the metadevice. For example, "metatstat d25". If the state is listed as "Okay", the partition is in good shape.