VxVM User's Guide
The Volume Manager allows you to create volumes with various layout types using the command line interface:
vxassistcommand provides the simplest way to create new volumes.
When creating a volume,
vxassist takes the following form:
vxassist make volume_name length [attributes]where
makeis 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
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.
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:
vxassistcreates 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
vxassist make volspec 3m disk03
Create a striped volume as follows:
vxassist make volume_name length layout=stripeTo create the striped volume
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 (
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
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:
/etc/vfstab, remove its entry.
vxvol stop volume_name
stopcommand stops all Volume Manager activity to the volume.
vxedit -rf rm volume_nameTo remove the volume
vxedit -rf rm volspan
vxassist make volume_name length layout=mirrorTo create the mirrored volume,
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.
vxassistcreates one log plex per log subdisk, by default.
vxassist mirror volume_nameThe following example creates a mirror of the volume
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=1as an attribute to the
vxassistcommand. 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
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
vxassist addlog vol03When
vxassistis 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
-hshows that volume
volmiris mirrored using plexes
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
vxplex -o rm dis volmir-02The output of
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
To disassociate and remove the log plex
vxplex -o rm dis volraid-02The output of
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
volcatto 2000 sectors, enter:
vxassist growto volcat 2000
vxassist growby volume_name lengthTo extend
volcatby 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.
volcat to 1300 sectors, enter:
vxassist shrinkto volcat 1300
vxassist shrinkby volume_name lengthTo shrink
volcatby 300 sectors, enter:
vxassist shrinkby volcat 300
vxassistinvolves the following procedure:
snapstartoperation 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 snapshotcommand 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
vxassist snapstart voldefAfter creating the snapshot mirror, create a snapshot volume that reflects the original volume as follows:
To create a snapshot volume of
vxassist snapshot volume_name new_volume_name
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.
vxprintcommand 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 MODE
dg 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
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
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 -