Wednesday, 7 May 2008

Veritas Commands


  • Create Some Volumes in a disk group

    vxassist -g $DG make $volume 5g
    vxassist -g $DG make $volume 10g
    vxassist -g $DG make $volume 10g

  • Rename volumes

    vxedit -g $DG -v rename $volume1 $volume2

  • show disks in a device group

    vxdisk -g $DG list

  • how much can a volume be grown?

    vxassist -g $DG maxgrow $volume

  • how much is free on each disk in a disk group. Results in 512b blocks on solaris


    vxdg -g $DG free

  • how big is the biggest fileystem that can be created


    vxassist -g $DG maxsize

  • As above with layout specified

    vxassist -g $DG maxsize layout=stripe
    vxassist -g $DG maxsize layout=raid5
    vxassist -g $DG maxsize layout=concat

  • info about a disk group

    vxprint -hrtg $DG

  • remove a volume from a disk group

    vxassist -g $DG remove volume $volume

  • relayout to a concat

    vxassist -g $DG relayout $volume layout=concat

  • see what's happening in the background

    vxtask -l list

  • increase a volume and it's filesystem at the same time

    vxresize -g $DG $volume 3584m
    vxresize -g $DG $volume +5g

  • Is veritas licensed? Check exit code.

    /opt/VRTS/bin/vxlicrep

  • You can only create/resize volumes on the cluster host which is the master. This will tell you if the host is a master a slave or inactive (not in a cluster).


    vxdctl -c mode

  • To enable multipath (dmp) paths use

    vxdmpadm enable path=$_base_dev

  • To bring a disk under veritas control

    vxdisksetup -if $_emc_path format=cdsdisk privlen=32m

  • Add a disk to a veritas disk group

    vxdg -g $DG adddisk $DISK_NAME=$EMC_DEV_NAME

  • How much space will be used in overheads on a veritas filesystem?


    ((bytes in device) / (bytes/block) * (2 bits/block) / (8 bits/byte)) + (bytes in log) + (2 MB misc)


    for a 10 GB file system create via

    mkfs -o bsize=1024,logsize=16m
    the formula gives:


    (10G/1024*2/8)+16M+2M
    or
    ((10 * 2^30) / 1024 * 2 / 8) + (16 * 2^20) + (2 * 2^20) = 21495808 bytes
    or
    (10737418240 / 1024 * 2 / 8) + 16777216 + 2097152 = 21495808 = 20.5MB
    A clean 10G filesystem uses 20543488 bytes = 19.6 MB

    Which is close enough for an estimate.
  • remove a volume
    umount /mount/point
    vxassist -g $DG remove volume $volume

  • remove a disk group
    vxdg destroy $DG


  • To resize a volume and say which disks to leave alone
    vxresize -g $DG $volume 68G !${DG}_008 !${DG}_009

  • To move all the data off some disks so that they can be removed
    vxassist -g $DG move $volume !${DG}_008 !${DG}_009

  • Remove the disks from the disk group
    vxdg -g $DG rmdisk ${DG}_008 ${DG}_009

  • Rename the remainaing disks in the disk group
    vxedit -g $DG -d rename ${DG}_010 ${DG}_003

No comments: