Servicios

Web hosting
Ver »
Páginas Web
Ver »
Soporte UNIX
Ver »
UNIX TIPS
Ver »

Veritas Volume Manager

VERITAS EDUCATION QUICK REFERENCE

List  Commands in PDF

  •  Basic        VxVM Commands
  •  Advance   VxVM Commands
  •  Filesystem VxFS Commands


  • Disk Commands

    Operation Command Example
    Initialize disk vxdisksetup vxdisksetup -i c1t9d0
    publen=2048000
    Uninitialize disks vxdiskunsetup vxdiskunsetup -C c1t9d0
    List disks vxdisk list  
    List disk header vxdisk list vxdisk list disk01
    List disk private region vxprivutil list vxprivutil list /dev/rdsk/c1t9d0s2
    Reserve a disk vxedit set vxedit -g my-dg set reserve=on my-disk
    Rename a disk vxedit rename vxedit -g my-dg rename my-disk new-disk
    Rescan all disks vxdctl enable  

    Disk Group Commands

    Operation Command Example
    Create disk group vxdg init vxdg init my-dg disk01=c1t9d0
    Remove disk group vxdg destroy vxdg destroy my-dg
    Add disk vxdg adddisk vxdg -g my-dg adddisk disk02=c1t8d0
    Display about the volumes
    vxprint
    vxprint -ht
    Remove disk vxdg rmdisk vxdg -g my-dg rmdisk disk02
    Import diskgroup vxdg import vxdg import my-dg
    Deport diskgroup vxdg deport vxdg deport my-dg
    List diskgroups vxdg list vxdg -o alldgs -e list
    List free space vxdg free vxdg -g my-dg free
    List total free space vxassist vxassist -g my-dg maxsize layout=concat
    Rename diskgroup on deport vxdg deport vxdg -n new-dg deport old-dg
    Rename diskgroup on import vxdg import vxdg -n new-dg import old-dg
    Evacuate data from a disk vxevac vxevac -g my-dg fromdisk todisk(s)

    Plex Commands

    Operation Command Example
    Create a plex vxmake plex vxmake -g my-dg plex my-plex sd=my-sd
    Associate a plex vxplex att vxplex -g my-dg att my-vol my-plex
    Dis-associate a plex vxplex dis vxplex -g my-dg dis my-plex
    Attach a plex vxplex att vxplex -g my-dg att my-vol my-plex
    Detach a plex vxplex det vxplex -g my-dg det my-plex
    List plexes vxprint vxprint -lp
    Remove a plex vxedit vxedit -g my-dg rm my-plex

    Subdisk Commands

    Operation Command Example
    Create a subdisk vxmake sd vxmake -g my-dg my-sd disk1,1,5000
    Remove subdisk vxedit rm vxedit -g my-dg rm my-sd
    Display subdisk info vxprint -st  
    Associate subdisk to plex vxsd assoc vxsd -g my-dg assoc my-plex my-sd
    Disassociate subdisk vxsd dis vxsd -g my-dg dis my-sd

    Volume Commands

    Operation Command Example
    Create a volume vxassist make vxassist -g my-dg make my-vol 1G
    vxassist make my-vol 1G layout=stripe
    Delete a volume vxedit rm vxedit -g my-dg -r rm my-vol
    Display volume info vxprint -vt vxprint -g my-dg -vt
    Display volume info vxinfo vxinfo -g my-dg my-vol
    Resize a volume vxassist growto
    vxassist growby
    vxresize -g diskgroup my-volumen +1024m # Usar
    vxresize -g diskgroup my-volumen +1g # Usar

    vxassist -g my-dg growto my-vol 2G
    vxassist -g my-dg growby my-vol 600M

    add space to mount point using growfs (if vxresize does not work)

    vxassist -g datadg growby volume +1g
    growfs -M /db003 /dev/vx/rdsk/rootdg/vol3


    Real Example - Server production

    root # vxassist -g prasdbmx maxsize
    Maximum volume size: 2082816 (1017Mb)

    root # vxassist -g prasdbmx remove volume lvprueba
    root # vxassist -g prasdbmx maxsize
    Maximum volume size: 190826496 (93177Mb)

    root # vxassist -g prasdbmx make mxpras74 32g
    root # vxassist -g prasdbmx make mxpras75 32g

    Asignar propietario y grupo a disco Vx
    root # vxedit -g prasdbmx set user=sybase group=sybase mxpras74
    root # vxedit -g prasdbmx set user=sybase group=sybase mxpras75


    Start a volume vxvol start vxvol -g my-dg start my-vol
    vxvol -g my-dg startall
    Stop a volume vxvol stop vxvol -g my-dg stop my-vol
    Initialise a volume vxvol init active vxvol -g my-dg init active my-vol
    Recover a volume vxrecover vxrecover -g my-dg my-vol
    Mirror a volume vxassist mirror vxassist -g my-dg mirror my-vol
    Add log to a volume vxassist addlog vxassist -g my-dg addlog my-vol
    Snapshot a volume vxassist snapstart
    vxassist snapshot
    vxassist -g my-dg snapstart my-vol
    vxassist -g my-dg snapshot my-vol my-snap
    Change volume layout vxassist relayout vxassist -g my-dg relayout my-vol layout=stripe
    vxassist -g diskgroup make vol_name size layout="striped" "mirror" ncol="No. de Disks" diskname-1 diskname-n
    Convert volume type vxassist convert vxassist -g my-dg convert my-vol layout=stripe-mirror
    Estimate max volume size vxassist maxsize
    vxassist maxgrow
    vxassist -g my-dg maxsize layout=... disk1 diskn
    vxassist -g my-dg maxgrow my-vol
    Remove a volume vxassist remove vxassist -g my-dg remove volume my-vol
    Remove a volume vxvol stop
    vxedit -r rm
    vxdg rmdisk
    vxvol -g my-dg stop my-vol
    vxedit -g my-dg -r rm my-vol
    vxdg -g my-dg rmdisk my-disk
    Help on layout vxassist help vxassist help layout

    Multipathing Commands

    Operation Command Example
    Display enclusres vxdmpadm listenclosure vxdmpadm listenclosure all
    Display controllers vxdmpadm listctlr vxdmpadm listctlr all
    Display subpaths vxdmpadm getsubpaths vxdmpadm getsubpaths ctlr=c3
    vxdmpadm getsubpaths dmpnodename=EMC_CLARiiON2_4
    Examples

    Copy a disk to another disk via mirroring:

    Create the initial disk, plex, volume, and filesystem:
    test1[root]182: vxdg init bob_dg c0t12d0=c0t12d0
    test1[root]183: vxassist -g bob_dg make bob_vol 1000m
    test1[root]184: mkfs -F vxfs /dev/vx/rdsk/bob_dg/bob_vol
    version 6 layout
    2048000 sectors, 1024000 blocks of size 1024, log size 16384 blocks
    largefiles supported
    test1[root]203: mount -F vxfs /dev/vx/dsk/bob_dg/bob_vol /vxd

    Create new disk for mirror:
    test1[root]204: vxdisksetup -i c0t0d0 publen=2048
    test1[root]205: vxprint
    Disk group: bob_dg

    TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
    dg bob_dg bob_dg - - - - - -

    dm c0t12d0 c0t12d0s2 - 8378496 - - - -

    v bob_vol fsgen ENABLED 2048000 - ACTIVE - -
    pl bob_vol-01 bob_vol ENABLED 2048000 - ACTIVE - -
    sd c0t12d0-01 bob_vol-01 ENABLED 2048000 0 - - -

    Add disk to dg:
    test1[root]206:
    vxdg -g bob_dg adddisk c0t0d0=c0t0d0
    test1[root]207: vxprint
    Disk group: bob_dg

    TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
    dg bob_dg bob_dg - - - - - -

    dm c0t0d0 c0t0d0s2 - 2048 - - - -
    dm c0t12d0 c0t12d0s2 - 8378496 - - - -

    v bob_vol fsgen ENABLED 2048000 - ACTIVE - -
    pl bob_vol-01 bob_vol ENABLED 2048000 - ACTIVE - -
    sd c0t12d0-01 bob_vol-01 ENABLED 2048000 0 - - -


    small, remove and recreate c0t0d0, this time defining public size (this is a 2G disk):

    test1[root]208: vxdg -g bob_dg rmdisk c0t0d0
    test1[root]209: vxdisksetup -i c0t0d0 publen=2048000
    test1[root]210: vxdg -g bob_dg adddisk c0t0d0=c0t0d0
    test1[root]211: vxprint
    Disk group: bob_dg

    TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
    dg bob_dg bob_dg - - - - - -

    dm c0t0d0 c0t0d0s2 - 2048000 - - - -
    dm c0t12d0 c0t12d0s2 - 8378496 - - - -

    v bob_vol fsgen ENABLED 2048000 - ACTIVE - -
    pl bob_vol-01 bob_vol ENABLED 2048000 - ACTIVE - -
    sd c0t12d0-01 bob_vol-01 ENABLED 2048000 0 - -


    Add subdisk and plex and then attach:
    test1[root]212: vxmake -g bob_dg sd c0t0d0-02 c0t0d0,0,2048000
    test1[root]213: vxmake -g bob_dg plex bob_vol-02 sd=c0t0d0-02
    test1[root]214: vxplex -g bob_dg att bob_vol bob_vol-02

    test1[root]215: vxprint
    Disk group: bob_dg

    TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
    dg bob_dg bob_dg - - - - - -

    dm c0t0d0 c0t0d0s2 - 2048000 - - - -
    dm c0t12d0 c0t12d0s2 - 8378496 - - - -

    v bob_vol fsgen ENABLED 2048000 - ACTIVE - -
    pl bob_vol-01 bob_vol ENABLED 2048000 - ACTIVE - -
    sd c0t12d0-01 bob_vol-01 ENABLED 2048000 0 - - -
    pl bob_vol-02 bob_vol ENABLED 2048000 - ACTIVE - -
    sd c0t0d0-02 bob_vol-02 ENABLED 2048000 0 - - -

    Mirror is complete, now detach original plex (1G took about 5 minutes to mirror):
    test1[root]217: vxplex -g bob_dg det bob_vol-01
    test1[root]218: vxprint
    Disk group: bob_dg

    TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
    dg bob_dg bob_dg - - - - - -

    dm c0t0d0 c0t0d0s2 - 2048000 - - - -
    dm c0t12d0 c0t12d0s2 - 8378496 - - - -

    v bob_vol fsgen ENABLED 2048000 - ACTIVE - -
    pl bob_vol-01 bob_vol DETACHED 2048000 - IOFAIL - -
    sd c0t12d0-01 bob_vol-01 ENABLED 2048000 0 - - -
    pl bob_vol-02 bob_vol ENABLED 2048000 - ACTIVE - -
    sd c0t0d0-02 bob_vol-02 ENABLED 2048000 0 - - -

    Remove and disassociate plex:
    test1[root]219: vxplex -g bob_dg -o rm dis bob_vol-01
    test1[root]220: vxprint
    Disk group: bob_dg

    TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
    dg bob_dg bob_dg - - - - - -

    dm c0t0d0 c0t0d0s2 - 2048000 - - - -
    dm c0t12d0 c0t12d0s2 - 8378496 - - - -

    v bob_vol fsgen ENABLED 2048000 - ACTIVE - -
    pl bob_vol-02 bob_vol ENABLED 2048000 - ACTIVE - -
    sd c0t0d0-02 bob_vol-02 ENABLED 2048000 0 - - -

    Remove disk:
    test1[root]226: vxdg -g bob_dg rmdisk c0t12d0
    test1[root]227: vxprint
    Disk group: bob_dg

    TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
    dg bob_dg bob_dg - - - - - -

    dm c0t0d0 c0t0d0s2 - 2048000 - - - -

    v bob_vol fsgen ENABLED 2048000 - ACTIVE - -
    pl bob_vol-02 bob_vol ENABLED 2048000 - ACTIVE - -
    sd c0t0d0-02 bob_vol-02 ENABLED 2048000 0 - - -
    ---------------------- IDENTIFICAR DISCOS EN EL DISKGROUP -------------------------------------------------------------

    # vxdisk list | grep g5
    EMC0_15      auto:cdsdisk    g5mx_dg02    g5mx_dg      online
    EMC0_27      auto:cdsdisk    g5mx_dg01    g5mx_dg      online nohotuse
    EMC0_46      auto:cdsdisk    g5mx_dg03    g5mx_dg      online

    # vxdisk list EMC0_27
    Device:    EMC0_27
    devicetag: EMC0_27
    type:      auto
    hostid:    oracle2
    disk:      name=g5mx_dg01 id=1144107047.158.oracle2-adm
    group:     name=g5mx_dg id=1144107048.160.oracle2-adm
    info:      format=cdsdisk,privoffset=256,pubslice=2,privslice=2
    flags:     online ready private autoconfig nohotuse autoimport imported
    pubpaths:  block=/dev/vx/dmp/EMC0_27s2 char=/dev/vx/rdmp/EMC0_27s2
    version:   3.1
    iosize:    min=512 (bytes) max=256 (blocks)
    public:    slice=2 offset=2304 len=70703616 disk_offset=0
    private:   slice=2 offset=256 len=2048 disk_offset=0
    update:    time=1191742081 seqno=0.40
    ssb:       actual_seqno=0.0
    headers:   0 240
    configs:   count=1 len=1280
    logs:      count=1 len=192
    Defined regions:
     config   priv 000048-000239[000192]: copy=01 offset=000000 enabled
     config   priv 000256-001343[001088]: copy=01 offset=000192 enabled
     log      priv 001344-001535[000192]: copy=01 offset=000000 enabled
     lockrgn  priv 001536-001679[000144]: part=00 offset=000000
    Multipathing information:
    numpaths:   1
    emcpower9c      state=enabled

    # powermt display dev=emcpower9
    Pseudo name=emcpower9a
    Symmetrix ID=000190100385
    Logical device ID=008E
    state=alive; policy=SymmOpt; priority=0; queued-IOs=0
    ==============================================================================
    ---------------- Host ---------------   - Stor -   -- I/O Path -  -- Stats ---
    ### HW Path                 I/O Paths    Interf.   Mode    State  Q-IOs Errors
    ==============================================================================
    2306 pci@3c/pci@1/fibre-channel@4 c10t8d9s0 FA 13aA   active  alive      0      0
    2304 pci@1c/pci@1/fibre-channel@4 c9t7d9s0  FA  4aA   active  alive      0      0





    vxvm:vxmend: ERROR: Plex ampras01-01 not in STALE state

    # vxmend -g prasam fix clean ampras01-01
    # vxmend -g prasam fix stale ampras01-01

    Validar que no exista algun plex con status DISABLE

    # vxprint -htg prasmx |grep DISABLE

    Iniciar Volumen despues de corregir Status de Plex

    # vxvol -g prasam start ampras01
    # vxvol -g rootdg -f start sybase

    Summary of plex states


    State Description Comments
    CLEAN Plex is up to date the volume is shutdown When the volume is started other plexes can sync from this
    ACTIVE The plex is active Plex is working in the volume
    STALE Plex needs to be resynced Plex must be synced with other plexes to make it active
    EMPTY No data on the plex or veritas does not know what state the data is in All plexes are this state at creation time may be for
    OFFLINE The pex is not currently participating in the volume When brought back on line the plex goes into a stale state
    IOFAIL The plex is detached from the volume The only way to fix this is to replace the failed disk but veritas can still read the private region on the disk
    NODEVICE No disk access recorded The disk can not be read at all
    REMOVED Disk device for the plex is removed The disk has been manually removed


    hanging state of plexes

    From To How
    Any EMPTY vxmend fix empty plex name
    Any OFFLINE vxmend fix off
    OFFLINE STALE vxmend fix on
    STALE CLEAN vxmend fix clean
    CLEAN STALE vxmend fix stale
    STALE ACTIVE vxmend fix active
    Normal State Changes    
    EMPTY CLEAN vxvol init clean
    CLEAN ACTIVE vxvol start
    STALE ACTIVE vxplex att
    ACTIVE CLEAN vxvol stop
    ACTIVE STALE vxplex det
    IOFAIL or NODEV REMOVED vxdiskadm (option 4)
    REMOVED STALE vxdiskadm (option 5)
    ACTIVE STALE vxplex det

    vxvm: STATUS DISABLED RECOVER NODEVICE en el plex

    root@pssrv # vxdisk list
    DEVICE TYPE DISK GROUP STATUS
    c0t0d0s2 sliced - - error
    c0t1d0s2 sliced - - error
    c0t2d0s2 sliced disk01 rootdg online
    c1t0d0s2 sliced - - error
    c1t1d0s2 sliced - - error
    c1t2d0s2 sliced - - online
    c7t6d80s2 sliced dmx_psamdg_01 psamdg online
    c7t6d81s2 sliced dmx_psamdg_02 psamdg online
    c7t6d82s2 sliced dmx_psamdg_03 psamdg online
    c7t6d83s2 sliced dmx_psmxdg_01 psmxdg online
    c7t6d84s2 sliced dmx_psmxdg_02 psmxdg online
    c7t6d85s2 sliced dmx_psamdg_04 psamdg online
    -                    -                    mirror3     rootdg     failed was:c1t2d0s2

    Scanear los dispositivos para que veritas lo vuelva a retomar.

    root@pssrv # vxreattach
    root@pssrv # vxdctl enable
    root@pssrv # vxdisk list
    DEVICE TYPE DISK GROUP STATUS
    c0t0d0s2 sliced - - error
    c0t1d0s2 sliced - - error
    c0t2d0s2 sliced disk01 rootdg online
    c1t0d0s2 sliced - - error
    c1t1d0s2 sliced - - error
    c1t2d0s2 sliced mirror3 rootdg online
    c7t6d80s2 sliced dmx_psamdg_01 psamdg online
    c7t6d81s2 sliced dmx_psamdg_02 psamdg online
    c7t6d82s2 sliced dmx_psamdg_03 psamdg online
    c7t6d83s2 sliced dmx_psmxdg_01 psmxdg online
    c7t6d84s2 sliced dmx_psmxdg_02 psmxdg online
    c7t6d85s2 sliced dmx_psamdg_04 psamdg online
    root@pssrv #

    Validar que no exista algun plex con status DISABLE

    # vxprint -htg rootdg | grep DISABLE

    Corregir los plex regenerando los mirrors

    # vxmend -g rootdg -o force off psdbamx-02
    # vxmend -g rootdg on psdbamx-02
    # vxplex -g rootdg det psdbamx-02
    # vxplex -g rootdg -o rm dis psdbamx-02
    # vxassist -g rootdg mirror psdbamx alloc=disk2

    Regresar


    Random TIPS

    Removing "Drive Not Available" from Solaris

    These are steps I followed to remove the LUNS which were unmasked from the system.
    Removing the Unused/Unmasked LUNS from Solaris.

    1. First Step is identifying the from Format o/p.
    2. Remove them from Volume Manager. In my case, they are veritas. so I used vxdisk rm
    3. look at the cfgadm -al o/p to find the disks which are failing. they are failing because they are unmasked from this system and still OS sees them.
    c3::50060482d53135b8,84 disk connected configured failing
    c3::50060482d53135b8,86 disk connected configured failing
    c3::50060482d53135b8,87 disk connected configured failing
    3. luxadm -e offline /dev/rdsk/ # This will kick the device from failing to unusable. and also removes them from format o/p.
    4. cfgadm -o unusable_FCP_dev -c unconfigure c3::50060482d53135b8
    # This will remove all unusable LUNS from system for particular controller and target id. don't worry there might be some working devices on that target. This command won't affect them. they'll be in working state only.
    5. clean the device files using devfsadm -Cv
    6. You should be clear now in both format and cfgadm -al.

    free counters