VxVM Beginners – Commands and Examples – Part 2

This is a continuation post for our previous post Beginner’s Lesson – VERITAS Volume Manager for Solaris

Learning VxVM administration will be much easier by understanding below three things>

1. How Veritas Volume Manager treats Operating System Native Disks into Veritas Volumes

2. What are the operations we can do in VxVM and what commands are used to perform those operations

3. What are the background services/daemons/Configuration files required to make VxVM work in normal way

Below Diagram will gives you complete picture how VxVM converts Solaris native disks into Diskgroups, Volumes, Plexes and Subdisks.


Transformation of Solaris Disks into VERITAS Volumes


Below given Command Reference for Veritas Volume Manager helps you to perform VxVM administration operations using commands


VxVM Disk Operations


VxVM Disk related administration can done using the commands

  • vxdisksetup / vxdiskupstup
  • vxdisk
  • vxedit
  • vxunreloc

VxVM Disk Operations

VxVM DiskGroup Operations


VxVM diskgroup related operations can be done by using the command “vxdg”

VxVM DiskGroup Operations


VxVM Subdisk Operations

VxVM disk/Subdisk Operations can be done using below commands

  • vxmake
  • vxedit
  • vxsd

VxVM Subdisk Operations


VxVM Plex Operations

VxVM plex related Operations can be done using the command “vxplex”

VxVM Plex Operations


VxVM Volume Operations

VxVM Volume related operations cab be done using the below commands

  • vxassist
  • vxresize
  • vxvol / vxrecover

VxVM Volume Operations


VxVM Advanced Administration

To administrate Dynamic Multipathing and Device Discovery layer we use the commands

  • vxdmpadm
  • vxddladm

Advanced VxVM Commands


Examples for VxVM Admistration using Commands


Initialize disks c1t0d0, c1t1d0, c1t2d0, c2t0d0, c2t1d0, and c2t2d0:

# vxdisksetup -i c1t0d0
# vxdisksetup -i c1t1d0
# vxdisksetup -i c1t2d0
# vxdisksetup -i c2t0d0
# vxdisksetup -i c2t1d0
# vxdisksetup -i c2t2d0

Create a disk group named database1 and add the six disks:

# vxdg init database1 disk01=c1t0d0 disk02=c1t1d0 disk03=c1t2d0
# vxdg -g database1 adddisk disk04=c2t0d0 disk05=c2t1d0 disk06=c2t2d0

Using the top down (modern) technique, create a RAID-5 volume named db01 of size 2 GB on the six disks (5 + log). Also, create and mount a UFS file system on the volume:

# vxassist -g database1 make db01 2g layout=raid5 disk01 disk02 disk03 disk04 disk05 disk06
# newfs /dev/vx/rdsk/database1/db01
# mkdir /db01
# mount /dev/vx/dsk/database1/db01 /db01

Remove the volume database1:

# umount /db01
# vxvol stop database1
# vxedit -g database1 -r rm db01

Using the bottom up technique, create a two-way mirrored volume named db02 of size 1 GB using disks disk01, disk04:


• 1 GB = 2097152 sectors
• Subdisks should be cylinder aligned.
• If disk uses 1520 sectors/cylinder, subdisk size = 2097600 sectors.

# vxmake -g database1 sd sd01 disk01,0,2097600
# vxmake -g database1 sd sd02 disk04,0,2097600
# vxmake -g database1 plex plex01 sd=sd01:0/0
# vxmake -g database1 plex plex02 sd=sd02:0/0
# vxmake -g database1 -U fsgen vol db02 plex=plex01,plex02
# vxvol start db02

Change the permissions of the volume so that dba is the owner and dbgroup is the group:
# vxedit set user=dba group=dbgroup mode=0744 db02
Destroy volume and remove disks from disk group database1. Also, remove disks from volume manager control:

# vxedit -g database1 -rf rm db02
# vxdg -g database1 rmdisk disk01 disk02 disk03 disk04 disk05
# vxdg deport database1
# vxdiskunsetup c1t1d0
# vxdiskunsetup c1t2d0
# vxdiskunsetup c1t3d0...

Advanced vxmake Operation: Create a three-way striped volume:

# vxmake -g spice sd sd01 spice01,0,1520000
# vxmake -g spice sd sd02 spice02,0,1520000
# vxmake -g spice sd sd03 spice03,0,1520000
# vxmake -g spice plex plex1 layout=stripe ncolumn=3 stwidth=64k sd=sd01:0/0,sd02:1/0,sd03:2/0
# vxmake -g spice -U fsgen vol db5 plex=plex1
# vxvol -g spice start db5

Advanced vxmake Operation: Create a RAID 0+1 volume with a DRL Log:

# vxmake -g spice sd sd01 spice01,0,194560
# vxmake -g spice sd sd02 spice02,0,194560
# vxmake -g spice sd sd03 spice03,0,194560
# vxmake -g spice sd sd04 spice04,0,194560
# vxmake -g spice sd logsd spice01,194560,2
# vxmake -g spice plex plex1 layout=stripe ncolumn=2 stwidth=64k sd=sd01:0/0,sd02:1/0
# vxmake -g spice plex plex2 layout=stripe ncolumn=2 stwidth=64k sd=sd03:0/0,sd04:1/0
# vxmake -g spice plex logplex log_sd=logsd
# vxmake -g spice -U fsgen vol db6 plex=plex1,plex2,logplex
# vxvol -g spice start db6



 Disk Operations Task CommandInitialize 
disk vxdisksetup -i device vxdiskadd devicevxdiskadm option 1, “Add or initialize one or more disks”Uninitialize disk vxdiskunsetup device
 List disks vxdisk listList disk header vxdisk list diskname|deviceEvacuate a disk vxevac -g diskgroup from_disk to_disk
Rename a disk vxedit -g diskgroup rename oldname newnameSet a disk as a spare vxedit -g diskgroup set spare=on|off diskname
 Unrelocate a disk vxunreloc -g diskgroup original_diskname
 Disk Group OperationsTask CommandCreate disk group vxdg init diskgroup diskname=device
 Add disk to disk group vxdg -g diskgroup adddisk diskname=device Deport disk group vxdg deport diskgroup
 Import disk group vxdg import diskgroup Destroy disk group vxdg destroy diskgroup List disk groups vxdg list
 List diskgroup details vxdg list diskgroup Remove disk from diskgroup vxdg –g diskgroup rmdisk diskname
 Upgrade disk group version vxdg [-T version] upgrade diskgroup Move an object between DGs vxdg move sourcedg targetdg object...
 Split objects between DGs vxdg split sourcedg targetdg object... Join disk groups vxdg join sourcedg targetdg
List objects affected by a disk group move operation vxdg listmove sourcedg targetdg object...Subdisk Operations
 Create a subdisk vxmake -g diskgroup sd subdiskname diskname offset length Remove a subdisk
 vxedit -g diskgroup rm subdisk_name Display subdisk info vxprint –st vxprint -l subdisk_name 
Associate a subdisk to a plex vxsd assoc plex_name subdisk_name
 Dissociate a subdisk vxsd dis subdisk_name
 Plex Opertions Create a plex vxmake -g diskgroup plex plex_namesd=subdisk_name,…
 Associate a plex (to a volume) vxplex –g diskgroup att vol_name plex_name 
Dissociate a plex vxplex dis plex_name Remove a plex vxedit –g diskgroup rm plex_name List all plexes vxprint -lp
 Detach a plex vxplex –g diskgroup det plex_name Attach a plex vxplex –g diskgroup att vol_name plex_name 
Volume Operations create a volume vxassist -g diskgroup make vol_name size layout=format diskname
 Or vxmake -g diskgroup vol vol_name len=size plex plex_name 
Remove a volume vxedit -g diskgroup -rf rm vol_name or vxassist -g diskgroup remove volume vol_name
 Display a volume vxprint -g diskgroup -vt vol_name vxprint -g diskgroup -l vol_name Change
 volume attributes vxedit -g diskgroup set field=value vol_name
 vxvol field=value … 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 -g diskgroup vol_name [+|-]length Start/Stop volumes
 start a volume vxvol start vol_name Start all volumes vxvol startall Start all volumes in a dg vxvol -g diskgroup startall
 Stop a volume vxvol stop vol_name Stop all volumes vxvol stopall Recover a volume vxrecover -sn vol_name
 List unstartable volumes vxinfo [vol_name] Mirror an existing plex vxassist -g diskgroup mirror vol_name or 
vxmake -g diskgroup plex plex_namesd=subdisk_name
 vxplex -g diskgroup att vol_name plex_name vOLUME SNAPSHOTS Create a snapshot volume 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
 Dissociate a snapshot vxassist -g diskgroup snapclear snapshot_vol Print snapshot information
 vxassist -g diskgroup snapprint vol_name
 Relayout a volume vxassist -g diskgroup relayout vol_name layout=new_layout [attributes...] 
To or from a layered vxassist -g diskgroup convert vol_name layout layout=new_layout 
[attributes...] Add a log to a volume vxassist –g diskgroup addlog vol_name Create and mount a VxFS file system on a volume
 mkfs -F vxfs /dev/vx/rdsk/diskgroup/vol_name mkdir /mount_point mount
 -F vxfs /dev/vx/rdsk/diskgroup/vol_name /mount_point DMP, DDL, and Task Management
 Task Command Manage tasks vxtask list vxtask monitor
 Manage device discovery layer (DDL) List supported disk arrays vxddladm listsupport 
Exclude support for an array vxddladm excludearray libname=library
 vxddladm excludearray vid=vid pid=pid Reinclude support vxddladm includearray libname=library vxddladm includearray vid=vid pid=pid
 List excluded arrays vxddladm listexclude Manage dynamic multipathing (DMP) List controllers
 on system vxdmpadm listctlr all Display subpaths vxdmpadm getsubpaths ctlr=ctlr Display DMP nodes 
vxdmpadm getdmpnode nodename=nodename Enable/disable I/O to controller
 vxdmpadm enable ctlr=ctlr vxdmpadm disable ctlr=ctlr
 Display enclosure attributes vxdmpadm listenclosure all Rename an enclosure vxdmpadm setattr enclosure orig_name name=new_name


I have started unixadminschool.com ( aka gurkulindia.com) in 2009 as my own personal reference blog, and later sometime i have realized that my leanings might be helpful for other unixadmins if I manage my knowledge-base in more user friendly format. And the result is today's' unixadminschool.com. You can connect me at - https://www.linkedin.com/in/unixadminschool/

14 Responses

  1. Ramesh says:

    Very useful doc .. Many Thanks

  2. Muneeb says:

    good piece of information. Thank you!

  3. Yogesh Raheja says:

    @Muneed, thank you very much!..

  4. Ronel says:

    Can’t see the snapshot commandline… Please renew those parts.
    Very clear guide, thx!

  5. kiran says:

    nice doc… how can i find the part 1 or page 1 of the above doc ?

  6. kiran says:

    Rather lesson 1 

  7. Ramdev Ramdev says:

    kiran, here is the link – http://gurkulindia.com/main/2011/06/beginners-lesson-1-veritas-volume-manager-for-solaris/  . Anyway I will update the link in the post directly.

  8. kiran says:

    cool.. thanks 

  9. amit sharma says:

    Hi Ramdev,
    so nice documents , could you please facilitate with VXVM part on RHEL. If already ,could you give Link.
    thanks in advance.

  1. April 2, 2012

    search engine marketing…

    […]unix administration @ gurkulindia.com » VxVM Beginners Lesson2 – Commands and Examples[…]…

  2. September 15, 2015

    […] VxVM Beginners – Commands and Examples – Part 2 […]

  3. September 17, 2015

    […] VxVM Beginners – Commands and Examples – Part 2 […]

  4. September 18, 2015

    […] Read – VxVM Learning with Commands and Examples […]

What is in your mind, about this post ? Leave a Reply

  Our next learning article is ready, subscribe it in your email

What is your Learning Goal for Next Six Months ? Talk to us