|
Home | Switchboard | Unix Administration | Red Hat | TCP/IP Networks | Neoliberalism | Toxic Managers |
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and bastardization of classic Unix |
This document was originally posted at:
http://www2.primushost.com/~griff/soft-partitions.html
however, it has been unavailable for some time now.
Last Updated: Wed Aug 22 2001
The intent of this document is to describe Soft Partitioning within Solstice DiskSuite (soon-to-be-renamed Solaris Volume Manager), and offer a short primer/tutorial on how to create, use, and delete them.
Until now, Solaris, without any volume management software, has only ever allowed a fixed number of partitions on a physical disk (seven (7) on SPARC platforms). With the increase in capacity of disks, this limitation has become a severe restriction.
SDS/SVM uses these slices for its metadevices (sub-mirrors, trans, stripes, and RAID5) and hence is faced with the same limitation, whereas Veritas Volume Manager (VxVM) allows for the logical partitioning of disks into a virtually unlimited number of subdisks.
Soft Partitioning allows for a disk to be subdivided into many partitions which are controlled and maintained by software, thereby removing the limitation of the number of partitions on a disk. A soft partition is made up of one or more "extents". An extent describes the parts of the physical disk that make up the soft partition. While the maximum number of extents per soft partition is 2147483647, the majority of soft partitions will use only one (1) extent.
Soft Partitioning was not in the original Solstice DiskSuite 4.2.1 Release, which coincided with the release of Solaris 8. However, the soft partitioning functionality was released in patch 108693-06 for SDS 4.2.1.
When Solaris 9 gets released, the "Solstice DiskSuite" name will change to "Solaris Volume Manager" ("SVM") and it will be bundled in with Solaris 9. Soft Partitioning will, of course, be part of the base functionality of that release.
Soft Partitions are implemented by new kernel driver: md_sp.
# modinfo | grep md_sp 228 78328000 4743 - 1 md_sp (Meta disk soft partition module)There are new options to the metainit command:
metainit softpart -p [-e] component size metainit softpart -p component -o offset -b sizeThe metattach command has been modified to allow for growing of soft partitions:
metattach softpart sizeThere is a new command... metarecover:
metarecover [-n] [-v] component -p [-d|-m]
NOTE: the -p option means that the command refers to soft partitions.
# metainit d0 -p -e c1t0d0 200m |
The -e option requires that the name of the disk supplied be in the form c#t#d#.
The last parameter (200m) 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 such that slice 7 has enough space to hold a replica (although no replica is actually created on this disk) and slice 0 contains the rest of the space. Slice 2 is removed from the disk. The soft partition that is being created is put into slice 0. Further soft partitions can be created on slice 0 by the next method of creating a soft partition.
After this command is run, the layout of the disk would like similar to this example:
Part Tag Flag Cylinders Size Blocks 0 unassigned wm 5 - 2035 999.63MB (2031/0/0) 2047248 1 unassigned wm 0 0 (0/0/0) 0 2 unassigned wm 0 0 (0/0/0) 0 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 0 0 (0/0/0) 0 5 unassigned wm 0 0 (0/0/0) 0 6 unassigned wm 0 0 (0/0/0) 0 7 unassigned wu 0 - 4 2.46MB (5/0/0) 5040 |
This command (with the -e) can only be run on an empty disk (one that is not used in any other metadevice). If another metadevice or replica already exists on this disk, one of the following messages will be printed, and no soft partition will be created.
metainit: hostname: c#t#d#s0: has appeared more than once in the specification of d#or
metainit: hostname: c#t#d#s#: has a metadevice database replica
# metainit d1 -p c1t0d0s0 1g |
This will create a soft partition on the specified slice. No repartitioning of the disk is done. Provided there is space on the slice, additional soft partitions could be created as required. The device name must include the slice number (c#t#d#s#).
If another soft partition already exists in this slice, this one
will be created immediately after the existing one. Therefore, no overlap
of soft partitions can occur by accident.
# metainit d2 -p c1t0d0s0 -o 2048 -b 1024 |
# metainit d1 -p c1t0d0s0 -o 1 -b 2024 d1: Soft Partition is setup # metainit d2 -p c1t0d0s0 -o 2000 -b 2024 metainit: hostname: d2: overlapping extents specified |
An offset of 0 is not valid, as the first block on a slice containing a soft partition contains the initial extent header. Each extent header consumes 1 block of disk and each soft partition will have an extent header placed at the end of each extent. Extent headers are explained in more detail in the next section.
NOTE: This method is not documented in the man page for metainit and is not recommended for manual use. It is here because a subsequent metastat -p command will output information in this format.
Whenever a soft partition is created in a disk slice, an "extent header" is written to disk. Internally to Sun, these are sometimes referred to as "watermarks".
An extent header is a consistency record and contains such information as the metadevice (soft partition) name, it's status, it's size, and a checksum. Each extent header 1 block (512 bytes) in size.
The following diagram shows an example 100MB slice (c1t0d0s0) and the extent headers (watermarks) that have been created on it. The command to make the soft partition shown was
# metainit d1 -p c1t0d0s0 20m |
There is always an extent header on the first and last blocks in the slice. Note that the 80MB of space left over from the creation of the soft partition can be used to make one or more additional soft partitions. Each additional soft partition will create an additional extent header to be created as well.
# metainit d10 -p c1t11d0s4 100m d10: Soft Partition is setup # metainit d20 -m d10 metainit: hostname: d10: invalid unit |
# metainit d10 -p c1t0d0s0 100m d10: Soft Partition is setup # metainit d20 1 1 d10 d20: Concat/Stripe is setup # metainit d30 -m d20 d30: Mirror is setup # metainit d11 -p c2t0d0s0 100m d11: Soft Partition is setup # metainit d21 1 1 d11 d21: Concat/Stripe is setup # metattach d30 d21 d30: submirror d21 is attached |
Once done, the resulting metastat output of the mirror will look like this:
# metastat d30 d30: Mirror Submirror 0: d20 State: Okay Submirror 1: d21 State: Okay Pass: 1 Read option: roundrobin (default) Write option: parallel (default) Size: 204624 blocks d20: Submirror of d30 State: Okay Size: 204624 blocks Stripe 0: Device Start Block Dbase State Hot Spare d10 0 No Okay d10: Soft Partition Component: c1t0d0s0 State: Okay Size: 204800 blocks Extent Start Block Block count 0 1 204800 d21: Submirror of d30 State: Okay Size: 204624 blocks Stripe 0: Device Start Block Dbase State Hot Spare d11 0 No Okay d11: Soft Partition Component: c2t0d0s0 State: Okay Size: 204800 blocks Extent Start Block Block count 0 1 204800 |
RAID5 devices can be made up of soft partitions directly. This example shows 4 soft partitions (from 4 separate slices) striped together to make a RAID5 device:
# metainit d1 -p c1t0d0s0 10m d1: Soft Partition is setup # metainit d2 -p c2t0d0s0 10m d2: Soft Partition is setup # metainit d3 -p c3t0d0s0 10m d3: Soft Partition is setup # metainit d4 -p c4t0d0s0 10m d4: Soft Partition is setup # metainit d10 -r d1 d2 d3 d4 d10: RAID is setup |
Once done, the resulting metastat output of the RAID5 device will look like this:
# metastat d10 d10: RAID State: Okay Interlace: 32 blocks Size: 59472 blocks Original device: Size: 60384 blocks Device Start Block Dbase State Hot Spare d1 330 No Okay d2 330 No Okay d3 330 No Okay d4 330 No Okay d1: Soft Partition Component: c1t0d2s0 State: Okay Size: 20480 blocks Extent Start Block Block count 0 1 20480 d2: Soft Partition Component: c1t0d4s0 State: Okay Size: 20480 blocks Extent Start Block Block count 0 1 20480 d3: Soft Partition Component: c1t1d1s0 State: Okay Size: 20480 blocks Extent Start Block Block count 0 1 20480 d4: Soft Partition Component: c1t1d3s0 State: Okay Size: 20480 blocks Extent Start Block Block count 0 1 20480 |
# metainit d1 -p c1t0d0s0 500m d1: Soft Partition is setup # metainit d2 -p c2t0d0s0 50m d2: Soft Partition is setup # metainit d10 -t d1 d2 d1: Trans is setup |
Once done, the resulting metastat output of the metatrans device will look like this:
# metastat d10 d10: Trans State: Okay Size: 1024000 blocks Master Device: d1 Logging Device: d2 d1: Soft Partition Component: c1t1d3s0 State: Okay Size: 1024000 blocks Extent Start Block Block count 0 1 1024000 d2: Logging device for d10 State: Okay Size: 102142 blocks d2: Soft Partition Component: c1t1d1s0 State: Okay Size: 102400 blocks Extent Start Block Block count 0 1 102400 |
Most of the time, soft partitions are made on a disk slice. However, there are certain situations where it can be beneficial to make a soft partition on top of an existing metadevice. This is referred to as layering.
For example, say you have a 90GB RAID5 device made up of 6 18GB disks. You can then take that 90GB device and "split it up" into many soft partitions. These many soft partitions then can be accessed as separate simple metadevices, although the data in them is protected by the RAID5 parity in the underlying device.
Soft partitions can be layered only on top of concat/stripes, mirrors, and RAID5 devices. Soft partitions cannot be layered on top of a metatrans device or directly on top of another soft partition.
Here is an example of layering soft partitions on top of an existing RAID5 metadevice. First, we create the RAID5 device, then soft partition that device into 3 100MB partitions (obviously, we could create more than just 3 soft partitions).
# metainit d0 -r c1t0d2s0 c1t0d4s0 c1t1d1s0 c1t1d3s0 d0: RAID is setup # metainit d1 -p d0 100m d1: Soft Partition is setup # metainit d2 -p d0 100m d2: Soft Partition is setup # metainit d3 -p d0 100m d3: Soft Partition is setup |
Each of the resulting soft partitions (d1, d2, and d3) can be accessed individually (i.e., newfs and mount).
Soft partitions can be built on top of an existing mirror device as well, just like we did above on the RAID5 device. In the following example, the mirror device (d0) is "carved up" into 3 smaller soft partitions.
# metainit d10 1 1 c1t0d2s0 d10: Concat/Stripe is setup # metainit d20 1 1 c2t0d0s0 d20: Concat/Stripe is setup # metainit d0 -m d10 d20 d0: Mirror is setup # metainit d1 -p d0 100m d1: Soft Partition is setup # metainit d2 -p d0 100m d2: Soft Partition is setup # metainit d3 -p d0 100m d3: Soft Partition is setup |
Soft partitions are not allowed to be parented by other soft partitions directly. For example:
# metainit d1 -p c1t0d0s0 100m d1: Soft Partition is setup # metainit d2 -p d1 10m metainit: hostname: d1: invalid unit |
# metainit d1 -t d10 d20 d1: Trans is setup # metainit d2 -p d1 100m metainit: hostname: d1: invalid unit |
A soft partition can be grown by the use of the metattach command. There is no mechanism to shrink a soft partition.
# 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:
# 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.
# 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.
# metaclear d0 d0: Soft Partition is cleared |
metaclear: hostname: d0: metadevice in use
There are no differences with soft partitioning in a diskset, other than having to specify the -s option on the commandline to specify the diskset name.
The only potential problem occurs when dealing with did disk devices that are in a SunCluster configuration. Unfortunately, the naming convention of the did devices is similar to that of SDS/SVM in that the disks are referred to as d#. This means that SDS/SVM could confuse a did disk with a metadevice when creating a soft partition.
The simple workaround to this problem is to use the full path to the did device on the metainint commandline in order to prevent any confusion.
For example, the following command to create a 1GB soft partition on /dev/did/rdsk/d7s0 would be invalid:
# metainit -s set2 d0 -p d7s0 1g |
# metainit -s set2 d0 -p /dev/did/rdsk/d7s0 1g |
The metarecover command, with the -n and -v options, will display information about the soft partitons existing in a given slice.
The metarecover command actually scans the given slice for extent headers and prints the information that it finds about those headers.
In each slice/device, there are also 2 additional extent headers; one which preceeds the free space in the slice, and the one on the last block of the slice. These are printed as well. This is an easy way to determine how much free space is available in a slice for additional soft partitions.
# metarecover -v -n /dev/rdsk/c1t0d0s0 -p Verifying on-disk structures on c1t0d0s0. The following extent headers were found on c1t0d0s0. Name Seq# Type Offset Length d0 0 ALLOC 0 20481 d1 0 ALLOC 20481 40961 NONE 0 END 17674901 1 NONE 0 FREE 61442 17613459 Found 2 soft partition(s) on c1t0d0s0. |
In the above example, there were 2 soft partitions (d0 and d1) found on c1t0d0s0, as well as 17613458 blocks (approx 8.4GB) of unallocated free space.
IMPORTANT NOTE: The information printed by this command is relative to the extent header, not the soft partition itself. Therefore, the 'offset' is the starting location of the extent header, not the extent itself. Also, the 'length' given is the length of the extent plus the header. Therefore, in the example above, there are only 17613458 free blocks, not 17613459 blocks.
Because soft partitions can be layered above metadevices like mirrors or RAID5 devices (see layering, above), this command can also be run on them to determine the locations and sizes of the extent headers. In the example below, d0 is a RAID5 metadevice which has 4 soft partitions in it. There is no free space left in this device.
# metarecover -v -n d0 -p Verifying on-disk structures on d0. The following extent headers were found on d0. Name Seq# Type Offset Length d1 0 ALLOC 0 204801 d2 0 ALLOC 204801 204801 d3 0 ALLOC 409602 204801 d99 0 ALLOC 614403 7573580 NONE 0 END 8187983 1 Found 4 soft partition(s) on d0. |
Fragmentation of free space will occur on a slice when there has been activity in creating, deleting, and possibly growing soft partitions. At this time, there is no method to defragment a disk.
For example, the following sequence of commands can result in some amount of fragmentation. First, create 2 10MB soft partitions on a slice.
# metainit d1 -p c1t0d0s0 10m d1: Soft Partition is setup # metainit d2 -p c1t0d0s0 10m d2: Soft Partition is setup |
Then, remove the first 10MB soft partition and then create a 20MB soft partition.
# metaclear d1 d1: Soft Partition is cleared # metainit d3 -p c1t0d0s0 20m d3: Soft Partition is setup |
# metarecover -v -n c1t0d0s0 -p Verifying on-disk structures on c1t0d0s0. The following extent headers were found on c1t0d0s0. Name Seq# Type Offset Length d2 0 ALLOC 20481 20481 d3 0 ALLOC 40962 40961 NONE 0 END 2047247 1 NONE 0 FREE 81923 1965324 NONE 0 FREE 0 20481 Found 2 soft partition(s) on c1t0d0s0. |
# metastat |
# metarecover c0t0d0s0 -p -d The following soft partitions were found and will be added to your metadevice configuration. Name Size No. of Extents d1 61440 1 d2 20480 1 WARNING: You are about to add one or more soft partition metadevices to your metadevice configuration. If there appears to be an error in the soft partition(s) displayed above, do NOT proceed with this recovery operation. Are you sure you want to do this (yes/no)? yes c0t0d0s0: Soft Partitions recovered from device. |
# metastat d1: Soft Partition Component: c0t0d0s0 State: Okay Size: 61440 blocks Extent Start Block Block count 0 120836 61440 d2: Soft Partition Component: c0t0d0s0 State: Okay Size: 20480 blocks Extent Start Block Block count 0 20482 20480 |
# metastat d1: Soft Partition Component: c0t0d0s0 State: Okay Size: 61440 blocks Extent Start Block Block count 0 120836 61440 d2: Soft Partition Component: c0t0d0s0 State: Okay Size: 20480 blocks Extent Start Block Block count 0 20482 20480 |
# dd if=/dev/zero of=/dev/md/rdsk/d2 dd: /dev/md/rdsk/d2: open: I/O error |
# metarecover -n c0t0d0s0 -p found incorrect magic number 0, expected 20000127. No extent headers found on c0t0d0s0. c0t0d0s0: On-disk structures invalid or no soft partitions found. metarecover: hostname: d0: bad magic number in extent header |
# metarecover c0t0d0s0 -p -m c0t0d0s0: Soft Partition metadb configuration is valid WARNING: You are about to overwrite portions of c0t0d0s0 with soft partition metadata. The extent headers will be written to match the existing metadb configuration. If the device was not previously setup with this configuration, data loss may result. Are you sure you want to do this (yes/no)? yes c0t0d0s0: Soft Partitions recovered from metadb |
# metarecover -n c0t0d0s0 -p c0t0d0s0: Soft Partition metadb configuration is valid c0t0d0s0: Soft Partition metadb matches extent header configuration |
Society
Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers : Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism : The Iron Law of Oligarchy : Libertarian Philosophy
Quotes
War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda : SE quotes : Language Design and Programming Quotes : Random IT-related quotes : Somerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose Bierce : Bernard Shaw : Mark Twain Quotes
Bulletin:
Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 : Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law
History:
Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds : Larry Wall : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOS : Programming Languages History : PL/1 : Simula 67 : C : History of GCC development : Scripting Languages : Perl history : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history
Classic books:
The Peter Principle : Parkinson Law : 1984 : The Mythical Man-Month : How to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite
Most popular humor pages:
Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor
The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D
Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.
This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...
|
You can use PayPal to to buy a cup of coffee for authors of this site |
Disclaimer:
The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.
Last modified: March, 12, 2019