Solaris Volume Manager Administration Guide

Working with Configuration Files

Solaris Volume Manager configuration files contain basic Solaris Volume Manager information, as well as most of the data necessary to reconstruct a configuration. The following sections illustrate how to work with these files.

ProcedureHow to Create Configuration Files


    Once you have defined all appropriate parameters for the Solaris Volume Manager environment, use the metastat -p command to create the /etc/lvm/ file.

    # metastat -p > /etc/lvm/

    This file contains all parameters for use by the metainit, and metahs commands, in case you need to set up several similar environments or recreate the configuration after a system failure.

    For more information about the file, see Overview of the File.

ProcedureHow to Initialize Solaris Volume Manager From a Configuration File

Caution – Caution –

Use this procedure only if you have experienced a complete loss of your Solaris Volume Manager configuration, or if you have no configuration yet and you want to create a configuration from a saved configuration file.

If your system loses the information maintained in the state database (for example, because the system was rebooted after all state database replicas were deleted), and as long as no volumes were created since the state database was lost, you can use the or files to recover your Solaris Volume Manager configuration.

Note –

The file does not maintain information on active hot spares. Thus, if hot spares were in use when the Solaris Volume Manager configuration was lost, those volumes that were using active hot spares will likely be corrupted.

For more information about these files, see the and the man pages.

  1. Create state database replicas.

    See Creating State Database Replicas for more information.

  2. Create, or update the /etc/lvm/ file.

    • If you are attempting to recover the last known Solaris Volume Manager configuration, copy the file to the file.

    • If you are creating a new Solaris Volume Manager configuration based on a copy of the file that you preserved, put a copy of your preserved file at /etc/lvm/

  3. Edit the “new” file and do the following:

    • If you are creating a new configuration or recovering a configuration after a crash, configure the mirrors as one-way mirrors. If a mirror's submirrors are not the same size, be sure to use the smallest submirror for this one-way mirror. Otherwise data could be lost.

    • If you are recovering an existing configuration and Solaris Volume Manager was cleanly stopped, leave the mirror configuration as multi-way mirrors

    • Specify RAID 5 volumes with the -k option, to prevent reinitialization of the device. See the metainit(1M) man page for more information.

  4. Check the syntax of the file entries without committing changes by using the following form of the metainit command:

    # metainit -n -a component-name

    The metainit command does not maintain a hypothetical state of the devices that might have been created while running with the -n, so creating volumes that rely on other, nonexistent volumes will result in errors with the -n even though the command may succeed without the -n option.

    • -n specifies not to actually create the devices. Use this to check to verify that the results will be as you expect

    • -a specifies to activate the devices.

    • component-name specifies the name of the component to initialize. If no component is specified, all components will be created.

  5. If no problems were apparent from the previous step, recreate the volumes and hot spare pools from the file:

    # metainit -a component-name
    • -a specifies to activate the devices.

    • component-name specifies the name of the component to initialize. If no component is specified, all components will be created.

  6. As needed, make the one-way mirrors into multi-way mirrors by using the metattach command.

  7. Validate the data on the volumes.