[Return to Library] [Contents] [Previous Chapter] [Next Section] [Next Chapter] [Index] [Help]


7    Volume and File System Operations

This chapter presents LSM commands used for managing volumes and file systems. For details on any of the commands mentioned in this chapter, refer to the appropriate reference pages.

The functions described in this chapter can also be performed using the LSM Support Operations menu interface (voldiskadm) or the graphical user interface (dxlsm).


[Return to Library] [Contents] [Previous Chapter] [Next Section] [Next Chapter] [Index] [Help]


7.1    Commands Summary

Table 7-1 introduces the commands and utilities discussed in this chapter.

Table 7-1: Volume Commands

Command Description
volassist A one-step utility that finds space for and creates simple volumes, adds simple plexes to existing volumes, extends and shrinks existing volumes, provides for the migration of data from a specified disk, and provides facilities for the online backup of existing volumes. The command is supplied a keyword that selects the action to perform.
voledit Sets and changes various attributes for LSM configuration records that do not depend upon volume usage types. (See the volume command utility to set attributes that are dependent upon usage types.) Each invocation can be applied to only one disk group at a time.
volmake Creates subdisk, plex, and volume records.
volplex Performs LSM operations on plexes and volume-and-plex combinations. The volplex utility takes several operands. The first operand is a keyword that determines the specific operation to perform. The remaining operands specify the configuration objects to which the operation is to be applied. Each operation can be applied to only one disk group at a time.
volprint Displays information about volumes, plexes, and subdisks.
volrecover Recovers plexes and volumes after disk replacement.
volrestore Restores an LSM configuration, using the information in the files saved with the volsave command.
volsave Saves information about an LSM configuration in a set of files called a description set.
volume Performs LSM operations on volumes, including initialization, set the read policy (round robin, preferential, select a default policy based on plex association), enable disabled or detached volumes, stop volumes, and change volume characteristics.

In addition, this chapter describes the commands for making and mounting UFS and AdvFS file systems on an LSM volume.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.2    Displaying Volume Information

If you are administering a volume created by someone else, you may want to know how this volume is configured.

Use the volprint command to display the volume, plex, and subdisk record information for all volumes, as shown here:

volprint -ht

For example:

DG NAME     GROUP-ID
DM NAME      DEVICE        TYPE     PRIVLEN  PUBLEN PUBPATH
V  NAME      USETYPE       KSTATE   STATE    LENGTH READPOL...
PL NAME      VOLUME        KSTATE   STATE    LENGTH LAYOUT...
SD NAME      PLEX          PLOFFS   DISKOFFS LENGTH DISK-MEDIA...

 
dg rootdg 730344554.1025.harley
 
dm rz8 rz8 sliced 512 829072 /dev/rrz8e dm disk01 rz8d simple 512 202240 /dev/rrz8d dm disk02 rz9 sliced 512 202240 /dev/rrz9e
 
pl volmir-02 - DISABLED - 10240 CONCAT - RW sd disk02-02 volmir-02 0 16384 10240 disk02 rz9
 
v homevol fsgen ENABLED ACTIVE 275184 SELECT - pl homevol-01 homevol ENABLED ACTIVE 275184 CONCAT - RW sd rz8-04 homevol-01 0 410256 275184 rz8 rz8
 
v rootvol root ENABLED ACTIVE 314496 SELECT - pl rootvol-01 rootvol ENABLED ACTIVE 314496 CONCAT - RW sd rz8-01 rootvol-01 0 95760 314496 rz8 rz8
 
v snapvol fsgen ENABLED - 20480 ROUND - pl voltest-03 snapvol ENABLED ACTIVE 20480 CONCAT - RW sd disk01-01 voltest-03 0 143088 20480 disk01 rz8d
 
v standvol gen ENABLED ACTIVE 31248 SELECT - pl standvol-01 standvol ENABLED ACTIVE 31248 CONCAT - RW sd rz8-03 standvol-01 0 0 31248 rz8 rz8
 
v swapvol swap ENABLED ACTIVE 64512 SELECT - pl swapvol-01 swapvol ENABLED ACTIVE 64512 CONCAT - RW sd rz8-02 swapvol-01 0 31248 64512 rz8 rz8
 
v volcat fsgen ENABLED ACTIVE 20480 SELECT - pl volcat-01 volcat ENABLED ACTIVE 20480 CONCAT - RW sd rz8-06 volcat-01 0 705920 20480 rz8 rz8
 
v volspec fsgen ENABLED ACTIVE 6144 SELECT - pl volspec-01 volspec ENABLED ACTIVE 6144 CONCAT - RW sd disk02-01 volspec-01 0 10240 6144 disk02 rz8d
 
v volzebra fsgen ENABLED ACTIVE 20480 SELECT volstripe
 
pl volzebra-01 volzebra ENABLED ACTIVE 20480 STRIPE 128 RW sd disk01-02 volzebra-01 0 102128 10240 disk01 rz9 sd rz8-01 volzebra-01 10240 0 10240 disk02 rz9
 
v voltest fsgen ENABLED ACTIVE 20480 SELECT - pl voltest-01 voltest ENABLED ACTIVE 20480 CONCAT - RW sd rz8-05 voltest-01 0 685440 20480 rz8 rz8 pl voltest-02 voltest ENABLED ACTIVE 20480 CONCAT - RW sd disk01-04 voltest-02 0 122608 20480 disk01 rz8d

This example uses the following abbreviations:
dg Disk group
dm Disk
pl Plex
sd Subdisk
v Volume

You can list information related to volumes under LSM control, including the name of the volume, its usage type, state, length, user and group IDs, and mode.

To display information on a particular volume, specify the volume name on the command line:

volprint -t  volume_name

For example, to display the information about a volume named volspec, enter:

volprint -t volspec

DG NAME  GROUP-ID
DM NAME  DEVICE   TYPE     PRIVLEN  PUBLEN  PUBPATH
V  NAME  USETYPE  KSTATE   STATE    LENGTH  READPOL PREFPLEX
PL NAME  VOLUME   KSTATE   STATE    LENGTH  LAYOUT ST-WIDTH MODE
SD NAME  PLEX     PLOFFS   DISKOFFS LENGTH  DISK-MEDIA ACCESS

 
v volspec fsgen ENABLED ACTIVE 6144 SELECT -

To display the plexes for this volume, use the following command:

volprint -e 'assoc="volspec"'

To list information on all volumes, use the following command:

volprint -vt

To show detailed information for all volumes, use the following command:

volprint -vl


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.3    Volume Operations Using volassist

The volassist command enables you to perform a variety of volume operations, such as creating and mirroring volumes. This utility is easy to use and is LSM's most powerful program.

To get help on using volassist, display the online help information as follows:

volassist help

volassist - Perform simple general administrative actions

 
Usage: volassist [-b] [-g diskgroup] [-U usetype] [-d file] keyword...
 
Recognized keywords: make volume_name length [options] mirror volume_name [options] move volume_name [options] [-f] growto volume_name new_length [options] [-f] growby volume_name length_change [options] [-f] shrinkto volume_name new_length [options] [-f] shrinkby volume_name length_change [options] snapstart volume_name [options] snapwait volume_name snapshot volume_name snapshot_name help [debug | flags | options]

Note

You can control the behavior of the volassist command by specifying parameters on the command line or in the defaults file /etc/defaults/volassist. See Section 8.4.5 for an example of this file and for instructions on creating and editing it.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.3.1    Creating a Volume

A volume is a logical disk device on which file systems and databases can be created.

To create a volume using system defaults, use the following command:

volassist make  volume_name length

For example, to create the volume voldef, enter:

volassist make voldef 10m

This creates a 10MB volume named voldef.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.3.1.1    Creating a Concatenated Volume

A concatenated volume is a volume that uses one or more sections of disk space. On a fragmented disk, concatenation allows you to put together a volume larger than any individual section of free disk space available.

To create a concatenated volume, use the following command:

volassist make  volume_name length layout=concat

For example, to create the concatenated volume volcat, enter:

volassist make volcat 10m layout=concat

You can set concatenation as the default in the volassist defaults file /etc/defaults/volassist. This file is described in Section 8.4.5.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.3.1.2    Creating a Spanned Volume

A spanned volume is a concatenated volume with sections of disk space spread across more than one disk. A spanned volume can be larger than the single largest disk, because it takes space from more than one disk.

To create a spanned volume, use the following command:

volassist make  volume_name length

The concatenated, spanned layout is the default.

For example, to create the spanned volume volspan, enter:

volassist make volspan 1000m


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.3.1.3    Creating a Striped Volume

A striped volume consists of a number of equal sized subdisks, each located on a separate disk drive. To create a striped volume, use the following command:

volassist make  volume_name length layout=stripe 

For example, to create the striped volume volzebra, enter:

volassist make volzebra 10m layout=stripe

This command line creates a volume with the default stripe width on the default number of drives.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.3.1.4    Creating a Volume on a Specific Disk

LSM automatically selects the disk or disks each volume will reside on, unless you specify otherwise. If you want a volume to reside on a specific disk, you must designate the disk for LSM.

To create a volume on a specific disk, use the following command:

volassist make  volume_name length diskname [...]

For example, to create the volume volspec on disk03, enter:

volassist make volspec 3m disk03

You can specify more than one disk.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.3.2    Mirroring a Volume

A plex contains a copy of the volume's data. A volume must have two plexes for the data to be mirrored. The mirrored copy is not stored on the same disk as the original copy of the volume. Mirroring a volume assures you that the data in that volume will not be lost if one of your disks fails.

To create a new volume with a plex, use the following command:

volassist make  volume_name length mirror=yes

For example, to create the mirrored volume, volmir, enter:

volassist make volmir 5m mirror=yes

To create a plex for an existing volume, use the following command:

volassist mirror  volume_name

For example, to create a plex of the volume voltest, enter:

volassist mirror voltest


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.3.3    Extending a Volume

If the volume is not large enough for the amount of data that needs to be stored in it, you need to extend the volume's length.

To extend a volume to a specific length, use the following command:

volassist growto  volume_name length

For example, to extend volcat to 2000 512-byte sectors, enter:

volassist growto volcat 2000 

To extend a volume by a specific length, use the following command:

volassist growby  volume_name length

For example, to extend volcat by 100 sectors, enter:

volassist growby volcat 100

Notes

File systems such as AdvFS and UFS cannot currently take advantage of an enlarged volume.

You cannot use the volassist growto and volassist growby commands with striped volumes.

An extend operation will fail if a volume is open when you perform the operation. To override the failure, use the -f force option with volassist.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.3.4    Shrinking a Volume

If you find that a volume is much larger than needed, you can shrink its size. However, be aware that shrinking a volume containing data (perhaps in the form of a file system or database) can result in the loss of any data residing on the part of the volume that is removed.

To shrink a volume to a specific length, use the following command:

volassist shrinkto  volume_name length

This command can be safely used on empty volumes.

For example, to shrink volcat to 1300 sectors, enter:

volassist shrinkto volcat 1300

To shrink a volume by a specific length, use the following command:

volassist shrinkby  volume_name length

For example, to shrink volcat by 300 sectors, enter:

volassist shrinkby volcat 300s

Notes

File systems such as AdvFS and UFS cannot currently take advantage of an enlarged volume.

You cannot use the volassist shrinkto and volassist shrinkby commands with striped volumes.

A shrink operation will fail if a volume is open when you perform the operation. To override the failure, use the -f force option with volassist.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.3.5    Reducing Backup Down Time Using volassist

LSM provides the ability to perform snapshot backups of volume devices. This capability is provided through volassist and other utilities. There are various procedures for doing backups, depending upon requirements for integrity of the volume contents. These procedures have the same starting requirement: a plex that is large enough to store the complete contents of the volume. The plex can be larger than necessary, but if it is smaller, an incomplete copy results.

The recommended approach to volume backup involves the use of the volassist utility. The volassist procedure is convenient and relatively simple.

The volassist snapstart, snapwait, and snapshot operations provide a way to do online backup of volumes with minimal interruption of data change and access activity.

The snapstart operation creates a write-only backup plex, which gets attached to and synchronized with the volume. When synchronized with the volume, the backup plex is ready to be used as a snapshot plex. The end of the update procedure is signified by the new snapshot plex changing its state to SNAPDONE. This change can be tracked by the volassist snapwait operation, which waits until at least one of the snapshot plexes changes its state to SNAPDONE. If the attach process fails, the snapshot plex is removed and its space is released.

Once the snapshot plex is synchronized, it continues being updated until it is detached. The system administrator can then select a convenient time at which to create a snapshot volume as an image of the existing volume. The system administrator can also ask users to refrain from using the system during the brief time required to perform the snapshot (typically less than a minute). The amount of time involved in creating the snapshot plex is long and indefinite, in contrast to the brief amount of time that it takes to create the snapshot volume.

The backup procedure is completed by running the volassist snapshot command on a volume with a SNAPDONE plex. This operation detaches the finished snapshot (which becomes a normal plex), creates a new normal volume, and attaches the snapshot plex to it. The snapshot then becomes a normal, functioning plex and the state of the snapshot is set to ACTIVE.

If the snapshot procedure is interrupted, the snapshot plex is automatically removed when the volume is started.

Follow these steps to perform a complete backup using volassist:

  1. Create a snapshot plex for a volume as follows:

    volassist snapstart  volume_name

  2. When the snapstart operation is complete and the plex is in a SNAPDONE state, select a convenient time to complete the snapshot operation. Inform users of the upcoming snapshot and warn them to save files and refrain from using the system briefly during that time.

    Notes

    For UFS volumes, Digital recommends the file system be unmounted briefly to ensure the snapshot data on disk is consistent and complete.

    For volumes used in AdvFS domains, Digital recommends an AdvFS backup method such as cloning.

  3. Create a snapshot volume that reflects the original volume as follows:

    volassist snapshot  volume_name temp_volume_name

    After the snapshot is completed, you can resume normal use of the volume. For example, if the volume contained a UFS, it can be remounted.

  4. Use fsck, or some utility appropriate to the application running on the volume, to clean the temporary volume's contents. For example:

    fsck -p /dev/rvol/ temp-volume-name

  5. Copy the temporary volume to tape, or to some other appropriate backup media. For example, a UFS on the temporary volume could be backed up on the temporary volume with the following command:

    dump 0 /dev/rvol/ temp-volume-name

  6. After the backup has been completed, remove the temporary volume as follows:

    volume stop  temp_volume_name
    voledit -r rm  temp_volume_name

Note

The -r option of the voledit command removes multiple objects. Exercise caution when using it.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.4    Saving an LSM Configuration

LSM provides utilities to save and restore configuration information, so that you can recreate your LSM configuration, if necessary.

The volsave command saves information about an LSM configuration in a set of files called a description set. By default, the description set is saved to a timestamped directory in /usr/var/lsm/db (for example, /usr/var/lsm/db/LSM.19951226203620.skylark). Or, you can specify a directory of your choice by using the -d option with volsave (as described in Section C.21 ).

The description set contains the following files:

The volsave command does not save the data in LSM volumes; it only saves information about the LSM configuration. You should back up the description set, as you would any other files.

See Section C.21 for detailed examples of saving an LSM configuration.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.5    Restoring an LSM configuration

The volrestore command restores an LSM configuration, using the information that you saved with the volsave command. If you enter the volrestore command with no options, volrestore attempts to restore all disk groups. If you use the -i (interactive) option, volrestore prompts you before restoring each disk group.

Before the volrestore command restores the LSM configuration, it validates the checksum that is part of the description set.

By default, the volrestore command restores the whole configuration, using the description set in the directory under /usr/var/lsm/db that has the latest timestamp. You can specify options to the command to use a different directory and to restore a specific volume or disk group. For example, this command restores only the volume named myvol01 in the staffdg disk group:

volrestore -g staffdg -v myvol01 

When it restores a specific disk group, the volrestore command attempts to reimport the disk group based on configuration information on disks that belong to that disk group. If the import fails, volrestore recreates the disk group by reinitializing all disks within that disk group and recreating all volumes, unassociated plexes, and unassociated subdisks, based on information in the volmake description file, allvol.DF

Notes

The volrestore command does not restore volumes associated with the root, /usr, and /var file systems and the primary swap area. These partitions must be reencapsulated to use LSM volumes.

Before using volrestore in ASE or clusters, please refer to your ASE or clusters documentation.

When you restore a complete LSM configuration, volrestore attempts to reenable the vold daemon based on all rootdg disks in the saved copy of the volboot file. If the complete LSM configuration needs to be restored, you can use the -i (interactive) option with volrestore. The volrestore command prompts you before restoring each file, enabling you to skip specific disk groups.

If vold cannot be enabled, you are given the option of recreating the rootdg disk group and any other disk groups using the other files in the saved LSM description set. The rootdg disk group is recreated first, and vold is put in the enabled mode. Then, the other disk groups are enabled. The disk groups are recreated by first attempting to import them based on available disks in that disk group. If the import fails, the disk group is reinitialized and all volumes in that disk group are also recreated based on the volmake description files.

When volumes are restored using the volmake description file, the plexes are created in the "DISABLED EMPTY" state. The volrestore command does not attempt to start or enable such volumes. You must use volmend or volume to set the plex states appropriately before starting the volume. The volrestore command warns you to check the state of each disk associated with a volume before using volmend to set plex states; to carefully find out which disks in the LSM configuration could have had failures since saving the LSM configuration; and to use volmend to mark plexes on those disks to be "STALE." In addition, any plex that was detached or disabled at any point during or after the LSM configuration was saved should be marked "STALE" using volmend.

See Chapter 14 for information on how to resolve conflicts that may occur when restoring a configuration.

See Section C.23 for detailed examples of restoring a configuration.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.6    Volume Operations Using Individual Commands (Bottom-Up Approach)

This section shows how to use the volume command and other low-level LSM commands to do the following tasks:

The LSM reference pages provide detailed descriptions about the commands used to perform volume operations.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.6.1    Creating a Volume with volmake

Volumes can be created with either the volassist or volmake utility.

The length of a new volume can be specified in sectors, megabytes, or kilobytes. The unit of measure is indicated by adding the appropriate suffix to the length (s, m, or k). If no unit is specified, sectors are assumed.

To create a volume using volmake, use the following command:

volmake -U  usage_type vol  volume_name len= length \
plex= plex_name, ...

Either the plex= parameter or the len= parameter can be omitted. If the len= parameter is specified with the plex= parameter, then the volume created from an existing plex takes the length of that plex. If the len= parameter is specified without the plex= parameter, then at least one plex of the appropriate length must later be specified.

The following examples show commands for creating an fsgen-type volume called vol01:

volmake -Ufsgen vol vol01 len=100000

or

volmake vol vol01 use_type=fsgen plex=vol01-01,vol01-02

Note that the first command shown above creates a volume that has no plex.

The usage type for a volume can be specified in either of two ways: -Ufsgen or use_type=fsgen. If a length is not specified (for example, len=100000) or associated plexes are not identified (for example, plex=vol01-01,vol01-02), the volume length will be zero.

Instead of specifying parameters on the command line, you can use a volmake description file to create a volume, as well as associated subdisks and plexes, by using the following command:

volmake -d  description_file

For detailed information about how to use volmake, and an example of the volmake description files, refer to Section 8.4.3 or to the volmake(8) reference page.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.6.2    Initializing Volumes

LSM automatically sets the states of plexes and volumes based on usage type. The volume start command performs a default volume initialization on a newly created volume; the volume init command is used for spanned volumes. When a multiple-plex volume is first configured and needs to be started, you must initialize the volume manually. Use a command like the following:

volume init  how volume_name [plex_name]

The how variable determines what the initialization does and what condition the volume and plexes have after the volume has been initialized. The most common form of manual initialization is setting the state of the volume and one of its plexes to CLEAN. To set the state of a volume and plex to CLEAN, use the following command:

volume init clean  volume1 plex

The following commands illustrate a specific example of how to set a volume and plex to the CLEAN state during manual initialization:

volmake -Ufsgen home plex=home-1,home-2
volume init clean home home-2
volume start home

In this example, the system administrator has created a new two-plex volume, and then realized that the data that existed on plex home-2 was the data that needed to be mirrored onto the plex labeled home-1. By setting the state of home-2 to CLEAN, LSM will correctly copy the data onto (revive) home-1 during the volume start operation.

To make all the plexes in a volume ACTIVE and enable the volume, use the following command:

volume init active  volume_name

To enable a volume to temporarily allow I/O to dump the contents of a tape into a volume, use the following command:

volume init enable  volume_name

This enables the volume and all its plexes, but leaves the plex utility state as EMPTY.

After the I/O is complete, issue the volume init active version of the command.

Note

When LSM is restarted (for example, after a system reboot) a volume that has been initialized using init enable will not start.

To zero out all the plexes, set them to ACTIVE, and enable the volume, use the following command:

volume init zero  volume_name

Caution

For both mirrored and nonmirrored volumes, this action destroys any existing data residing on the volume. Do not use the zero option unless you are sure that no critical data exists on any plex in the volume. Most initializations will destroy data on some plexes. To preserve data on a volume, use either volume init active or volume init clean, as appropriate.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.6.3    Changing Volume Attributes

Volume attributes such as read policy, error policies, ownership, permissions, and the values in the comment and utility fields for existing volumes can be changed. These attributes are changed whenever the use of the volume or users' needs change. Two LSM commands are used to set volume attributes:

Use the following command syntax to set volume attributes:

volume set  field = value ...  volume_name ...

voledit set  field = value ... volume_name ...

Table 7-2 describes the attributes that each command can set.

Table 7-2: Setting Volume Attributes

Command Attribute Description
voledit   The comment field
  tutil0, tutil1, tutil2 Descriptive string of volume contents
  putil0, putil1, putil2  
  fstype String indicating file system type
  writeback Boolean (on/off) specifying read error correction mode
  user Owner of volume
  group Group of volume
  mode Permission mode for volume
volume len Numeric length of volume
  log type (blkno/undef) specifier of block-change logging mode for volume
  log Length of the block-change logging log
  start opts Options to be executed to the volume start operation

For example, to change the owner of vol01 to susan, the group to staff, and the permissions to read/write for owner, group, and other:

voledit set user=susan group=staff mode=0666 vol01


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.6.3.1    Resizing a Volume with the volume Command

Resizing a volume is an instance of changing volume attributes that can be handled using either volassist or volume.

Striped volumes cannot be resized.

The new size of a volume can be specified in sectors, megabytes, or kilobytes. The unit of measure is indicated by adding the appropriate suffix to the length (s, m, or k). If no unit is specified, sectors are assumed.

To change the length of a volume using volume set, use the following command:

volume set len= value ... volume_name ...

For example, to change the length to 100000 sectors, use the following command:

volume set len=100000 vol01

Note

Note the following when using the volume command:


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.6.3.2    Changing Volume Read Policy

LSM offers the choice of three read policies:

The volume rdpol command sets the read policy for a volume. To set a read policy, use one of the following commands:

volume rdpol round  volume_name

or

volume rdpol prefer  volume_name preferred_plex_name

For example, the command line to set the read policy for volume vol01 to a round-robin read looks like this:

volume rdpol round vol01

The command line to set the policy for the same volume to read preferentially from the plex vol01-02 looks like this:

volume rdpol prefer vol01 vol01-02


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.6.4    Starting and Stopping Volumes

Like mounting and unmounting a file system, starting and stopping a volume affects its availability to the user. Starting a volume changes its state and makes it available for use. Stopping a volume makes it unavailable.

Starting a volume changes the volume state from DISABLED or DETACHED to ENABLED. The success of this operation depends on the ability to enable a volume. If a volume cannot be enabled, it remains in its current state. To start a volume, use the following command:

volrecover -s  volume_name ...

To start all DISABLED volumes, use the following command:

volrecover -s 

Stopping a volume changes the volume state from ENABLED or DETACHED to DISABLED. If the command cannot stop it, the volume remains in its current state. To stop a volume, use the following command:

volume stop  volume_name ...

For example, the command line to stop a volume labeled vol01 looks like this:

volume stop vol01

To stop all ENABLED volumes, use the following command:

volume stopall

If all plexes of the volume become STALE, put the volume in maintenance mode so that the plexes can be looked at while the volume is DETACHED and determine which plex to use for reviving the others. To place a volume in maintenance mode, use the following command:

volume maint  volume_name

To assist in choosing the revival source plex, list the unstarted volume and display its plexes.

To take plex vol01-02 off line, use the following command:

volmend off vol01-02

For ENABLED volumes, save a step by using volplex att without first invoking volmend on. This command works on an OFFLINE plex of an ENABLED volume (designated as vol01 in the example):

volplex att vol01 vol01-02

The volmend utility can change the state of an OFFLINE plex of a DISABLED volume to STALE, after which running volume start on the volume would revive the plex. To put a plex labeled vol01-02 in the STALE state, use the following command:

volmend on vol01-02

To make other state changes in a plex or a volume, refer to the subsequent sections on volume recovery options.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.6.5    Mirroring a Volume with the volplex Command

To mirror an existing volume using individual commands, first create a plex, then associate it to a volume. Use the following command syntax:

volmake plex  plex_name sd=subdisk_name ...
volplex att  volume_name plex_name

You can also use the volassist utility to mirror existing volumes.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.6.6    Removing a Plex (Mirror)

A plex contains a copy of the volume's data. A volume is mirrored when there are two or more plexes attached to the volume. If you no longer want to mirror a volume, you must disassociate the extra plex copy or copies.

To remove a plex, first disassociate the plex from the volume, then remove the plex and any associated subdisks. Use the following command syntax:

volplex dis  plex_name

voledit -r rm  plex_name

For example, the following output of volprint shows the volume volmir as a mirrored volume with attached plexes volmir-01 and volmir-02.

volprint -h volmir

TYPE NAME         ASSOC        KSTATE     LENGTH COMMENT
vol  volmir       fsgen        ENABLED     10240
plex volmir-01    volmir       ENABLED     10240
sd   disk01-03    volmir-01    -           10240
plex volmir-02    volmir       ENABLED     10240
sd   disk02-02    volmir-02    -           10240

To "unmirror" the volmir volume, you would need to remove the volume volmir-02 as follows:

  1. Disassociate volmir-02 from the parent volume:

    volplex dis volmir-02

  2. Remove volmir-02 from the LSM configuration database:

    voledit -r rm volmir-02

  3. Verify that the operation was successful:

    volprint -h volmir

    TYPE NAME         ASSOC        KSTATE     LENGTH COMMENT
    vol  volmir       fsgen        ENABLED     10240
    plex volmir-01    volmir       ENABLED     10240
    sd   disk01-03    volmir-01    -           10240
    

    Note that volmir-02 and its associated subdisk disk02-02 are no longer listed. Because the volmir volume now has only one plex attached to it, volmir is no longer mirrored.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.6.7    Removing a Volume

Once a volume is no longer necessary (it is inactive and archived, for example), you can remove the volume and free up the disk space for other uses.

To remove a volume, all references to the volume must be closed (that is, the file system in the volume must be unmounted, and the volume stopped using the volume stop command). The volume stop command stops all LSM activity to the volume.

After stopping the volume, enter the following command:

voledit -r rm  volume_name

To remove the volume volspan, enter:

voledit -r rm volspan

Note

The -r option of the voledit command removes multiple objects. Exercise caution when using it.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.7    Using LSM Volumes with UFS

The following sections summarizes how to create file systems on volumes.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.7.1    Make and Mount a File System

A file system is created on a volume and cannot be larger than the volume on which it is created.

To create a file system on a volume, use the following syntax:

newfs [ specific_options ] special_file disktype

The following table describes the qualifiers you can set with this command:
Variable Description
specific_options Options specific to this file system. See the newfs(2) reference page.
special_file The full pathname of the volume on which to create the file system (for example, /dev/rvol/rootdg/pubs).
disktype The disk whose characteristics map closely to the logical volume.

To create a file system on a volume called /dev/rvol/rootdg/pubs, first create the volume called pubs using volassist. Once the volume is created, enter the following command:

newfs /dev/rvol/rootdg/pubs rz29b

After creating the file system, mount it using the following command:

mount  block_special mount_point

For example, to mount the file system /dev/vol/rootdg/pubs, enter:

mount /dev/vol/rootdg/pubs  /pubs


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.7.2    Unmount a File System

If you no longer need to access the data in a file system, you can unmount it using the following command syntax:

umount block_special | mount_point

To unmount the /dev/vol/rootdg/pubs, file system, enter:

unmount /dev/vol/rootdg/pubs


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.7.3    Display Mounted File Systems

It is important to keep track of which file systems are mounted and which are not. This saves users from trying to access unmounted file systems.


You can look at the status of file systems by entering the mount command. For example:

mount 

/dev/rz3a on / type ufs (rw)
/proc on /proc type procfs (rw)
/dev/vol/rootdg/vol-rz3g on /usr type ufs (rw)
/dev/vol/rootdg/vol01 on /ufs1 type ufs (rw)


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.8    Using LSM Volumes with AdvFS

You can use LSM volumes in AdvFS domains in the same manner that you use disk partitions. The LSM volume names used with AdvFS should be unique, regardless of the LSM disk group that the LSM volume is from.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.8.1    Creating a New AdvFS Domain

Use the LSM volume's full device pathname when using an LSM volume with an AdvFS domain. For example, to create a new AdvFS domain called lsmdom using an existing LSM volume, vol01, in the rootdg disk group, enter:

mkfdmn /dev/vol/rootdg/vol01 lsmdom

To create a file set called lsmfset with the lsmdom domain, enter:

mkfset lsmdom lsmfset

To mount the AdvFS fileset lsmfset on /advfs, enter:

mount -t advfs lsmdom#lsmfset /advfs

For further information about setting up and using domains and file sets, refer to the AdvFS documentation set.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.8.2    Adding an LSM Volume to an Existing Domain

When configuring an LSM volume with AdvFS, use the full pathname of the LSM volume's device file. For example, to add the LSM volume vol02 in the LSM rootdg disk group to the existing AdvFS domain called lsmdom, enter:

addvol /dev/vol/rootdg/vol02 lsmdom



[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.9    Using LSM Volumes for Secondary Swap Space

The system swap space is a vital system resource. In fact, if disk errors occur in the swap space, a system crash is likely to occur. You can guard against disk I/O errors in the secondary swap space by using an LSM mirrored volume for the secondary swap.

To do this, create an LSM volume and add it as secondary swap space using the swapon command and set the volume's start options to norecov. If you are adding multiple disks as LSM volumes to secondary swap, add the disks as several individual LSM volumes rather than striping or concatenating them into a single, larger LSM volume. Adding multiple, individual LSM volumes is preferable because the swapping algorithm automatically distributes its data across multiple disks to improve performance.

The following example demonstrates the commands you use to create and add a mirrored volume ( swapvol1 with a size of 102400 sectors) to the secondary swap space:

volmake sd disk01-01 disk01,0,102400

volmake sd disk02-01 disk02,0,102400

volmake plex swapvol1-01 sd=disk01-01

volmake plex swapvol1-02 sd=disk02-01

volmake vol swapvol1 plex=swapvol1-01 usetype=gen \  start_opts=norecov

volplex att swapvol1 swapvol1-02

volume start swapvol1

volprint -ht swapvol1

You can add an LSM volume for secondary swap space by editing the /etc/fstab file to add the following line:

/dev/vol/rootdg/swapvol1 swap2 ufs sw 0 2

Then, enter the following commands:

swapon /dev/vol/swapvol1

swapon -s

See the swapon(8) and the fstab(4) reference pages for complete information about these commands and setting up secondary swap.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.10    Using LSM Volumes with Databases

LSM volumes have block and character device special files in the /dev/vol and /dev/rvol directories, respectively. For example, the volume dbvol in the disk group dbgrp, would have the block device file /dev/vol/dbgrp/dbvol and the character special device file /dev/rvol/dbgrp/dbvol. If the database uses the raw interface, you can specify the character special device file for an LSM volume for use with the database.

To change the owner, group, or mode of the special device files, use the LSM voledit command. Do not change these attributes using standard UNIX commands (such as chown, chgrp, or chmod).

The following example shows how to change user and group to dba and the mode to 0600 for the disk group dbgrp and volume vol_db:

voledit -g dbgrp set user=dba group=dba mode=0600 vol_db


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.11    Unencapsulating LSM Volumes

When you unencapsulate an LSM volume, the LSM nopriv disk is removed, and the disk label's fstype field is marked unused. You should use the disklabel command to set the fstype field to the appropriate file system type. For example, if the disk partition is used for AdvFS, it should be labeled AdvFS. If it is used for UFS, it should be labeled 4.2BSD. See the disklabel(8) reference page for information on setting the fstype field.

For information on unencapsulating the /usr and /var file systems, refer to Section C.20.

For information on unencapsulating the root file system and primary swap area, refer to Section C.19.

The following sections describe how to unencapsulate LSM volumes and return to using disk partitions or AdvFS domains.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


7.11.1    Unencapsulating UNIX Partitions

The following steps describe how to unencapsulate LSM volumes and return to using disk partitions.

In the example shown here, the volume named vol-rz4g, in the staffdg disk group on the rz4g partition, is being removed from LSM control. This example assumes that a UFS file system on rz4g was previously encapsulated. In addition, it assumes that the LSM configuration for volume vol-rz4g has not been changed (for example, moved to a different disk or striped).

  1. Disable the vol-rz4g volume in the staffdg disk group:

    volume -g staffdg stop vol-rz4g 

  2. Remove the volume vol-rz4g from the staffdg disk group, recursively deleting the volume, plexes, and subdisks:

    voledit -g staffdg -rf rm vol-rz4g

  3. Remove the disk media records for rz4g from LSM control:

    voldg rmdisk rz4g

  4. Remove the disk access records for rz4g from LSM control:

    voldisk rm rz4g

    At this point, LSM no longer knows about the rz4g nopriv disk.

  5. Edit the /etc/fstab file to mount the file system that is on the rz4g partition.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Chapter] [Index] [Help]


7.11.2    Unencapsulating an AdvFS Domain

The following steps describe how to unencapsulate LSM volumes and return to using AdvFS domains. In the example shown here, the domain named dom1, which includes the partition rz4e, was encapsulated into a volume named vol-rz4e in the staffdg disk group.

  1. Disable the vol-rz4e volume in the staffdg disk group:

    volume -g staffdg stop vol-rz4e

  2. Remove the volume from the disk group:

    voledit -g staffdg -rf rm vol-rz4e

  3. Remove the disk media records and disk access records from LSM control:

    voldg rmdisk rz4e
    voldisk rm rz4e

  4. Change the domain disk link:

    cd /etc/fdmns/dom1
    rm vol-rz4e
    ln -s /dev/rz4e rz4e