|
|
VxVM User's Guide
The Volume Manager allows you to create volumes with various layout types using the command line interface:
vxassist
command provides the simplest way to create new volumes.
When creating a volume, vxassist
takes the following form:
vxassist make volume_name length [attributes]where
make
is the keyword for volume creation, volume_name is a name you give to the volume, and length specifies the number of sectors (by default) in the volume. The length can be specified in kilobytes, megabytes, or gigabytes by using a suffix character of k
, m
, or g
, respectively. Refer to the vxintro
(1M) manual page for more information on specifying units of length when creating volumes. Additional attributes can be specified, as appropriate.
By default, vxassist
creates volumes in the rootdg
disk group. Another disk group can be specified by including -g
diskgroup in the vxassist
command line.
Creating a volume in the disk group rootdg
creates two device node files that can be used to access the volume:
/dev/vx/dsk/volume_name
(the block device node for the volume)
/dev/vx/rdsk/volume_name
(the raw device node for the volume)
rootdg
, these names include the disk group name, as follows:
/dev/vx/dsk/diskgroup_name
/volume_name
/dev/vx/rdsk/diskgroup_name
/volume_name
vxassist
creates a concatenated volume that uses one or more sections of disk space. On a fragmented disk, this allows you to put together a volume larger than any individual section of free disk space available.
If there is not enough space on a single disk, vxassist
creates 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, since it takes space from more than one disk.
Create a concatenated, default volume as follows:
vxassist make volume_name lengthwhere volume_name is a name of the volume and length specifies the length of the volume in sectors (unless another unit of size is specified with a suffix character).
To create the volume voldef
with a length of 10 megabytes, enter:
vxassist make voldef 10m
Create a volume on a specific disk as follows:
vxassist make volume_name length diskname [...]To create the volume
volspec
on disk03
, enter:
vxassist make volspec 3m disk03
Create a striped volume as follows:
vxassist make volume_name length layout=stripeTo create the striped volume
volzebra
, enter:
vxassist make volzebra 10m layout=stripeThis creates a striped volume with the default stripe unit size on the default number of disks.
You can indicate the disks on which the volumes are to be created by specifying the disk names at the end of the command line. For example, to create a 30 megabyte striped volume on three specific disks (disk03
, disk04
, and disk05
), enter:
vxassist make stripevol 30m layout=stripe disk03 disk04\ disk05
Create a RAID-5 volume as follows:
vxassist make volume_name length layout=raid5To create the RAID-5 volume
volraid
, enter:
vxassist make volraid 10m layout=raid5This creates a RAID-5 volume with the default stripe unit size on the default number of disks. It also creates a RAID-5 log by default.
Before removing a volume, make sure you do the following:
umount /dev/vx/dsk/volume_name
/etc/vfstab
, remove its entry.
vxvol stop volume_name
vxvol
stop
command stops all Volume Manager activity to the volume.
vxedit -rf rm volume_nameTo remove the volume
volspan
, enter:
vxedit -rf rm volspan
vxassist make volume_name length layout=mirrorTo create the mirrored volume,
volmir
, enter:
vxassist make volmir 5m layout=mirrorTo create a volume with Dirty Region Logging enabled, create a mirrored volume with a dirty region log as follows:
vxassist make volume_name length layout=mirror,logThis specifies that the volume layout must be both mirrored and contain a DRL log.
vxassist
creates one log plex per log subdisk, by default.
vxassist mirror volume_nameThe following example creates a mirror of the volume
voltest
:
vxassist mirror voltest
/etc/vx/bin/vxmirror -aYou can also configure the Volume Manager to create mirrored volumes by default. To do this, enter the command:
/etc/vx/bin/vxmirror -d yesIf you make this change, you can still make unmirrored volumes by specifying
nmirror=1
as an attribute to the vxassist
command. For example, to create an unmirrored 20-megabyte volume named nomirror
, use the command:
vxassist make nomirror 20m nmirror=1
vxassist
, a log plex is created for that volume, by default.Add a RAID-5 log to an existing volume as follows:
vxassist addlog volume_nameThe following example creates a log for the RAID-5 volume
volraid
:
vxassist addlog volraid
Add a DRL log to an existing volume as follows:
vxassist addlog volume_nameThe following example creates a log for the volume
vol03
:
vxassist addlog vol03When
vxassist
is used to add a log subdisk to a volume, a log plex is also created to contain the log subdisk, by default.Once created, the plex containing a log subdisk can be treated as a regular plex. Data subdisks can be added to the log plex. The log plex and log subdisk can be removed using the same procedures used to remove ordinary plexes and subdisks.
Dissociate and remove the plex from its volume as follows:
vxplex -o rm dis plex_nameFor example, the following output from
vxprint
-h
shows that volume volmir
is mirrored using plexes volmir-01
and volmir-02
:
Disk group: rootdg
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE UTIL0 PUTIL0 v volmir fsgen ENABLED 10240 - ACTIVE - - pl volmir-01 volmir ENABLED 10240 - ACTIVE - - sd disk01-03 volmir-01 - 10240 0 - - - pl volmir-02 volmir ENABLED 10240 - ACTIVE - - sd disk02-02 volmir-02 - 10240 0 - - -To disassociate and remove
volmir-02
from volmir
, enter:
vxplex -o rm dis volmir-02The output of
vxprint
-h
for volmir
is now:
Disk group: rootdg
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE UTIL0 PUTIL0 v volmir fsgen ENABLED 10240 - ACTIVE - - pl volmir-01 volmir ENABLED 10240 - ACTIVE - - sd disk01-03 volmir-01 - 10240 0 - - -
Dissociate and remove the log from its volume in one operation as follows:
vxplex -o rm dis plex_nameTo identify the log plex, use the command:
vxprint -ht volume_namewhere volume_name is the name of the RAID-5 volume. This should result in output that lists a plex with the
STATE
field of LOG
.
To disassociate and remove the log plex volraid-02
from volraid
, enter:
vxplex -o rm dis volraid-02The output of
vxprint
-h
for volraid
is now:
Disk group: rootdg
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0 v volraid raid5 ENABLED 32 - ACTIVE - - pl volraid-01 volraid ENABLED 32 - ACTIVE - - sd disk01-03 volraid-01 - 32 0 - - - sd disk02-02 volraid-01 - 32 0 - - -
vxassist growto volume_name lengthTo extend
volcat
to 2000 sectors, enter:
vxassist growto volcat 2000
vxassist growby volume_name lengthTo extend
volcat
by 100 sectors, enter:
vxassist growby volcat 100
vxassist shrinkto volume_name lengthMake sure you do not shrink the volume below the current size of the file system or database using the volume. This command can be safely used on empty volumes.
To shrink volcat
to 1300 sectors, enter:
vxassist shrinkto volcat 1300
vxassist shrinkby volume_name lengthTo shrink
volcat
by 300 sectors, enter:
vxassist shrinkby volcat 300
vxassist
involves the following procedure:
vxassist
snapstart
operation creates a write-only backup mirror, which is attached to and synchronized with the volume to be backed up. When synchronized with the volume, the backup mirror is ready to be used as a snapshot mirror. However, it continues being updated until it is detached during the actual snapshot portion of the procedure. This may take some time, depending on the volume size.
vxassist snapshot
command on the volume with the snapshot mirror. This operation detaches the finished snapshot mirror, creates a new normal volume, and attaches the snapshot mirror to it. The snapshot then becomes a read-only volume. This step should only take a few minutes.
vxassist snapstart volume_nameTo create a snapshot mirror of a volume called
voldef
, enter:
vxassist snapstart voldefAfter creating the snapshot mirror, create a snapshot volume that reflects the original volume as follows:
vxassist snapshot volume_name new_volume_name
To create a snapshot volume of voldef
, enter:
vxassist snapshot voldef snapvolYou can now back up the snapshot volume by whatever means you prefer. To avoid wasting space, you can then remove the snapshot volume, which occupies as much space as the original volume.
vxprint
command can be used to display information about how a volume is configured.Display the volume, mirror, and subdisk record information for all volumes as follows:
vxprint -htThis displays output such as the following:
Disk group: rootdg
DG NAME NCONFIG NLOG MINORS GROUP-ID DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE 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 MODEdg rootdg 759096729.1025.tweety
dm disk10 c1b0t0d0s7 sliced 559 1044400 -
dm disk20 c2b0t0d0s7 sliced 559 1044400 -
v pubs fsgen ENABLED ACTIVE 2288 SELECT -
pl pubs-01 pubs ENABLED ACTIVE 2288 CONCAT - RW
sd disk10-01 pubs-01 disk10 0 2288 0 c1b0t0d0 ENA
v voldef sgen ENABLED ACTIVE 20480 SELECT -
pl voldef-01 voldef ENABLED ACTIVE 20480 CONCAT - RW
sd disk10-02 voldef-0 disk10 2288 20480 0 c2b0t1d0 ENA
where dg
is a disk group, dm
is a disk, v
is a volume, pl
is a plex, and sd
is a subdisk. The top few lines indicate the headers that match each type of output line that follows. Each volume is listed along with its associated plex(es) and subdisk(s).
Display volume-related information for a specific volume as follows:
vxprint -t volume_nameTo display information about
voldef
, enter:
vxprint -t voldefThis displays output similar to the following:
Disk group: rootdg
V NAME USETYPE KSTATE STATE LENGTH READPOL PREFPLEX
v voldef fsgen ENABLED ACTIVE 20480 SELECT -