Veritas Volume Manager (VxVM) cheat sheet

This article is aimed a providing a list of basic and advanced commands and common information for Veritas Volume Manager.

Basic VxVM Commands

Disk Operations
ActionCommand Line
Initialise a disk vxdisksetup -i device
List disks owned by local and remote hosts vxdisk -o alldgs list
List disk header vxdisk list diskname|device
Evacuate a disk vxevac -g diskgroup from_disk to_disk
Rename a disk vxdisk -g diskgroup rename oldname> newname
Set spare, no hot relocation, or reserved space on a disk vxedit -g diskgroup set [spare|nohotuse|reserve]=on|off diskname
Unrelocate a disk vxunreloc -g diskgroup original_diskname
Disk Group Operations
ActionCommand Line
Create a disk group vxdisk list diskgroup diskname=device
Add a disk to disk group vxdg -g diskgroup adddisk diskname=device
Remove a disk from disk group vxdg -g disksgroup rmdisk diskname
Deport, inport or destroy a disk group vxdg [deport|import|destroy] diskgroup
List disk groups vxdg list [diskgroup]
Show free/spare space pool vxdg -g diskgroup [free|spare]
Upgrade disk group version vxdg [-T version] upgrade diskgroup
Rewrite disk headers, configuration copies, and kernel log copies in a disk group. vxdg flush diskgroup targetdg object...
or
vxdctl enable for all disk groups
Move an object between disk groups vxdg more sourcedg targetdg object...
Split objects between disk groups vxdg split sourcedg targetdg object...
Join disk groups vxdg join sourceg targetdg
List objects affected by a disk group move operation vxdg listmove sourcedg targetdg object...
Volume Operations
ActionCommand Line
Create a volume vxassist -g diskgroup make vol_name size layout=format diskname
Remove a volume vxedit -g diskgroup -rf rm vol_name
or
vxassist -g diskgroup remove volume vol_name
Display a volume vxprint -g diskgroup -bt vol_name
vxprint -g diskgroup> remove volume vol_name
Display a volume vxprint -g diskgroup -vt vol_name
vxprint -g diskgroup -l vol_name
Change volume read policy vxvol -g diskgroup> rcpol round vol_name
vxvol -g diskgroup> rcpol prefer vol_name preferred_plex_name
vxvol -g diskgroup> rcpol select vol_name
Mirror an existing plex vxassist -g diskgroup mirror vol_name
Create a snapshot vxassist -g diskgroup -b snapstart vol_name
vxassist -g diskgroup snapshot vol_name new_volume
Abort a snapshot vxassist -g diskgroup snapabort orig_vol_name
Reassociate a snapshot vxassist -g diskgroup snapback snapshot_vol
Dissaciate a snapshot vxassist -g diskgroup snapclear vol_name
Print snapshot information vxassist -g diskgroup snapprint vol_name
Relayout a volume vxassist -g diskgroup relayout vol_name layout=new_layout [attributes...]
Convert to or from a layered layout vxassist -g diskgroup convert vol_name layout=new_layout [attributes...]
Add a log to a volume vasssist -g diskgroup addlog vol_name

Advanced VxVM Commands

Subdisk Operations
ActionCommand Line
Create a subdisk vxmake -g diskgroup sd subdisk_name diskname offset length
Remove a subdisk vxedit -g diskgroup rm subdisk_name
Display subdisk information vxprintr -st
vxprint -l subdisk_name
Associate a subdisk to a plex vxsd assoc plex_name subdisk_name
Plex and Volume Operations
ActionCommand Line
Create a plex vxmake -g diskgroup plex plex_name sd=<subdisk_name, ...
Associate a plex (to a volume) vxplex -g diskgroup att vol-name plex_name
Unmirror a volume (remove a plex) vxplex -i rm disk plex_name
Start/stop volumes vxvol [start|stop] vol-name
Start/stop all volumes vxvol [startall|stopall]
Recover a volume vxrecover -sn vol_name
Detach a plex vxprint -g diskgroup det plex_name
Attach a plex vxplex -g diskgroup att vol_name plex_name
Change state flags on plex vxmend fix [active|clean|stale] plex_name
Turn plex online/offline vxmend [on|off] plex_name
Set fastResync flag on a volume vxvol set fastresync=on vol_name
Benchmarking Operations
ActionCommand Line
Count ans size of VxVM disk I/Os completed per sample time slice to a volume vxstat -g diskgroup [-i interval] [-c count] -d vol_name
VxVM I/O trace information-- dump to file and read from file vxtrace -g diskgroup [-t duration] -d filename] -o dev,disk vol_name
vxtrace -l -f /tmp/tracedata | more
Sample I/O load with statistics-- sequential vxbench -w [read|write] -i iosize=size,iocount=count filename
Sample I/O load with statistics-- random vxbench -w [rand_read|rand_write] -i iosize=size,iocount=count,maxfilesize=size filename
Tuning Operations
ActionCommand Line
View currently set VxVM kernel parameters Example: view the current setting for the kernel paramter vol_max_vol;
# echo 'vol_max_io/D' | adb -k
Change VxVM kernel parameters Example: change the VxVM kernel paramter vol_ax_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