|
|
VxVM System Administrator's Guide
Disks and disk groups must be initialized and defined to the Volume Manager before volumes can be created. Once disks and disk groups are defined, volumes can be created in either of the following ways:
vxassist
interface. The vxassist
utility requires only the basic attributes of the desired volume as input and uses this information to create any associated plexes and subdisks. vxassist
can also be used to modify existing volumes, in which case it also automatically modifies any underlying or associated objects. vxassist
uses default values for many volume attributes, unless specific values are provided.
vxassist
, refer to the VERITAS Volume Manager User's Guide.
vxassist
. Some of the commands and procedures documented in this chapter do not normally need to be performed by system administrators.vxassist
vxassist
command provides a convenient approach to volume management. vxassist
acts as an automated one-step interface to Volume Manager operations. Unlike most other VxVM commands, vxassist
does not require a thorough understanding of Volume Manager concepts. vxassist
is capable of accomplishing alone many tasks that would otherwise require the use of a sequence of several other VxVM utilities. vxassist
automatically takes care of all underlying and related operations that would otherwise need to be performed manually by the user (in the form of other commands).
vxassist
does not conflict with the existing VxVM utilities or preclude their use. Objects created by vxassist
are compatible and inter-operable with objects created manually using the other VxVM utilities and interfaces, and vice versa.
vxassist
does the following:
vxassist
, refer to the vxassist
(1M) manual page.vxassist
Command Features vxassist
command provides a convenient, one-step interface to the Volume Manager and is especially useful for basic and commonly used administrative operations.
In general, it is more convenient to use vxassist than a series of other VxVM commands. Some of the advantages of using vxassist
include:
vxassist
involves only one step on the part of the user. vxassist
automatically takes care of all underlying and related operations (such as creating associated subdisks and plexes) that would otherwise need to be performed manually by the user through additional commands.
vxassist
, yet can optionally specify additional parameters to modify its actions.
vxassist
operations result in a set of configuration changes that either succeed or fail as a group, rather than individually. Most vxassist
operations therefore function in such a way that system crashes or other interruptions do not leave intermediate states that need to be cleaned up. If vxassist
encounters an error or some other exceptional condition, it will exit without leaving behind partially-changed configurations; the system will be left in the same state as it was prior to the attempted vxassist
operation.
vxassist
Works vxassist
utility allows users to create and modify simple volumes. The user specifies the basic volume creation or modification requirements and vxassist
proceeds to perform all of the necessary underlying tasks.
The amount of information that vxassist
requires from the user is minimal because vxassist
obtains most of the information it needs from other sources. vxassist
obtains information about the existing objects and their layouts from the objects themselves. For operations requiring new disk space, vxassist
seeks out available disk space and tries to allocate it in the configuration that conforms to the layout specifications and offers the best use of free space.
The vxassist
command typically takes the following form:
vxassist keyword volume_name [attributes...]where keyword selects the specific operation to perform. The first argument after any
vxassist
keyword is always a volume name. The volume name is followed by a set of attributes. For details on available vxassist
keywords and attributes, refer to the vxassist
(1M) manual page.
vxassist
creates and manipulates volumes based on a set of established defaults, but also allows the user to supply preferences for each operation.
vxassist
Defaults vxassist
invocation is designed to be as simple as possible, while allowing its behavior to be tailored when necessary. vxassist
uses a set of tunable parameters, which can be specified in defaults files or at the command line. The tunable parameters default to reasonable values if they are not mentioned anywhere. Any tunables listed on the command line override those specified elsewhere. The tunable parameters are specified as follows:
vxassist
-d
alt_defaults_file.
vxassist
is controlled by the tunables specified in the /etc/default/vxassist
file. The format of the defaults file is a list of attribute=value pairs separated by new lines. These attribute=value pairs are the same as those specified as options on the vxassist
command line (refer to the vxassist
(1M) manual page for details).
The following is a sample vxassist
defaults file:
# by default: # create unmirrored, unstriped volumes # allow allocations to span drives # with RAID-5 create a log, with mirroring don't create a log # align allocations on cylinder boundaries layout=nomirror,nostripe,span,nocontig,raid5log,noregionlog, diskalign # use the fsgen usage type, except when creating RAID-5 volumes usetype=fsgen # allow only root access to a volume mode=u=rw,g=,o= user=root group=root # when mirroring, create two mirrors nmirror=2 # for regular striping, by default create between 2 and 8 stripe # columns max_nstripe=8 min_nstripe=2 # for RAID-5, by default create between 3 and 8 stripe columns max_nraid5stripe=8 min_nraid5stripe=3 # create 1 log copy for both mirroring and RAID-5 volumes, by default nregionlog=1 nraid5log=1 # by default, limit mirroring log lengths to 32Kbytes max_regionloglen=32k # use 64K as the default stripe unit size for regular volumes stripe_stwid=64k # use 16K as the default stripe unit size for RAID-5 volumes raid5_stwid=16k
vxdctl
vxconfigd
) is the interface between the VxVM utilities and the kernel vxconfig
device driver. The vxconfig
device is a special device file created by the Volume Manager that interacts with vxdctl
to make system configuration changes.
Some vxdctl
operations involve modifications to the volboot
file, which indicates the locations of some root configuration copies.
The vxdctl
utility is the interface to vxconfigd
and is used for:
vxconfigd
daemon
volboot
file, which contains a list of some disks containing root configuration databases (this is not normally necessary, as VxVM usually locates all disks on the system automatically)
vxdctl
, refer to the vxdctl
(1M) manual page.vxedit
vxedit
utility has two functions:
vxedit
allows the system administrator to modify certain records in the volume management databases. Only fields that are not volume usage-type-dependent can be modified.
vxedit
can be used to remove or rename VxVM objects.
vxedit
. This means that vxedit
cannot remove:
-r
) to the removal option of vxedit
removes all objects from the specified object downward. In this way, a plex and its associated subdisks, or a volume and its associated plexes and their associated subdisks, can be removed by a single invocation of this command.
vxedit
, refer to the vxedit
(1M) manual page. vxmake
vxmake
utility is used to add a new volume, plex, or subdisk to the set of objects managed by VxVM. vxmake
adds a new record for that object to the VxVM database. Records can be created entirely from parameters specified on the command line, or they can be created using a description file. If operands are specified on the command line, then the first operand is a keyword that determines the kind of object to be created, the second operand is the name given to that object, and additional operands specify attributes for the object. If no operands are specified on the command line, then a description file is used to specify what records to create.
A description file is a file that contains plain text which describes the objects to be created with vxmake
. A description file can contain several commands, and can be edited to perform a list of operations. The description file is read from standard input, unless the -d
description_file option specifies a filename. The following is a sample description file:
#rectyp #name #options sd disk3-01 disk=disk3 offset=0 len=10000 sd disk3-02 disk=disk3 offset=25000 len=10480 sd disk4-01 disk=disk4 offset=0 len=8000 sd disk4-02 disk=disk4 offset=15000 len=8000 sd disk4-03 disk=disk4 offset=30000 len=4480 plex db-01 layout=STRIPE ncolumn=2 stwidth=16k sd=disk3-01:0/0,disk3-02:0/10000,disk4-01:1/0,\ disk4-02:1/8000, disk4-03:1/16000 sd ramd1-01 disk=ramd1 len=640 comment="Hot spot for dbvol plex db-02 sd=ramd1-01:40320 vol db usetype=gen plex=db-01,db-02 readpol=prefer prefname=db-02 comment="Uses mem1 for hot spot in last 5mThis description file specifies a volume with two plexes. The first plex has five subdisks on physical disks. The second plex is preferred and has one subdisk on a volatile memory disk.
For detailed information about how to use vxmake
, refer to the vxmake
(1M) manual page.
vxmend
vxmend
utility performs miscellaneous VxVM usage-type-specific operations on volumes, plexes, and subdisks. These operations are used to fix simple problems in configuration records (such as clearing utility fields, changing volume or plex states, and offlining or onlining volumes or plexes).
vxmend
is used primarily to escape from a state that was accidentally reached. The offline and online functions can be performed with disk-related commands.
For detailed information about how to use vxmend
, refer to the vxmend
(1M) manual page.
vxplex
vxplex
utility performs VxVM operations on plex or on volume-and-plex combinations. 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.
The vxplex
utility can be used to do the following:
vxplex
, refer to the vxplex
(1M) manual page.vxprint
vxprint
utility provides a flexible method of displaying information from records in a VxVM configuration database. This command can be used to display partial or complete information about any or all objects. The format can be hierarchical to clarify relationships between VxVM objects. vxprint
can tailor its output for use by UNIX system utilities such as awk
, sed
, or grep
.
For detailed information about how to use vxprint
, refer to the vxprint
(1M) manual page.
vxsd
vxsd
utility is used to maintain subdisk-mirror associations. vxsd
can associate a subdisk with a mirror or dissociate a subdisk from its associated mirror, to move the contents of a subdisk to another subdisk, to split one subdisk into two subdisks that occupy the same space as the original, or to join two contiguous subdisks into one.
vxsd
operations can take a considerable amount of time to complete.
vxsd
, refer to the vxsd
(1M) manual page. vxstat
vxstat
utility prints statistics information about VxVM objects and block devices under VxVM control. vxstat
reads the summary statistics for Volume Manager objects and formats them to the standard output. These statistics represent VxVM activity from the time the system was initially booted or from the last time statistics were cleared. If no VxVM object name is specified, then statistics from all volumes in the configuration database are reported.
For detailed information about how to use vxstat
, refer to the vxstat
(1M) manual page and Chapter 2, "VxVM Performance Monitoring."
vxtrace
vxtrace
utility prints kernel I/O error or I/O error trace event records on the standard output or writes them to a file in binary format. Binary trace records written to a file can be read back and formatted by vxtrace
as well.If no operands are given, then either all error trace data or all I/O trace data on all virtual disk devices are reported. With error trace data, it is possible to select all accumulated error trace data, to wait for new error trace data, or both (the default). Selection can be limited to a specific disk group, to specific VxVM kernel I/O object types, or to particular named objects or devices.
For detailed information about how to use vxtrace
, refer to the vxtrace
(1M) manual page and Chapter 2, "VxVM Performance Monitoring."
vxvol
vxvol
utility performs are:
Stopping a volume changes its state from ENABLED or DETACHED to DISABLED (however, it is seldom useful to stop a volume).
One of these read policies can be selected:
round
--prescribes round-robin reads of enabled plexes
prefer
--prescribes preferential reads from a specified plex
select
--chooses an appropriate policy
vxvol
, refer to the vxvol
(1M) manual page.
vxmake
. The steps to create a subdisk include specifying the:
vxmake sd name disk,offset,len
For example, the command to create a subdisk labeled disk02-01
that starts at the beginning of disk disk02
and has a length of 8000 sectors looks like this:
vxmake sd disk02-01 disk02,0,8000Commands take sizes in sectors. Adding a suffix (such as
k
, m
, or g
) changes the unit of measure.
vxedit rm subdisk_nameFor example, the command line to remove a subdisk labeled
disk02-01
looks like this:
vxedit rm disk02-01
vxprint
utility displays information about VxVM objects. To display general information for all subdisks, use the following command:
vxprint -stThe
-s
option specifies information about subdisks. The -t
option prints a single-line output record that depends on the type of object being listed. To display complete information about a particular subdisk, use the following command:
vxprint -l subdisk_nameFor example, the command to obtain all information on a subdisk labeled
disk02-01
looks like this:
vxprint -l disk02-01This command provides the following information:
Disk group: rootdg
Subdisk: disk02-01 info: disk=disk02 offset=0 len=205632 assoc: vol=mvol plex=mvol-02 (offset=0) flags: enabled device: device=c2b0t0d1s7 path=/dev/dsk/c2b0t0d1s4 \ diskdev=32/68
If the system administrator has already created all the subdisks needed for a particular plex, subdisks are associated at plex creation by using the command:
vxmake plex plex_name sd=subdisk_name,...For example, the following command creates the plex
home-1
and associates subdisks disk02-01
, disk02-00
, and disk02-02
with the plex home-1
during the plex creation process:
vxmake plex home-1 sd=disk02-01,disk02-00,disk02-02Subdisks are associated in order starting at offset 0. Using a command like this one eliminates the need to specify the multiple commands necessary to create the plex and then associate each of the subdisks with that plex. In this example, the subdisks are associated to the plex in the order they are listed (after the
sd=
); the disk space defined as disk02-01
will be first, the disk space of disk02-00
is second, and disk02-02
is third. This method of associating subdisks is convenient during initial configuration. Subdisks can also be associated with a plex that already exists. One or more subdisks can be associated with an existing plex as follows:
vxsd assoc plex_name sd_name [sd_name2 sd_name3 ...]For example, the command line to associate subdisks labeled
disk02-01
, disk02-00
, and disk02-02
with a plex labeled home-1
looks like this:
vxsd assoc home-1 disk02-01 disk02-00 disk02-01If the plex is not empty, the new subdisks are added after any subdisks that are already associated with the plex, unless the
-l
option is specified with the command. The -l
option provides a way to associate subdisks at a specific offset within the plex.
The -l
option is needed in a case where a system administrator has created a sparse plex for a particular volume, and wishes to make this plex complete. To make the plex complete, it is necessary to create a subdisk of exactly the size needed to fill the hole in the sparse plex, and then associate the subdisk with the plex by specifying the offset of the beginning of the hole in the plex. Use the following command to accomplish this task:
vxsd -l offset assoc sparse_plex_name exact_size_subdisk
vxsd -l column_#/offset assoc plex_name sd_name ...If only one number is specified with the
-l
option for striped plexes, the number is interpreted as a column number and the subdisk is associated at the end of the column. For a description of Dirty Region Logging, refer to "Dirty Region Logging" in "Chapter 1" and "Dirty Region Logging Guidelines" in Chapter 2. Log subdisks are ignored as far as the usual plex policies are concerned, and are only used to hold the dirty region log.
vxsd aslog plex subdiskwhere subdisk is the name of the subdisk to be used as a log subdisk. The plex must be associated with a mirrored volume before DRL will take effect.
For example, the command line to associate a subdisk labeled disk02-01
with a plex labeled vol01-02
(which is already associated with volume vol01
) looks like this:
vxsd aslog vol01-02 disk02-01
vxassist addlog volume_name disk
This command automatically creates a log subdisk within a log plex for the specified volume.
vxsd dis subdisk_nameTo dissociate a subdisk labeled
disk02-01
from the plex with which it is currently associated, use the following command:
vxsd dis disk02-01
vxsd -orm dis subdisk_name
vxedit
utility changes information related to subdisks. To change information relating to a subdisk, use the following command:
vxedit set field=value ... subdisk_nameFor example, the command line to change the comment field of a subdisk labeled
disk02-01
looks like this:
vxedit set comment= "new comment" disk02-01The subdisk fields that can be changed using
vxedit
are:
putil[n]
fields
tutil[n]
fields
len
(only if the subdisk is dissociated)
putil0
field prevents the subdisk from being used as part of a plex, if it is not already.
vxsd mv old_subdisk_name new_subdisk_nameFor the subdisk move operation to perform correctly, the following conditions must be met:
ENABLED
) volume.
vxsd -s size split subdisk_name newsd1 newsd2where subdisk_name is the name of the original subdisk, newsd1 is the name of the first of the two subdisks that will be created, and newsd2 is the name of the second subdisk to be created. The
-s
option is required to specify the size of the first of the two subdisks that will be created. The second subdisk will take up the remaining space used by the original subdisk.If the original subdisk is associated with a plex before the operation, upon completion of the split, both of the resulting subdisks will be associated with the same plex.
To split the original subdisk into more than two subdisks, repeat the previous command as many times as necessary on the resulting subdisks.
vxsd join subdisk1 subdisk2 new_subdisk
Plex operations include:
vxmake
command creates VxVM objects. To create a plex from existing subdisks, use the following command:
vxmake plex plex_name sd=subdisk_name,
...
For example, the command to create a concatenated plex labeled vol01-02
using two existing subdisks labeled disk02-01
and disk02-02
is:
vxmake plex vol01-02 sd=disk02-01,disk02-02To create a striped plex, additional attributes need to be specified. For example, the command to create a striped plex named
pl-01
with a stripe width of 32 sectors and 2 columns is:
vxmake plex pl-01 layout=STRIPE stwidth=32 ncolumn=2\ sd=disk01-01,disk02-01
vol01-01
, for this example):
vxplex dis vol01-01
vxmake -U gen voltemp plex=vol01-01
vxvol start tempvol
vxvol stop tempvol
vxplex dis vol01-01
vxplex att vol01 vol01-01
vxedit rm voltempFor information on an alternative online backup method using the
vxassist
command, refer to "Performing Online Backup."
vxplex att volume_name plex_nameFor example, the command to associate a plex labeled
vol01-02
with a volume labeled vol01
looks like this:
vxplex att vol01 vol01-02Alternately, if the volume has not been created, a plex (or multiple plexes) can be associated with the volume to be created as part of the volume create command:
vxmake -U usetype vol volume_name plex=plex_name1, plex_name2...For example, the command line to create a mirrored,
fsgen
-type volume labeled home
and associate two existing plexes labeled home-1
and home-2
looks like this:
vxmake -Ufsgen vol home plex=home-1,home-2
vxassist mirror volume_name
vxplex -o rm dis plex_nameTo dissociate and remove a plex labeled
vol01-02
, use the following command:
vxplex -o rm dis vol01-02This removes the plex
vol01-02
and all associated subdisks.
vxplex
dis
plex_namevxedit
-r
rm
plex_namevxplex
-o
rm
dis
.
vxprint -lpTo display detailed information about a specific plex, use the following command:
vxprint -l plex_nameListing plexes helps identify free plexes that can be used for building volumes. Using the
vxprint
utility with the plex (-p
) option lists information about all plexes; the -t
option prints a single line of information about the plex. To list free plexes, use the following command:
vxprint -pt
comment
field and the putil
and tutil
fields are used by
the utilities after plex creation. putil
attributes are
maintained on reboot; tutil
fields are temporary and are
not retained on reboot. Both putil
and tutil
have three uses and are numbered according to those uses. These fields
can be modified as needed. VxVM uses the utility fields marked
putil0
and tutil0
. Other VERITAS products use
those marked putil1
and tutil1
; those marked
putil2
and tutil2
are user fields. Table 1 details the uses for the
putil
and tutil
fields.
Field | Description |
---|---|
putil0 | This utility field is reserved for use by VxVM utilities and is retained on reboot. |
putil1 | This utility field is reserved for use by high-level utilities. such as the Visual Administrator interface. This field is retained on reboot. |
putil2 | This utility field is reserved for use by the system administrator or site-specific applications. This field is retained on reboot. |
tutil0 | This utility field is reserved for use by VxVM utilities and is cleared on reboot. |
tutil1 | This utility field is reserved for use by high-level utilities. such as the Visual Administrator interface. This field is cleared on reboot. |
tutil2 | This utility field is reserved for use by the system administrator or site-specific applications. This field is cleared on reboot. |
To change plex attributes, use the following command:
vxedit set field=value ... plex_name ...The command:
vxedit set comment="my plex" tutil2="u" user="admin" vol01-02uses
vxedit
to set the following attributes:
my
plex
tutil2
to u
to indicate that the subdisk is in use
admin
putil0
field to a non-null string, as specified in the following command:
vxedit set putil0="DO-NOT-USE" vol01-02
ENABLED
), VxVM provides mechanisms by which plexes can be temporarily disconnected from the volume. This is useful, for example, when the hardware on which the plex resides needs repair or when a volume has been left unstartable and a source plex for the volume revive must be chosen manually.
Resolving a disk or system failure includes taking a volume offline and attaching and detaching its plexes. The two commands used to accomplish disk failure resolution are vxmend
and vxplex
.
To take a plex OFFLINE
so that repair or maintenance can be performed on the physical disk containing that plex's subdisks, use the following command:
vxmend off plex_name ..If a disk drive suffered a head crash, the system administrator should put all plexes that have associated subdisks represented on the affected drive
OFFLINE
. For example, if plexes vol01-02
and vol02-02
had subdisks on a drive to be repaired, use the following command:
vxmend off vol01-02 vol02-02This command places
vol01-02
and vol02-02
in the OFFLINE
state, and they remain in that state until explicitly changed.
vxplex det plex_nameFor example, the command line to temporarily detach a plex labeled
vol01-02
and place it in maintenance mode looks like this:
vxplex det vol01-02This command temporarily detaches the plex, but maintains the association between the plex and its volume; however, the plex will not be used for I/O. A plex detached with the preceding command will be recovered on a system reboot. The plex state is set to
STALE
, so that if a vxvol
start
command is run on the appropriate volume (for example, on system reboot), the contents of the plex will be recovered and it will be made ACTIVE
. When the plex is ready to return as an active part of its volume, follow this procedure:
ENABLED
, start it using
vxvol start volume_name
CLEAN
using the command:
vxmend fix clean plex_name
ENABLED
, issue the following command:
vxplex att volume_name plex_name ...As with returning an
OFFLINE
plex to ACTIVE
, this command recovers the contents of the plex(es), then sets the plex state to ACTIVE
. ACTIVE
).
If the volume is currently ENABLED
, use the following command:
vxplex att volume_name plex_name ...For example, the command for a plex labeled
vol01-02
on a volume labeled vol01
looks like this:
vxplex att vol01 vol01-02This starts to recover the contents of the plex and, after the revive is complete, sets the plex utility state to
ACTIVE
.
If the volume is not in use (not ENABLED
), use the following command:
vxmend on plex_nameFor example, the command for a plex labeled
vol01-02
looks like this:
vxmend on vol01-02In this case, the state of
vol01-02
is set to STALE
, so that when the volume is next started, the data on the plex will be revived from the other plex, and incorporated into the volume with its state set to ACTIVE
.
If it becomes necessary to manually change the state of a plex, refer to "Volume Recovery." See the vxmake
(1M) and vxmend
(1M) manual pages for more information about these commands.
ENABLED
) volume.
-o
force
option is required. If the new plex is longer, or less sparse, than the original plex, the data that exists on the original plex will be copied onto the new plex. Any area that was not on the original plex, but is represented on the new plex, will be filled from other complete plex associated with the same volume. If the new plex is longer than the volume itself, then the remaining area of the new plex above the size of the volume will not be initialized and remains unused. The command to move data from one plex to another is:
vxplex mv original_plex new_plex
vxplex cp volume_name new_plexAfter the copy operation is complete, new_plex will not be associated with the specified volume volume_name. The plex contains a complete copy of the volume data. The plex that is being copied should be the same size or larger than the volume; otherwise, an incomplete copy of the data results. For the same reason, new_plex also should not be sparse.
/dev/vx/dsk
directory and a character device in the /dev/vx/rdsk
directory. A volume can be used as a partition device. Volume operations include:
vxassist
or one or more other commands can be used to accomplish the same task and both approaches are described. Detailed descriptions about the commands used to perform volume operations are contained in the VxVM manual pages.
vxassist
or vxmake
.
The length of a new volume can be specified in sectors, kilobytes, megabytes, or gigabytes. The unit of measure is indicated by adding the appropriate suffix to the length (s
, m
, k
, or g
). If no unit is specified, sectors are assumed.
vxassist
vxassist
command can be used to create volumes with default settings or with user-specified attributes. vxassist
automatically creates and attempts to enable new volumes. If the volume fails to be enabled, vxassist
will attempt to remove it and release the space used to allocate that volume.
To create a simple volume using vxassist
and its default settings, use the following command:
vxassist make volume_name lengthFor example, the following command creates a volume named
voldef
with a length of 10 megabytes on any available disk(s):
vxassist make voldef 10mAdditional parameters can be specified to
vxassist
to reflect the new volume's attributes. Refer to the vxassist
(1M) manual page for details.
The following example illustrates how to create a volume named volzebra
that is striped across disk03
and disk04
, has the fsgen
usage type, and is 10 megabytes long:
vxassist -Ufsgen make volzebra 10m layout=stripe disk03 disk04
vxmake
vxmake
, use the following command:
vxmake -Uusage_type vol volume_name len=length plex=plex_name,...If you do not specify a length, the volume length will equal the length of the plex to which it is attached. You can select a length (less than or equal to the length of the plex) by specifying a length with the
len=
parameter. You can also create a volume without attaching a plex to it. You do this by omitting the plex=
parameter. In this case, you must specify a length. The volume you create will not be available for use until you attach a plex to it using vxplex att.
Examples of commands for creating an fsgen
-type volume called vol01
are:
vxmake -Ufsgen vol vol01 len=100000or
vxmake vol vol01 use_type=fsgen plex=vol01-01,vol01-2The usage type for a volume can be specified as either
-Ufsgen
or use_type=fsgen
. If a length is not specified or associated plexes are not identified, the length will be 0.
Instead of specifying parameters on the command line, you can use a vxmake
description file to create a volume, as well as associated subdisks and plexes, by using the following command:
vxmake -d description_fileFor detailed information about how to use
vxmake
, and an example of the vxmake
description files, refer to "Creating VxVM Objects With vxmake" in this chapter or the vxmake
(1M) manual page.vxassist
or one of the other higher-level interfaces, the state of the plexes will be properly set. However, when vxmake
has been used to create a volume, the states of its plexes must be set manually before the volume can be made available for use through the vxvol
start
command. The command for setting the state of a volume's plexes is:
vxvol init state volume_name [plex_name]where the state variable determines what the initialization does and what condition the volume and plexes will have after the volume has been initialized.
The most common form of manual initialization is setting the state of the volume to CLEAN
. The following examples show how to do this for mirrored and non-mirrored volumes. In the simplest case, in which a volume has been created containing only one plex (mirror), the state of the plex is set to CLEAN
. This is because there is no need for any synchronization of the data on the disk. Since there is only one plex in the volume, it is not necessary to specify the plex_name argument. The command to set the state of this volume to CLEAN
is:
vxvol init clean volume_name
vol01
has multiple mirrors associated with it, one of the plexes must be chosen to which the other plexes are synchronized. For instance, if plex vol01-02
has been created over disk space that contained data that needed to be accessed through the volume after it is made available, then the following command would ensure that the data is synchronized out to the other plexes when the volume is started:
vxvol init clean vol01 vol01-02This command will set the state of
vol01-02
to CLEAN
and the remainder of the plexes to STALE
, so that they will be properly synchronized at the time the volume is made available. The administrator may avoid the initial synchronization of the volume in order to save time, but only when certain that none of the plexes contain data that will be the final contents of the volume. Under such a situation, it is possible to temporarily initialize the state of the volume so that the data can be loaded without having to perform a synchronization first. The command to do this is:
vxvol init enable volume_nameThis enables the volume and all its plexes, but leaves the plex utility states set to
EMPTY
. After the entire volume's contents have been restored, both mirrors contain exactly the same data and will not need to be synchronized using the vxvol
start
operation. Such a volume (for example, home1
) could be initialized for use and started at the same time using the following command:
vxvol init active home1
vxvol
init
clean
method.
vxvol init zero volume_name
vxassist
command can provide information on the largest possible size for a volume that can currently be created with a given set of attributes. vxassist
can also provide similar information for how much an existing volume can be extended under the current circumstances.To determine the largest possible size for the volume to be created, use the command:
vxassist maxsize attributes...For example, to determine the maximum size for a new RAID-5 volume on available disks, enter:
vxassist maxsize layout=raid5This does not actually create the volume, but returns output such as the following (in sectors, by default):
Maximum volume size: 376832 (184Mb)If, however, a volume with the specified attributes cannot be created, an error similar to the following might result:
vxvm:vxassist: ERROR: No volume can be created within the given constraintsTo determine how much an existing volume can grow, use the command:
vxassist maxgrow volume_nameFor example, the command:
vxassist maxgrow raidvoldoes not actually resize the volume, but results in output similar to the following:
Volume raidvol can be extended by 366592 to 1677312 (819Mb)Notice that this output indicates both the amount by which the volume can be increased and the total size to which the volume can grow (in sectors, by default).
To remove a volume, use the following command:
vxedit rm volume_name
or
vxedit -rf rm volume_name
The -r
option indicates recursive removal, which means the removal of all plexes associated with the volume and all subdisks associated with those plexes. The -f
option forces removal, and is necessary if the volume is enabled.
-r
option of vxedi
t removes multiple objects. Exercise caution when using it.
To list information on all volumes, use the following command:
vxprint -vt
To limit the display of vxprint
to a single object, specify the object name after the vxprint
command.
For example, to display detailed information about a specific volume, use the following command:
vxprint -l volume_name
If no volume is specified, detailed information is given for all volumes by using the following command:
vxprint -vl
To display the plexes for a volume labeled vol01
, use the following command:
vxprint -vt vol01
This command displays the volume, its plexes, and the subdisks in those plexes.
You can also display the plexes for vol01
with the command:
vxprint -e 'assoc= "vol01"'
There are two VxVM commands associated with setting volume attributes:
vxedit
command sets those attributes that are not usage-type dependent.
vxvol
command sets only those attributes that are usage-type dependent.
vxedit
as follows:
vxedit set field=value0 ... volume_name ...
Use vxvol
as follows:
vxvol set field=value0 ... volume_name ...
Table 2 details which attributes can be set by each command.
chgrp
, chown
, and chmod
commands is ineffective. It is necessary to use vxedit
set
to modify these values.
susan
and the permissions to read/write for owner, group, and other:
vxedit set user=susan group=staff mode=0666 vol01
vxassist
or vxvol
.
The new size of a volume can be specified in sectors, kilobytes, megabytes, or gigabytes. The unit of measure is indicated by adding the appropriate suffix to the length (s
, k
, m
, or g
). If no unit is specified, sectors are assumed.
The vxresize
command can be used to resize a volume containing a file system. Although other commands can be used to resize volumes containing file systems, vxresize
offers the advantage of automatically resizing the file system as well as the volume. For details on how to use vxresize
, see the vxresize
(1M) manual page. Note that only vxfs
and ufs
file systems can be resized with vxresize
.
vxassist
vxassist
can resize a volume in any of the following ways:
growto
--increase volume to specified length
growby
--increase volume by specified amount
shrinkto
--reduce volume to specified length
shrinkby
--reduce volume by specified amount
vxfs
file system, you can shrink the file system before shrinking the volume.
vxassist
automatically seeks out available disk space. To increase a volume to a specified length, use the command:
vxassist growto volume_name new_length
To increase a volume by a certain amount, use the command:
vxassist growby volume_name length_change
To reduce a volume to a specified length, use the command:
vxassist shrinkto volume_name new_length
To reduce a volume by a certain amount, use the command:
vxassist shrinkby volume_name length_change
vxvol
vxvol
set
, use the following command:
vxvol set len=value ... volume_name ...
For example, to change the length to 100000 sectors, use the following command:
vxvol set len=100000 vol01
vxvol
set
len
command cannot increase the size of a volume unless the needed space is
available in the plexes of the volume. vxvol
set
len
command, the freed space is not released into the free space
pool.
round
reads each plex in turn in "round-robin" fashion for each non-sequential I/O detected. Sequential access will cause only one plex to be accessed, thus taking advantage of the drive or controller read-ahead caching policies.
prefer
reads preferentially from a plex that has been labeled as the preferred plex.
select
chooses a default policy based on plex associations to the volume. If the volume has an enabled striped plex, this defaults to preferring that plex; otherwise, it defaults to round-robin.
round
to prefer
(or vice versa), or to a different preferred plex. The vxvol
rdpol
command sets the read policy for a volume.
To set the read policy to round
, use the following command:
vxvol rdpol round volume_name
For example, the command line to set the read policy for volume vol01
to a round-robin read looks like this:
vxvol rdpol round vol01
To set the read policy to prefer
, use the following command:
vxvol rdpol prefer volume_name preferred_plex_name
For example, the command line to set the policy for vol01
to read preferentially from the plex vol01-02
looks like this:
vxvol rdpol prefer vol01 vol01-02
To set the read policy to select
, use the following command:
vxvol rdpol select volume_name
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:
vxrecover -s volume_name ...
To start all DISABLED
volumes, use the following command:
vxrecover -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:
vxvol stop volume_name ...
For example, the command line to stop a volume labeled vol01
looks like this:
vxvol stop vol01
To stop all ENABLED
volumes, use the following command:
vxvol stopall
If all mirrors 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:
vxvol maint volume_name
To assist in choosing the revival source plex, list the unstarted volume and displays its plexes.
To take plex vol01-02
offline, use the following command:
vxmend off vol01-02
The vxmend
utility can change the state of an OFFLINE
plex of a DISABLED
volume to STALE
, after which a vxvol
start
on the volume would revive the plex. To put a plex labeled vol01-02
in the STALE
state, use the following command:
vxmend on vol01-02
vxinfo
, which displays information on the accessibility and usability of one or more volumes:
vxinfo [volume_name]
vxassist
command as follows:
vxassist mirror volume_name
For example:
vxassist mirror voltest
creates a mirror of the volume voltest.
Another way to mirror an existing volume is by first creating a plex and then associating it with a volume, using the following commands:
vxmake plex plex_name sd=subdisk_name ... vxplex att volume_name plex_name
CLEAN
or ACTIVE
, mark one of the plexes CLEAN
and instruct the system to use that plex as the source for reviving the others.
To place a plex in a CLEAN
state, use the following command:
vxmend fix clean plex_name
For example, the command to place the plex labeled vol01-02
in the CLEAN
state looks like this:
vxmend fix clean vol01-02
For information about how to use vxmend
, refer to the vxmend
(1M) manual page. For general information on recovery, refer to Appendix B, "Recovery."
RAID-5 and mirrored volumes both maintain redundancy of the data within a volume; mirrored volumes do so by keeping multiple, complete copies of the data in different plexes, whereas RAID-5 volumes keep one copy of the data and calculated parity in the same plex.
Both mirrored and RAID-5 volumes have the ability to do logging to minimize recovery time. Mirrored volumes use dirty region logs to keep a map of which regions of the volume are currently being written, while RAID-5 volumes use RAID-5 logs to keep a copy of the data and parity currently being written.
vxprint
that would be associated with it: Figure 29 vxprint Output for a RAID-5 Plex
PL
NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
pl rvol-01 rvol ENABLED ACTIVE 20480 RAID 3/16 RW
sd disk00-00 rvol-01 disk00 0 10240 0/0 c1b0t4d1 ENA
sd disk01-00 rvol-01 disk01 0 10240 1/0 c1b0t2d1 ENA
sd disk02-00 rvol-01 disk02 0 10240 2/0 c1b0t3d1 ENA
The plex line shows that the plex layout is RAID
and that it has three columns and a stripe unit size of 16 sectors. Each subdisk line shows the column in the plex and offset in the column in which it is located.
RAID-5 logs can be concatenated or striped plexes, and each RAID-5 log associated with a RAID-5 volume will have a complete copy of the logging information for the volume. It is suggested that you have a minimum of two RAID-5 log plexes for each RAID-5 volume. These log plexes should be located on different disks. Having two RAID-5 log plexes for each RAID-5 volume protects against the loss of logging information due to the failure of a single disk.
In order to support enough concurrent access to the RAID-5 array, the log should be several times the stripe size of the RAID-5 plex.
RAID-5 log plexes can be differentiated from the RAID-5 plex of a RAID-5 volume by examining vxprint
output; the STATE
field for a log plex is marked as LOG
. Figure 30 shows the vxprint
output for a RAID-5 volume.
Figure 30 vxprint Output for a RAID-5 Volume
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE v r5vol raid5 ENABLED ACTIVE 20480 RAID - pl r5vol-01 r5vol ENABLED ACTIVE 20480 RAID 3/16 RW sd disk00-00 r5vol-01 disk00 0 10240 0/0 c1b0t4d1 ENA sd disk01-00 r5vol-01 disk01 0 10240 1/0 c1b0t2d1 ENA sd disk02-00 r5vol-01 disk02 0 10240 2/0 c1b0t3d1 ENA pl r5vol-l1 r5vol ENABLED LOG 1024 CONCAT - RW sd disk03-01 r5vol-l1 disk00 0 1024 0 c1b0t3d0 ENA pl r5vol-l2 r5vol ENABLED LOG 1024 CONCAT - RW sd disk04-01 r5vol-l2 disk02 0 1024 0 c1b0t1d1 ENA
The RAID-5 volume (r5vol
) can be identified as a RAID-5 volume by its read policy being RAID
. It has one RAID-5 plex (r5vol-01)
, similar to the one described earlier. It has two RAID-5 logs in the plexes r5vol-l1
and r5vol-l2
; these are identified by the state field being LOG
and the fact that they are associated with a RAID-5 volume and have a layout that is not RAID
.
vxassist
(the recommended approach) or vxmake
. Both approaches are discussed in this section.A RAID-5 volume contains a RAID-5 plex that consists of two or more subdisks located on two or more physical disks. Only one RAID-5 plex can exist per volume.
vxassist
vxassist
as follows:
vxassist make volume_name length layout=raid5
For example, to create a 10M RAID-5 volume named volraid
, enter:
vxassist make volraid 10m layout=raid5
This creates a RAID-5 volume with the default stripe unit size on the default number of disks.
vxmake
vxmake
command is similar to creation of other volumes (see "Creating Volumes" and the vxmake
(1M) manual page for details on creating other volumes). The creation of subdisks for use in a RAID-5 volume is the same as creating any subdisk.
The procedure for creating a RAID-5 plex for a RAID-5 volume is similar to that for creating striped plexes, except that the layout
attribute should be set to raid5
. Subdisks can be implicitly associated in the same way as with striped plexes. Thus, a four-column RAID-5 plex with a stripe unit size of 32 sectors can be created from four existing subdisks as follows:
vxmake plex raidplex layout=raid5 stwidth=32 \ sd=disk00-01,disk01-00,disk02-00,disk03-00
Note that because four subdisks were specified without any specification of columns, vxmake
assumes a four-column RAID-5 plex and places one subdisk in each column. This is the same behavior exhibited when creating striped plexes. If the subdisks are to be created later, the following command could be used to create the plex:
vxmake plex raidplex layout=raid5 ncolumn=4 stwidth=32
ncolumn
attribute must be specified. Subdisks can later be filled in the plex by using vxsd
assoc
(see "Manipulating RAID-5 Subdisks").
vxmake plex raidplex layout=raid5 stwidth=32 \ sd=disk00-00:0,disk01-00:1,disk02-00:2,disk03-00:0, \ disk04-00:1,disk05-00:2
This would stack subdisks disk00-00
and disk03-00
consecutively in column 0, subdisks disk01-00
and disk04-00
consecutively in column 1, and subdisks disk02-00
and disk05-00
in column 2. Offsets can also be specified to create sparse RAID-5 plexes, as for striped plexes.
Since log plexes are simply plexes without a RAID-5 layout, they can be created normally.
To create a RAID-5 volume with vxmake
, simply specify the usage type to be RAID-5
, as in:
vxmake -Uraid5 vol raidvol
RAID-5 plexes and RAID-5 log plexes can be associated implicitly:
vxmake -Uraid5 vol raidvol plex=raidplex,raidlog1, raidlog2
vxmake
and has not yet been initialized or if it has somehow been set to an uninitialized state.
A RAID-5 volume can be initialized through vxvol
in either of the following ways:
vxvol init zero volume_name
or
vxvol start volume_name
vxvol
init
zero
writes zeroes to any RAID-5 log plexes and to the entire length of the volume; it then leaves the volume in the ACTIVE
state.
vxvol
start
recovers parity by XORing together corresponding data stripe units in all other columns. Although it is slower than a vxvol
init
zero
operation, vxvol
start
makes the RAID-5 volume immediately available.
RAID-5 logs reduce the possible damage that can be caused by system failures. Because they maintain a copy of the data being written at the time of the failure, the process of resynchronization consists of simply reading that data and parity from the logs and writing it to the appropriate areas of the RAID-5 volume. This greatly reduces the amount of time needed for a resynchronization of data and parity. It also means that the volume never becomes truly stale because the data and parity for all stripes in the volume is known at all times, so the failure of a single disk cannot result in the loss of the data within the volume.
If an attempt is made to read data contained on a stale subdisk, the data is reconstructed from data from all other stripe units in the stripe; this operation is called a reconstructing-read. This is a significantly more expensive operation than simply reading the data, resulting in degraded read performance; thus, when a RAID-5 volume has stale subdisks, it is considered to be in degraded mode.
A RAID-5 volume in degraded mode can be recognized as such from the output of vxprint
, as shown in Figure 31.
Figure 31 vxprint Output for a Degraded RAID-5 Volume
The volumeV NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
v r5vol RAID-5 ENABLED DEGRADED 20480 RAID -
pl r5vol-01 r5vol ENABLED ACTIVE 20480 RAID 3/16 RW
sd disk00-00 r5vol-01 disk00 0 10240 0/0 c1b0t4d1
sd disk01-00 r5vol-01 disk01 0 10240 1/0 c1b0t2d1 dS
sd disk02-00 r5vol-01 disk02 0 10240 2/0 c1b0t3d1 -
pl r5vol-l1 r5vol ENABLED LOG 1024 CONCAT - RW
sd disk03-01 r5vol-l1 disk00 10240 1024 0 c1b0t3d0 -
pl r5vol-l2 r5vol ENABLED LOG 1024 CONCAT - RW
sd disk04-01 r5vol-l2 disk02 10240 1024 0 c1b0t1d1 -
r5vol
is in degraded mode, as shown by the STATE
, which is listed as DEGRADED
. The failed subdisk is disk01-00
, as shown by the flags in the last column -- the d
indicates that the subdisk is detached and the S
indicates that the subdisk contents are stale.
It is also possible that a disk containing a RAID-5 log could experience a failure. This has no direct effect on the operation of the volume; however, the loss of all RAID-5 logs on a volume makes the volume vulnerable to a complete failure, as described earlier. In the output of vxprint
-ht
, failure within a RAID-5 log plex is indicated by the plex state being BADLOG
, as shown in Figure 32, where the RAID-5 log plex r5vol-l1
has failed.
Figure 32 vxprint Output for a RAID-5 Volume with Failed Log Plex
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE
SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
v r5vol RAID-5 ENABLED ACTIVE 20480 RAID -
pl r5vol-01 r5vol ENABLED ACTIVE 20480 RAID 3/16 RW
sd disk00-00 r5vol-01 disk00 0 10240 0/0 c1b0t4d1 ENA
sd disk01-00 r5vol-01 disk01 0 10240 1/0 c1b0t2d1 dS
sd disk02-00 r5vol-01 disk02 0 10240 2/0 c1b0t3d1 ENA
pl r5vol-l1 r5vol DISABLED BADLOG 1024 CONCAT - RW
sd disk03-01 r5vol-l1 disk00 10240 1024 0 c1b0t3d0 ENA
pl r5vol-l2 r5vol ENABLED LOG 1024 CONCAT - RW
sd disk04-01 r5vol-l2 disk02 10240 1024 0 c1b0t1d1 ENA
vxrecover
command. For more information on starting RAID-5 volumes, see "Starting RAID-5 Volumes."
If hot-relocation is enabled at the time of a disk failure, system administrator intervention is not required (unless there is no suitable disk space available for relocation). Hot-relocation will be triggered by the failure and the system administrator will be notified of the failure by electronic mail. Hot-relocation will automatically attempt to relocate the subdisks of a failing RAID-5 plex. After any relocation takes place, the hot-relocation daemon (vxrelocd
) will also initiate a parity resynchronization. In the case of a failing RAID-5 log plex, relocation will only occur if the log plex is mirrored; vxrelocd
will then initiate a mirror resynchronization to recreate the RAID-5 log plex. If hot-relocation is disabled at the time of a failure, the system administrator may need to initiate a resynchronization or recovery.
vxprint
-ht
command, as shown in Figure 33.
Figure 33 vxprint Output for a Stale RAID-5 Volume
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX PL NAME VOLUME KSTATE STATE LENGTH LAYOUT NCOL/WID MODE SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE v r5vol RAID-5 ENABLED NEEDSYNC 20480 RAID - pl r5vol-01 r5vol ENABLED ACTIVE 20480 RAID 3/16 RW sd disk00-00 r5vol-01 disk00 0 10240 0/0 c1b0t4d1 ENA sd disk01-00 r5vol-01 disk01 0 10240 1/0 c1b0t2d1 ENA sd disk02-00 r5vol-01 disk02 0 10240 2/0 c1b0t3d1 ENA
This output lists the volume state as NEEDSYNC
, indicating that the parity needs to be resynchronized. The state could also have been SYNC
, indicating that a synchronization was attempted at start time and that a synchronization process should be doing the synchronization. If no such process exists or if the volume is in the NEEDSYNC
state, a synchronization can be manually started using the resync
keyword for the vxvol
command. For example, to resynchronize the RAID-5 volume in Figure 33, the following command would be used:
vxvol resync r5vol
Parity is regenerated by issuing VOL_R5_RESYNC
ioctls to the RAID-5 volume. The resynchronization process starts at the beginning of the RAID-5 volume and resynchronizes a region equal to the number of sectors specified by the -o
iosize option or, if -o
iosize is not specified, the default maximum I/O size. The resync
operation then moves onto the next region until the entire length of the RAID-5 volume has been resynchronized.
For larger volumes, parity regeneration can take a significant amount of time and it is possible that the system could be shut down or crash before the operation is completed. Unless the progress of parity regeneration is somehow kept across reboots, the process would have to start all over again. To avoid this situation, parity regeneration is checkpointed, meaning that the offset up to which the parity has been regenerated is saved in the configuration database. The -o checkpt=size
option controls how often the checkpoint is saved; if not specified, it defaults to the default checkpoint size. Since saving the checkpoint offset requires a transaction, making the checkpoint size too small can significantly extend the time required to regenerate parity. After a system reboot, a RAID-5 volume that has a checkpoint offset smaller than the volume length will start a parity resynchronization at the checkpoint offset.
recover
keyword of the vxvol
command. For example, to recover the stale subdisk in the RAID-5 volume shown in Figure 31, the following command would be used:
vxvol recover r5vol disk01-00
If a RAID-5 volume has multiple stale subdisks to be caught up all at once, calling vxvol
recover
with only the name of the volume will achieve this:
vxvol recover r5vol
att
keyword for the vxplex
command. To reattach the failed RAID-5 log plex shown in Figure 32, the following command should be issued:
vxplex att r5vol r5vol-l1
vxassist
and vxrecover
as part of larger operations, such as evacuating disks, etc. These command line operations should not be necessary for casual usage of the Volume Manager.vxplex
command. A RAID-5 log can be added using vxplex
att
:
vxplex att r5vol r5log
The attach operation can only proceed if the new log's size is large enough to hold an entire stripe's worth of data. If the RAID-5 volume already has logs, the new log length is the minimum of each individual log length. This is because the new log is a mirror of the old logs.
If the RAID-5 volume is not enabled, the new log is marked as BADLOG
and will be enabled when the volume is started, though its contents will be ignored. If the RAID-5 volume is enabled and has other enabled RAID-5 logs, the new log will have its contents synchronized with the other logs via ATOMIC_COPY
ioctls. If the RAID-5 volume currently has no enabled logs, the new log is zeroed before it is enabled.
Log plexes can be removed from a volume using the vxplex
dis
command:
vxplex dis r5log3
If removing the log would leave the volume with less than two valid logs, a warning will be printed and the operation will not be allowed to continue. The operation must be forced by using the -o
force
option.
vxsd
command. Association is done using the assoc
keyword in the same manner as for striped plexes. For example, to add subdisks at the end of each column of the RAID-5 volume in Figure 30, the following command would be used:
vxsd assoc r5vol-01 disk10-01:0 disk11-01:1 disk12-01:2
If a subdisk is filling a "hole" in the plex (i.e., some portion of the volume's logical address space is mapped by the subdisk), the subdisk will be considered stale. If the RAID-5 volume is enabled, the association operation will regenerate the data that belongs on the subdisk using VOL_R5_RECOVER
ioctls; otherwise, it is simply marked as stale and will be recovered when the volume is started.
Subdisks can be removed from the RAID-5 plex by using vxsd
dis
:
vxsd dis disk10-01
DEGRADED
mode. If this is the case, the dis
operation will print a warning and must be forced using the -o
force
option. Additionally, if removing the subdisk would make the RAID-5 volume unusable (because another subdisk in the same stripe is unusable or missing) and the volume is not DISABLED
and empty, this operation is not allowed.
vxsd
mv
. For example, if disk03
needed to be evacuated and disk22
has enough room by using two portions of its space, the following command could be used:
vxsd mv disk03-01 disk22-01 disk22-02
While this command is similar to that for striped plexes, the actual mechanics of the operation are not. In order to do RAID-5 subdisk moves, the old subdisk is removed from the RAID-5 plex and replaced by the new subdisks, which are marked as stale and then recovered using VOL_R5_RECOVER
operations either by vxsd
or (if the volume is not active) when the volume is started. This means that the RAID-5 volume is degraded for the duration of the operation. Another failure in the stripes involved in the move will make the volume unusable. The RAID-5 volume could also become invalid if the parity of the volume were to become stale.
To avoid these situations, the vxsd
utility will not allow a subdisk move if:
-o
force
option.
Subdisks of RAID-5 volumes can also be split and joined by using vxsd split
and vxsd
join
. These operations work the same as for mirrored volumes.
Under normal circumstances, volumes are started automatically after a reboot and any recovery takes place automatically or is done via the vxrecover
command.
vxvol
start
command will return the following error message:
vxvm:vxvol: ERROR: Volume r5vol is not startable; RAID-5 plex does not map entire volume length.
At this point, the contents of the RAID-5 volume are unusable.
Another possible way that a RAID-5 volume can become unstartable is if the parity is stale and a subdisk becomes detached or stale. This occurs because within the stripes that contain the bad subdisk, the parity stripe unit is invalid (because the parity is stale) and the stripe unit on the bad subdisk is also invalid. This situation is shown in Figure 34, which illustrates a RAID-5 volume that has become invalid due to stale parity and a failed subdisk.
Figure 34 Invalid RAID-5 Volume
This example shows four stripes in the RAID-5 array. All parity is stale and subdisk disk05-00
has failed. This makes stripes X and Y unusable because two failures have occurred within those stripes.
This qualifies as two failures within a stripe and prevents the use of the volume. In this case, the output from vxvol
start
would be:
vxvm:vxvol: ERROR: Volume r5vol is not startable; some subdisks are unusable and the parity is stale.
This situation can be avoided by always using RAID-5 log plexes in RAID-5 volumes, preferably two or more. RAID-5 log plexes prevent the parity within the volume from becoming stale, thus preventing this situation (see "System Failures" for details).
To start a RAID-5 volume despite the presence of stale subdisks, the -f
option can be used with the vxvol
start
command. This will cause all stale subdisks to be marked as non-stale before the start
operation begins its evaluation of the validity of the RAID-5 volume and what is needed to start it. Alternately, individual subdisks can be marked as non-stale by using the command vxmend
fix
unstale
subdisk.
The following steps are taken when a RAID-5 volume is started:
DETACHED
kernel state and setting the volume state to REPLAY
, and enabling the RAID-5 log plexes. If the logs can be successfully read and the replay is successful, move on to Step 2.
DETACHED
kernel state and setting the volume state to SYNC
. Any log plexes are left DISABLED
-o
unsafe
start option with vxvol
.
-o
unsafe
start option is considered dangerous, as it can make the contents of the volume unusable. It is therefore not recommended.
ENABLED
kernel state and the volume state is set to ACTIVE
. The volume is now started.
ENABLED
kernel state and the volume is available for use during the subdisk recovery. Otherwise, the volume kernel state is set to DETACHED
and it is not available during subdisk recovery.
-o
unsafe
start option.
-o
unsafe
start option is considered dangerous, as it can make the contents of the volume unusable. It is therefore not recommended.
RECOVER
and stale subdisks are restored. As the data on each subdisk becomes valid, the subdisk is marked as no longer stale.
-o
unsafe
start option.
-o
unsafe
start option is considered dangerous, as it can make the contents of the volume unusable. It is therefore not recommended.
ENABLED
kernel state and marked as ACTIVE
. It is now started.
vxvol
set
command. To change the length of a RAID-5 volume, the following command can be used:
vxvol set len=10240 r5vol
The length of a volume cannot exceed the mapped region (called the contiguous length, or contiglen) of the RAID-5 plex. In other words, the length cannot be extended so as to make the volume unusable. If the RAID-5 volume is active and the length is being shortened, the operation must be forced using the -o force
usage type option; this is done to prevent yanking space away from applications using the volume.
The length of the RAID-5 logs can also be changed using vxvol
set
, as in
vxvol set loglen=2M r5vol
Remember that RAID-5 log plexes are only valid if they map the entire length of the RAID-5 volume's log length. If increasing the log length would make any of the RAID-5 logs invalid, the operation will not be allowed. Also, if the volume is not active and is dirty (i.e., was not shut down cleanly), the log length cannot be changed. This avoids the loss of any of the log contents (if the log length is decreased) or the introduction of random data into the logs (if the log length is being increased).
vxassist
and other utilities. There are various possible procedures for doing backups, depending upon the requirements for integrity of the volume contents. These procedures have the same starting requirement: a mirror that is large enough to store the complete contents of the volume. The plex can be larger than necessary, but if a plex that is too small is used, an incomplete copy results.
The recommended approach to volume backup involves the use of the vxassist
utility. The vxassist
procedure is convenient and relatively simple. The vxassist
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 mirror. The end of the update procedure is signified by the new snapshot mirror changing its state to SNAPDONE
. This change can be tracked by the vxassist
snapwait
operation, which waits until at least one of the mirrors changes its state to SNAPDONE
. If the attach process fails, the snapshot mirror is removed and its space is released.
Once the snapshot mirror 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 mirror is long and indefinite in contrast to the brief amount of time that it takes to create the snapshot volume.
The online backup procedure is completed by running a vxassist
snapshot
command on a volume with a SNAPDONE
mirror. This operation detaches the finished snapshot (which becomes a normal mirror), creates a new normal volume and attaches the snapshot mirror to it. The snapshot then becomes a normal, functioning mirror and the state of the snapshot is set to ACTIVE
.
If the snapshot procedure is interrupted, the snapshot mirror is automatically removed when the volume is started.
Use the following steps to perform a complete vxassist
backup:
vxassist snapstart volume_name
snapstart
operation is complete and the mirror is in a SNAPDONE
state, select a convenient time to complete the snapshot operation. Inform users of the upcoming snapshot and ask them to save files and refrain from using the system briefly during that time.
vxassist snapshot volume_name temp_volume_name
fsck
(or some utility appropriate to the application running on the volume) to clean the temporary volume's contents. For example:
fsck -y /dev/vx/rdsk/temp_volume_name
vxedit -rf rm temp_volume_name