open.itworld.com
  Search  
Security Home Page Security Webcasts Security White Papers Security Newsletters Security News Open Topics Careers ITworld Voices ITwhirled The Security site of ITworld.com

Unix Tip: Looking at soft partitions

ITworld.com 9/4/2007

Sandra Henry-Stocker, ITworld.com

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.

On this topic

 

Sandra Henry-Stocker has been administering Unix systems for more than 18 years. She describes herself as "USL" (Unix as a second language) but remembers enough English to write books and buy groceries. She currently works for TeleCommunication Systems, a wireless communications company, in Annapolis, Maryland, where no one else necessarily shares any of her opinions. She lives with her second family on a small farm on Maryland's Eastern Shore. Send comments and suggestions to bugfarm@gmail.com.




Sponsored Links

Sign up for a Microsoft Dynamics® CRM WEBCAST
Hear globally recognized leaders in customer strategy discuss the importance and evolution of CRM.
Sun Microsystems' - FREE 60 DAY TRIAL OFFER!
Test Sun's Newest Servers BEFORE YOU BUY. Plug Them In With Access To Full Technical Support.
100% Web Based Help Desk Software
Easy to use, customizable to meet your needs, powerful and scalable. Free online demo. Try it today!
Sign up for a Microsoft Dynamics® CRM WEBCAST
Hear globally recognized leaders in customer strategy discuss the importance and evolution of CRM.
Used and Refurbished HP ProCurve Switches
Lifetime Warranties, Professional Testing & Shipping on all HP Equipment Purchases!
» Buy a link now

Advertisements
Sponsored links
Locate Hidden Software on business PCs with this free tool
Bring harmony to your mix of UNIX-Linux-Windows computing environments
Top 5 Reasons to Combine App Performance and Security
KODAK i1400 Series Scanners stand up to the challenge
 Home   Open source  Operating systems  Unix
www.itworld.com    open.itworld.com     security.itworld.com     smallbusiness.itworld.com
storage.itworld.com     utilitycomputing.itworld.com     wireless.itworld.com

 
Contact Us   About Us   Privacy Policy    Terms of Service   Reprints  

CIO   Computerworld   CSO   GamePro   Games.net   IDG Connect   IDG World Expo   Infoworld   ITworld   JavaWorld   LinuxWorld  MacUser   Macworld   Network World   PC World   Playlist  

Copyright © Computerworld, Inc. All rights reserved

Reproduction in whole or in part in any form or medium without express written permission of Computerworld Inc. is prohibited. Computerworld and Computerworld.com and the respective logos are trademarks of International Data Group Inc.