Solaris Volume Manager Administration Guide

Creating a Command File with the metassist Command

By running the metassist command with the -c argument, you can generate a Bourne shell script containing the commands that would be used to create the volume configuration. This technique allows you to review the commands before actually creating the volume, or even to modify the script somewhat to meet specific needs.

To Create a Command File with the metassist Command
  1. Make sure that you have the necessary prerequisites for using top down volume creation (the metassist command).

  2. Identify available storage on which to create the volume.

  3. Use the following form of the metassist command to create a stripe and specify that the volume should not actually be created, but that a command sequence (shell script) to create the volumes should be sent to standard output:

    metassistcreate -s diskset-name -S size [-c]
    • create is the subcommand to create volumes.

    • -s diskset-name specifies the name of the disk set to use for the volumes.

    • -S size specifies the size of the volume to create in KB, MB, GB, or TB, for kilobytes, megabytes, gigabytes, and terabytes, respectively.

    • -c specifies that the volume should not actually be created. Instead, a shell script that can be used to create the specified configuration will be sent to standard output.

    See the following examples and the metassist(1M) man page for more information.

    Note that the shell script required by the -c argument will be sent to standard output, while the rest of the output from the metassist command goes to standard error, so you can redirect the output streams as you choose.

Example—Creating a Command File (Shell Script) with the metassist Command


# metassist create -s myset -f -r 2 -S 10mb -c
 

This example shows how to use the metassist command to create a two-way mirror, 10Mb in size, with a hot spare to provide additional fault tolerance (the -f option specifies fault tolerance). The final argument (-c) specifies that the volume should not actually be created, but rather than a shell script that could be used to create the specified configuration should be sent to standard output.

Example—Saving a Command File (Shell Script) from the metassist Command


# metassist create -s myset -f -r 2 -S 10mb -c > /tmp/metassist-shell-script.sh
 

This example shows how to use the metassist command to create a two-way mirror, 10Mb in size, with a hot spare to provide additional fault tolerance (the -f option specifies fault tolerance). The final argument (-c) specifies that the volume should not actually be created, but rather that a shell script that could be used to create the specified configuration should be sent to standard output. The end of the command redirects standard output to create the /tmp/metassist-shell-script.sh shell script that can later be used to create the specified volume.