Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
  Previous   Contents   Next 
   
 
Chapter 6

State Database (Tasks)

This chapter provides information about performing tasks that are associated with Solaris Volume Manager state database replicas. For information about the concepts involved in these tasks, see Chapter 5, State Database (Overview).

State Database Replicas (Task Map)

The following task map identifies the procedures needed to manage Solaris Volume Manager state database replicas.

Task

Description

Instructions

Create state database replicas

Use the Solaris Volume Manager GUI or the metadb -a command to create state database replicas."How to Create State Database Replicas"

Check the status of state database replicas

Use the Solaris Volume Manager GUI or the metadb command to check the status of existing replicas."How to Check the Status of State Database Replicas"

Delete state database replicas.

Use the Solaris Volume Manager GUI or the metadb -d command to delete state database replicas."How to Delete State Database Replicas"

Creating State Database Replicas


Caution - If you upgraded from Solstice DiskSuite™to Solaris Volume Manager and you have state database replicas sharing slices with file systems or logical volumes (as opposed to on separate slices), do not delete existing replicas and replace them with new default replicas in the same location.

The default state database replica size in Solaris Volume Manager is 8192 blocks, while the default size in Solstice DiskSuite was 1034 blocks. If you delete a default-sized state database replica from Solstice DiskSuite, and then add a new default-sized replica with Solaris Volume Manager, you will overwrite the first 7158 blocks of any file system that occupies the rest of the shared slice, thus destroying the data.


How to Create State Database Replicas

  1. Check "Prerequisites for Creating Solaris Volume Manager Elements".

  2. To create state database replicas, use one of the following methods:

    • From the Enhanced Storage tool within the Solaris Management Console, open the State Database Replicas node. Choose Action->Create Replicas and follow the instructions. For more information, see the online help.

    • Use the following form of the metadb command. See the metadb(1M) man page for more information.

      metadb -a -c n -l nnnn -f ctds-of-slice
      • -a specifies to add a state database replica.

      • -f specifies to force the operation, even if no replicas exist.

      • -c n specifies the number of replicas to add to the specified slice.

      • -l nnnn specifies the size of the new replicas, in blocks.

      • ctds-of-slice specifies the name of the component that will hold the replica.

      Use the -f flag to force the addition of the initial replicas.


Note - The metadb command without options reports the status of all replicas.


Example--Creating the First State Database Replica

# metadb -a -f c0t0d0s7
# metadb
        flags         first blk      block count
...
     a      u         16             8192            /dev/dsk/c0t0d0s7

The -a option adds the additional state database replica to the system, and the -f option forces the creation of the first replica (and may be omitted when you add supplemental replicas to the system).

Example--Adding Two State Database Replicas to the Same Slice

# metadb -a -c 2 c1t3d0s1
# metadb
        flags         first blk      block count
...
     a        u         16              8192            /dev/dsk/c1t3d0s1
     a        u         8208            8192            /dev/dsk/c1t3d0s1

The -a option adds additional state database replicas to the system. The -c 2 option places two replicas on the specified slice. The metadb command checks that the replicas are active, as indicated by the -a.

You can also specify the size of the state database replica with the -l option, followed by the number of blocks. However, the default size of 8192 should be appropriate for virtually all configurations, including those configurations with thousands of logical volumes.

Example--Adding State Database Replicas of Specific Size

If you are replacing existing state database replicas, you might need to specify a replica size. Particularly if you have existing state database replicas (on a system upgraded from Solstice DiskSuite, perhaps) that share a slice with a file system, you must replace existing replicas with other replicas of the same size or add new replicas in a different location.


Caution - Do not replace default-sized (1034 block) state database replicas from Solstice DiskSuite with default-sized Solaris Volume Manager replicas on a slice shared with a file system. If you do, the new replicas will overwrite the beginning of your file system and corrupt it.


# metadb -a -c 3 -l 1034 c0t0d0s7
# metadb
        flags         first blk      block count
...
     a      u         16             1034            /dev/dsk/c0t0d0s7
     a      u         1050           1034            /dev/dsk/c0t0d0s7
     a      u         2084           1034            /dev/dsk/c0t0d0s7

The -a option adds the additional state database replica to the system, and the -l option specifies the length in blocks of the replica to add.

Maintaining State Database Replicas

How to Check the Status of State Database Replicas

  • To check the status of state database replicas, use one of the following methods:

    • From the Enhanced Storage tool within the Solaris Management Console, open the State Database Replicas node to view all existing state database replicas. For more information, see the online help.

    • Use the metadb command to view the status of state database replicas. Add the -i option to display a key to the status flags. See the metadb(1M) man page for more information.

Example--Checking the Status of All State Database Replicas

# metadb -i
        flags           first blk       block count
     a m  p  luo        16              8192            /dev/dsk/c0t0d0s7
     a    p  luo        8208            8192            /dev/dsk/c0t0d0s7
     a    p  luo        16400           8192            /dev/dsk/c0t0d0s7
     a    p  luo        16              8192            /dev/dsk/c1t3d0s1
      W   p  l          16              8192            /dev/dsk/c2t3d0s1
     a    p  luo        16              8192            /dev/dsk/c1t1d0s3
     a    p  luo        8208            8192            /dev/dsk/c1t1d0s3
     a    p  luo        16400           8192            /dev/dsk/c1t1d0s3
 r - replica does not have device relocation information
 o - replica active prior to last mddb configuration change
 u - replica is up to date
 l - locator for this replica was read successfully
 c - replica's location was in /etc/lvm/mddb.cf
 p - replica's location was patched in kernel
 m - replica is master, this is replica selected as input
 W - replica has device write errors
 a - replica is active, commits are occurring to this replica
 M - replica had problem with master blocks
 D - replica had problem with data blocks
 F - replica had format problems
 S - replica is too small to hold current data base
 R - replica had device read errors

A legend of all the flags follows the status. The characters in front of the device name represent the status. Uppercase letters indicate a problem status. Lowercase letters indicate an "Okay" status.

 
 
 
  Previous   Contents   Next