BigAdmin System Administration Portal
Community Submitted Article
Print-friendly VersionPrint-friendly Version
This content is submitted by a BigAdmin user. It has not been reviewed for technical accuracy by Sun Microsystems, though it may have been lightly edited to improve readability. If you find an error or would like to comment on the article, please contact the submitter or use the comment field at the bottom of the article. Community submissions may not follow Sun trademark guidelines. For information on Sun trademarks, please see http://www.sun.com/suntrademarks/.
 
 

Using Metadevices With Solstice DiskSuite Software

Darek Licznerski, April 2006

This article offers general information about how to use metadevices, with examples. Contents include:

  • Definition
  • Planning
  • State database replicas
  • Metadevice concatenation
  • Metadevice striping
  • Metadevice mirroring
  • Metadevices with RAID5
  • Summary and some issues
  • References

Definition

A metadevice is a virtual disk created from many physical disks and available for applications as one disk. A metadevice is functionally identical to a physical disk in the view of an application. You can create a metadevice using Solstice DiskSuite software. In the Solaris 9 OS, "meta-tools" are available after install in the /usr/sbin/ directory (metatools are also available in the Solaris 10 OS). With Solstice DiskSuite software, metadevices are built from slices (disk partitions).

After installation of the Solaris 9 OS, you can find meta-tools such as these:

#ls  /usr/sbin/met*

/usr/sbin/metaclear    /usr/sbin/metadevadm   /usr/sbin/metaoffline
/usr/sbin/metarecover  /usr/sbin/metaroot     /usr/sbin/metastat     
/usr/sbin/metadb       /usr/sbin/metahs       /usr/sbin/metaonline
/usr/sbin/metarename   /usr/sbin/metaset      /usr/sbin/metasync
/usr/sbin/metadetach   /usr/sbin/metainit     /usr/sbin/metaparam
/usr/sbin/metareplace  /usr/sbin/metassist    /usr/sbin/metattach

Planning

Sun documentation offers a helpful graphic showing factors to consider: http://docs.sun.com/source/802-4215/images/3-3-4510.gif.


What You Must Know Before You Start

Check the following before you begin:

  • The number of disks you have for a metadevice
  • Whether you have root privileges
  • The configuration of your machine
  • How disks are put into the controllers using a command, for example format
  • Data is backed up from disks!
  • Plan for partition table (slices)

Planning Partition Table (Slices)

Here's an example:

Current partition table (metadevice):
Total disk cylinders available: 4924 + 2 (reserved cylinders)
 
Part      Tag    Flag     Cylinders   Size            Blocks
  0        usr    wu       0 - 4917   8.42GB    (4918/0/0) 17660538  
<= for metadevice  
  1 unassigned    wm       0          0         (0/0/0)           0
  2     backup    wu       0 - 4923   8.43GB    (4924/0/0) 17682084  
<= not recommended to put it 	
  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    4918 - 4923   10.52MB    (6/0/0)       21546  
<= for database replicas
  7 unassigned    wm       0          0         (0/0/0)           0

Make sure you have the same partition table for all other disks!!! If not, change it using format command!!!

System Disk (if you decided to create a mirror of the system disk)

Current partition table (system):
Total disk cylinders available: 4924 + 2 (reserved cylinders)
 
Part      Tag    Flag     Cylinders     Size            Blocks
  0       root    wm    1169 - 4784     6.19GB    (3616/0/0) 12985056     
<= for metadevice
  1       swap    wu       0 - 1168     2.00GB    (1169/0/0)  4197879     
<= for metadevice
  2     backup    wm       0 - 4923     8.43GB    (4924/0/0) 17682084     
<= not recommended to put it
  3       home    wm    4785 - 4899   201.64MB    (115/0/0)    412965     
<= for metadevice
  4 unassigned    wm    4900 - 4905    10.52MB    (6/0/0)       21546     
<= for future use 	
  5 unassigned    wm    4906 - 4911    10.52MB    (6/0/0)       21546     
<= for future use
  6 unassigned    wm    4912 - 4917    10.52MB    (6/0/0)       21546     
<= for database replicas
  7 unassigned    wm    4918 - 4923    10.52MB    (6/0/0)       21546     
<= for database replicas

Make sure you have the same partition table for all other disks!!! If not, change it using format command!!!


State Database Replicas

Before you create a metadevice you must create "state database replicas." A state database replica stores DiskSuite configuration and state information -- when you install a new system, the state database replicas will be lost. You must create at least three state database replicas. The system will not reboot without one more than half of the total state database replicas. Instead, it will go into single-user mode for administrative tasks. So you must plan for problems with controllers and other failures, if they are possible.

Rules for State Database Replicas

In a two-drive configuration, you must always create two state database replicas on each drive. You can create state database replicas on a dedicated slice, or on a slice that will be used as part of a simple metadevice. The maximum number of state database replicas is 50.

Ways to Create State Database Replicas

Here are three ways to create these replicas:

  1. You can put state database replicas on slices that will become part of a simple metadevice. State database replicas cannot be part of root (/), swap, /usr, an existing file system, or a slice containing data.
  2. You can put them on unused dedicated slices (you can reserve about 10MB partition for the replica -- it should be OK).
  3. You can also "steal" space from another slice, such as swap, for the state database replicas.

State Database Replicas: Example

# metadb -a -f c0t1d0s3 c1t1d0s3 c2t1d0s3 c3t1d0s3 c4t1d0s3
# metadb
		 flags         first blk      block count     
		a        u         16              1034            /dev/dsk/c0t1d0s3     
		a        u         16              1034            /dev/dsk/c1t1d0s3     
		a        u         16              1034            /dev/dsk/c2t1d0s3     
		a        u         16              1034            /dev/dsk/c3t1d0s3     
		a        u         16              1034            /dev/dsk/c4t1d0s3 
# metadb -a -f -c 2 c0t1d0s3 c1t1d0s3 c2t1d0s3
# metadb
           flags         first blk      block count   
	  	a        u         16              1034            /dev/dsk/c0t1d0s3     
		a        u         1050            1034            /dev/dsk/c0t1d0s3     
		a        u         16              1034            /dev/dsk/c1t1d0s3     
		a        u         1050            1034            /dev/dsk/c1t1d0s3     
		a        u         16              1034            /dev/dsk/c2t1d0s3     
		a        u         1050            1034            /dev/dsk/c2t1d0s3 

Metadevice Concatenation

See Sun documentation for a useful graphic: http://docs.sun.com/source/802-6724/images/4-1-6172.gif.

Metadevice Concatenation: Example

Here's a sample:

# metainit d25 2 1 c0t1d0s0 1 c0t2d0s0 
d25: Concat/Stripe is setup 

# metainit d40 4 1 c0t1d0s0 1 c0t2d0s0 1 c0t2d0s0 1 c0t2d1s0 
d40: Concat/Stripe is setup 

# metainit d50 4 1 c1t1d0s6 1 c1t2d0s6 1 c1t2d0s6 1 c1t2d1s6 
d50: Concat/Stripe is setup

Metadevice Striping

The Sun documentation site has a relevant graphic: http://docs.sun.com/source/802-6724/images/7-1-BBB1.gif.

When you create a stripe composed of disks with different geometries, the metadevice will only be as fast as its slowest disk. Do not create a stripe metadevice from slices that are on the same physical disk. This eliminates simultaneous access and decreases performance. Try to distribute the slices of a stripe or concatenation across different controllers and buses since this increases the number of simultaneous reads and writes that can be performed. Do not create a striped metadevice from an existing file system or data, as it will destroy data. Use a concatenation if you must do it.

You can create a striped metadevice from existing data, but you must dump and restore the data to the metadevice (for example, see manual pages for commands like ufsdump and ufsrestore).

Metadevice Striping: Example

# metainit d20 1 3 c0t1d0s0 c0t2d0s0 c0t3d0s0 
d20: Concat/Stripe is setup 

# metainit d10 1 2 c0t1d0s3 c0t2d0s3  
d10: Concat/Stripe is setup 

Metadevices and Concatenated Striping

For an example, see this figure from Sun documentation: http://docs.sun.com/source/802-6724/images/9-1-FE14.gif.


Metadevice Mirroring

For examples, see these two graphics from Sun documentation:

In this case, the mirror survives. The size of the metadevice is as follows:

n*(the smallest disk size)/2, where n - number of disks

Metadevice Mirroring: Example

# metadb   -a   -f   c0t0d0s7   c2t0d0s7
# metadb   -a   -f   c0t0d0s6   c2t0d0s6
# metadb  (make sure that database state replicas has been created)
        flags           first blk       block count
     a m  p  luo        16              8192      /dev/dsk/c0t0d0s7
     a    p  luo        16              8192      /dev/dsk/c2t0d0s7
     a    p  luo        16              8192      /dev/dsk/c0t0d0s6
     a    p  luo        16              8192      /dev/dsk/c2t0d0s6

# metainit   -f   d21   1   1   c0t0d0s3
d21: Concat/Stripe is setup 

# metainit   -f   d22   1   1   c2t0d0s3
d22: Concat/Stripe is setup 

# metainit   d20   -m   d21
d20: Mirror is setup 

# vi /etc/vfstab (if you have entry for that device - change it to metadevice, 
if not you can add entry and specify mount point) 

# reboot     (you do not have to reboot if you add new mount point, 
              just use metattach and mount)
...

# metattach d20 d22
d20: Submirror d22 is attached 


# metatstat

d20: Mirror
    Submirror 0: d21
      State: Okay
    Submirror 1: d22
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 412965 blocks (201 MB)
 
d21: Submirror of d20
    State: Okay
    Size: 412965 blocks (201 MB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c0t0d0s3          0     No            Okay   Yes
 
 
d22: Submirror of d20
    State: Okay
    Size: 412965 blocks (201 MB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c2t0d0s3          0     No            Okay   Yes

Note: When you attach a submirror to the mirror, the submirror starts a synchronization process. During this time the system has very low performance. After this time all states should be OK.


Metadevices With RAID5

An example is found in this graphic from Sun documentation: http://docs.sun.com/source/802-6724/images/20-1-26801.gif.

An extra disk must be for RAID 5. The size of the metadevice is as follows:

n*(the smallest disk size) -1, where n - number of disks

Metadevices With RAID5: Example

# metainit d45 -r c2t3d0s0 c3t0d0s0 c4t0d0s0 
d45: RAID is setup 

Metadevice Concatenation (Expanded) With RAID5

The Sun documentation site offers a useful graphic: http://docs.sun.com/source/802-6724/images/21-1-2A219.gif.


Summary and Some Issues

If you must have, for example, a directory for 500GB of data, you can create a metadevice, but consider using a 72GB disk and just mounting it instead of creating a metadevice. When you need to increase system availability, consider mirroring the system disk. When hardware costs are not a problem for you, create a mirror plus hot spare pools, which increases availability and performance. If you need a directory for more than 100GB, and you do not have large enough disks, consider an array with, for example, System RAID5.


References

Here are some useful links:


About the Author

Darek Licznerski is a software engineer with a Master of Science degree in Computer Science from Nicolaus Copernicus University in Torun, Poland.

 


The information and links on this page have been provided by a BigAdmin user. The submitter is solely responsible for such information and links. Sun is not responsible for the availability of external sites or resources, and does not endorse and is not responsible or liable for any content, advertising, products, or other materials on or available from such sites or resources. Sun will not be responsible or liable, directly or indirectly, for any actual or alleged damage or loss caused by or in connection with use of or reliance on the information posted here, or goods or services available on or through any external site or resource.

Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License.


BigAdmin