Veritas Volume Manager Reference

VxVM Administrators Reference
By Solarum dot com
This document is a reference for Veritas Volume Manager, now known as Veritas Storage Foundation. The first part is a quick walk through of the commands used to perform a simple typical setup on a set of disks. This is just as an example of what would be done, in context, taken from a real world setup.  The next part is the full reference. This is a breakdown of all of the VxVM commands, what they do and the applicable syntax. They are grouped by the different types of Operations like Disk, Volume, Plex and so forth.  I have tried to include different command formats when I found them, as well as any other information that was available.  Please let me know if you find something that seems incorrect or missing by going to the Solarum contact page here.

If you want to play with Veritas Storage Foundation, Symantec (they bought Veritas) now has a free version available for download for testing, development and educational purposes.  Check it out here.


Quick Setup Walkthrough
Here we have a list of commands that one might use to setup VxVM on their server.  We will work with the following assumptions:  We are setting four disks in a RAID5 array and they are locally connected SCSI.

# vxdisksetup -i c0t0d0 //
Initialize the disk

# vxdisksetup -i c0t1d0
# vxdisksetup -i c0t2d0
# vxdisksetup -i c0t3d0
# vxdg init sysdg c0t0d0s2 c0t1d0s2 c0t2d0s2 c0t3d0s2 // Create the diskgroup
# vxassist -g sysdg make sysvol 50g layout=raid5 // Create a volume in the diskgroup
# mkfs -F vxfs -o largefiles /dev/vx/rdsk/sysdg/sysvol  // Format or create the filesystem

* Note: If you are using Sun Cluster, you need to add the device group to the cluster before you can format it. If you are adding a disk to an exisitng device group, you must refresh the devices in the cluster device group before you can format them.

If you were adding a new device group, it would look like this:
# scconf -a -D type=vxvm,name=sysdg,nodelist=server1:server2,failback=disabled

If you were simply syncing an existing group, it would look like this:
# scconf -c -D name=sysdg,sync

You could then issue the mkfs command used above to create a filesystem on your volumes.

Disk Operations
Function Command
Evacuate a disk vxevac -g diskgroup from_disk to_disk
Initialize a disk vxdisksetup -i device
vxdiskadd device
vxdiskadm
List all disks (local and remote) vxdisk -o alldgs list
List a disk header vxdisk list diskname | device
Mirror disks vxmirror -g diskgroup diskname diskname_mirror
Mirror root disk vxbootsetup
Rename a disk (must be part of a diskgroup) vxedit -g diskgroup rename oldname newname
Rescan for disks vxdctl enable
Set spare, no hot relocation, or reserved space on a disk. vxedit -g diskgroup set {spare|nohotuse|reserve}=on|off diskname
Show disk statistics vxstat -g diskgroup -d [ device_name ]
Show RAID5 statistics vxstat -g diskgroup -f MWF [ device_name ]
Trace disk operations vxtrace -o disk [ device_name ]
Unrelocate a disk vxunreloc -g diskgroup original_diskname
Un-initialize a disk vxdiskunsetup device
vxdisk rm device
Un-initialize a disk forcefully vxdiskunsetup -C device
Disk Group Operations
Function Command
Add a disk to disk group vxdg -g diskgroup adddisk diskname=device
Create a disk group vxdg init diskgroup diskname=device
Deport, import or destroy a disk group vxdg {deport | import | destroy } diskgroup
Join disk groups vxdg join sourcedg targetdg
List disk groups vxdg list [diskgroup]
List objects affected by a disk group move operation vxdg listmove sourcedg targetdg object
Move and object between disk groups vxdg move sourcedg targetdg object
Remove a disk from a disk group vxdg –g diskgroup rmdisk diskname
Rewrite disk headers, configuration copies. and kernel log copies in a disk group vxdg flush diskgroup targetdg object
vxdctl enable (for all disk groups)
Show free/spare space pool vxdg -g diskgroup {free | spare}
Split objects between disk groups vxdg split sourcedg targetdg object
Upgrade disk group version vxdg [-T version] upgrade diskgroup

Volume Operations
Function Command
Abort a snapshot vxassist -g diskgroup snapabort orig_vol_name
Add a log to a volume vxassist -g diskgroup addlog vol_name
Change a volume read policy vxvol -g diskgroup rdpol round vol_name
vxvol -g diskgroup rdpol prefer vol_name preferrred_plex_name
vxvol -g diskgroup rdpol select vol_name
Convert to or from a layered layout vxassist -g diskgroup convert vol_name layout=new_layout [attributes…]
Create a snapshot volume vxassist –g diskgroup -b snapstart vol_name
vxassist –g diskgroup snapshot vol_name new_volume
Create a volume vxassist -g diskgroup make vol_name size layout=format diskname
vxassist -g diskgroup -U fsgen make vol_name size layout=format diskname
Disassociate a snapshot vxassist -g diskgroup snapclear snapshot_vol
Display a volume vxedit -g diskgroup -vt vol_name
vxassist -g diskgroup -l vol_name
List un-startable volumes vxinfo [ vol_name ]
Maxresize – show largest possible volume size vxassist -g diskgroup maxgrow vol_name
Mirror an existing plex vxassist -g diskgroup mirror vol_name
Print snapshot information vxassist -g diskgroup snapprint vol_name
Reassociate a snapshot vxassist -g diskgroup snapback snapshot_vol
Recover a volume vxrecover [ -g diskgroup ] -sn vol_name
Relayout a volume vxassist -g diskgroup relayout vol_name layout=new_layout [attributes…]
Remove a volume vxedit -g diskgroup -rf rm vol_name
vxassist -g diskgroup remove volume vol_name
Reset volume statistics vxstat -g diskgroup -r [ vol_name ]
Resize a volume vxassist -g diskgroup growto vol_name new_length
vxassist -g diskgroup growby vol_name length_change
vxassist -g diskgroup shrinkto vol_name new_length
vxassist -g diskgroup shrinkby vol_name length_change
vxresize -F ufs -g diskgroup vol_name new_length
vxvol -g diskgroup set len=value vol_name
Set FastResync flag on a volume vxvol set fastresync=on vol_name
Show volume statistics vxstat -g diskgroup [ vol_name ]
Start/Stop volumes vxvol {start | stop } vol_name
Start/Stop ALL volumes vxvol {startall | stopall }
Trace volume operations vxtrace [ vol_name ]
Subdisk Operations
Function Command
Associate a subdisk to a plex vxsd assoc plex_name subdisk_name
Create a subdisk vxmake -g diskgroup sd subdisk_name diskname offset length
Disassociate a subdisk vxsd dis subdisk_name
Display subdisk information vxprint -st
vxprint -l subdisk_name
Remove a subdisk vxedit -g diskgroup rm subdisk_name
Plex Operations
Function Command
Associate a plex (to a volume) vxplex -g diskgroup att vol_name plex_name
Attach a plex vxplex -g diskgroup att vol_name plex_name
Change state flags on a plex vxmend fix {active | clean | stale } plex_name
Create a plex vxmake -g diskgroup plex plex_name sd=subdisk_name,…
Detach a plex vxplex -g diskgroup det plex_name
Disassociate a plex vxplex -o rm dis plex_name
Remove a plex vxedit -g diskgroup -r rm plex_name
Turn plex online/offline vxmend {on | off} plex_name
Benchmarking and Tuning Operations
Function Command
Change VxVM kernel parameters Example: Change the VxVM kernel parameter vol_max_vol from the current value to a new value of 2048 by adding the parameter to the /etc/system file:
# set vxio: vol_max_vol=2048
Then, reboot the system.
Count and size of VxVM disk I/Os completed per sample time slice to a volume vxstat -g diskgroup [ -i interval ] [-c count ] -d vol_name
Sample I/O load with statistics — random vxbench -w {rand read | rand write} -i iosize=size, iocount=count, maxfilesize=size filename
Sample I/O load with statistics — sequential vxbench -w {read | write} -i iosize=size, iocount=count, maxfilesize=size filename
View currently set VxVM kernel parameters Example: View the current setting for the kernel parameter vol_max_vol:
# echo ‘vol_max_vol/D’ | adb –k
VxVM I/O trace information — dump to and read from a file vxtrace -g diskgroup [ -t duration ] -d [ filename ] -o dev,disk vol_name; vxtrace -l -f /tmp/tracedata | pg
Miscellaneous Commands
Function Command
Display configuration vxprint -ht
License input vxlicense -c
vxlicinst
License read or show license vxlicense -p
(Background) Task Operations
Function Command
Background task change speed vxtask -i task_number set slow=number
Background task hold vxtask pause task_number
Background task kill vxtask abort task_number
Background task list vxtask -g diskgroup list
Background task monitor vxtask monitor [ task_number ]
Background task resume vxtask resume task_number
This reference has been brought to you by Solarum.com (https://www.solarum.com) | Copyright © 2008, All Rights Reserved
Veritas Volume Manager and Veritas Storage Foundation are Copyright © Symantec Corporation

2 thoughts on “Veritas Volume Manager Reference

  1. Pingback: Veritas Volume Manager (Storage Foundation) Administrators Reference | Solarum - Information For Everyone

  2. Hi,

    Please help me by providing the procedure for the replcing the hard disk in VXVM

    Thanks

Tell me what you are thinking?