Veritas reminders

Based on VXVM v3.0.4 on Solaris 2.6 and Solaris 8

Installation
1. pkgadd VRTSvxvm
  • You can also install VRTSvmdoc (PDF and PostScript docs), VRTSvmman (man pages),
    VRTSvmsa (vmsa Java GUI), VRTSvmdev (optional developers’ package)
  • VRTSvxvm contains kernel drivers vxdmp, vxio, vxspec
    and installs stuff into /usr/lib/vxvm, /etc/vx, /sbin/vxconfigd, /usr/sbin/vx*, /etc/rc2.d & /etc/rcS.d
  • it also modifies /etc/devlink.tab, /etc/system, and copies libthread.so and libc.so to /etc/vx/slib
    2. run vxinstall and follow the prompts (licences, encapsulation, disk initialisation etc.)
    after vxinstall, ‘ vxdisk list’ and vxprint should show some output
    Licences are installed in /etc/vx/elm
    3. (optional) add /opt/VRTSvxvm/man to your MANPATH and /etc/vx/bin to your PATH

    To encapsulate the root (swap,var..) disk :
    N.B. the root disk must have 2 slices free
    run vxdiskadm and follow instructions
    afterwards, there are more forceloads in /etc/system (scsi, pci, sd..), and also at the end of /etc/system:

    rootdev:/pseudo/vxio@0:0
    set vxio:vol_rootdev_is_volume=1
    and /etc/vfstab is modified to contain vx devices ( the old copy of vfstab is renamed to vfstab.prevm)
    vxprint
    will now show new volumes created for any filesystems you had on your root disk (swapvol, usr, home..)

    To mirror the root disk :
    To do this, you must add a new disk (which must have slice 0 free) to the rootdg disk group. You may have done this during vxinstall; if not, you can do this using

    vxdisksetup –i c0t1d0s2
    vxdg adddisk diskt1=c0t1d0s2
    Now mirror root disk:
    /etc/vx/bin/vxrootmir diskt1
    And mirror the other volumes onto the new disk:
    vxassist mirror swapvol diskt1
    vxassist mirror var diskt1
    vxassist mirror usr diskt1
    …etc

    To create a new filesystem/volume:
    vxassist make robin2 100m [ disk1 disk2 ]
    mkfs /dev/vx/rdsk/robin2 204800

    ( 100 MB = 204800 sectors of 512 bytes) mount /dev/vx/dsk/robin2 /mnt
    Create a disk group:
    vxdg init testdg test01=c0t3d4

    Delete ("deport") a disk group:

    vxdg deport testdg

    To remove filesystem/volume:

    umount /mnt
    vxassist remove volume robin2

     or vxvol stop robin2
       vxedit –rf rm robin

    Remove a disk from a disk group:
    vxdg –g testdg rmdisk test01
    See largest size of a new volume :
    # vxassist maxsize
    Maximum volume size: 21950464 (10718Mb)

    Add a hot spare disk to a disk group:

    vxdg adddisk disk03=c0t1d0s2
    vxedit set spare=on disk03
    See largest size a volume can be grown by :
    # vxassist maxgrow usr
    Volume usr can be extended by 21950464 to: 28242970 (13790Mb+1050 sectors)

    Grow a filesystem/volume:

    vxassist growto robin2 200m
    or
    vxassist growby robin2 50m
    Then you have to run mkfs to grow the filesystem:
    mkfs /dev/vx/rdsk/robin2 512000
     (512000 = 250mb ) It’s easier to use vxresize:
    /etc/vx/bin/vxresize robin2 250m
    Remove a mirror:
    vxassist remove mirror robin2 [ !plex-name ]
    or (better) vxplex –o rm dis plex-name

    Dissociate plex from volume:

    vxplex dis plex-name
    Dissociate sub-disk from plex:
    vxsd dis subdisk-name
    remove volume :
    vxedit rm vol-name
    Remove subdisk/plex:
    vxedit rm name

    Show free disk space (i.e. free ‘chunks’, space not allocated to sub-disks):

    # vxdg free
    GROUP   DISK   DEVICE   TAG   OFFSET   LENGTH FLAGS
    rootdg diskt0 c0t0d0s2 c0t0d0 1857239 5779554 -
    rootdg diskt0 c0t0d0s2 c0t0d0 20221805 15658302 -

    Show disks:

    # vxdisk list
    DEVICE   TYPE   DISK   GROUP   STATUS
    c0t0d0s2 sliced diskt0 rootdg online
    c0t1d0s2 sliced   -     -     error    <-- this disk not initialised, not part of Vol.Mgr

    View a summary:

    # vxprint -S
    Disk group: rootdg    (Plexfree and SDFREE show plexes/sub-disks not allocated to a volume)
    VOLUMES PLEXES SUBDISKS PLEXFREE SDFREE DISKS
    6       6       7       0       0       1

    See exact layout of sub-disks on the disk

    # vxprint -st
    Disk group: rootdg
    SD NAME PLEX DISK DISKOFFS LENGTH [COL/]OFF DEVICE MODE
    SV NAME PLEX VOLNAME NVOLLAYR LENGTH [COL/]OFF AM/NM MODE
    sd diskt0-02 rootvol-01 diskt0 0 262371 1 c0t0d0 ENA
    sd diskt0-01 swapvol-01 diskt0 262371 262372 0 c0t0d0 ENA
    sd diskt0-05 var-01 diskt0 524743 819544 0 c0t0d0 ENA
    sd diskt0-06 robin2-01 diskt0 1344287 512952 0 c0t0d0 ENA
    sd diskt0-04 usr-01 diskt0 7636793 6292506 0 c0t0d0 ENA
    sd diskt0-03 home-01 diskt0 13929299 6292506 0 c0t0d0 ENA
    sd diskt0-B0 rootvol-01 diskt0 35880107 1 0 c0t0d0 ENA

    vxprint options:

    -G    show a list of all disk groups
    -p    show plexes
    -v    show volumes
    -s    show sub-disks
    -d    show hard disks (only initialised disks)
    -e ‘expr’    -select specific info, e.g:
    e.g. find all volumes/plexes which have a subdisk smaller than 100MB :
    vxprint –e ‘v_plex.pl_sd.sd_len < 100M’
    or find which plex/vol uses a particular sub-disk:
    # vxprint -e ' pl_sd="diskt0-03" '
    TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
    pl home-01 home ENABLED 6292506 - ACTIVE - -
    sd diskt0-03 home-01 ENABLED 6292506 0 - - -
    or find which volumes use a particular hard disk:
    # vxprint -e ' pl_sd.sd_disk="diskt0" '
    TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
    pl home-01 home ENABLED 6292506 - ACTIVE - -
    sd diskt0-03 home-01 ENABLED 6292506 0 - - -

    pl rootvol-01 rootvol ENABLED 262372 - ACTIVE - -
    sd diskt0-B0 rootvol-01 ENABLED 1 0 - - Block0
    sd diskt0-02 rootvol-01 ENABLED 262371 1 - - -

    Recreating volumes / plexes / subdisks
    (in this case, 'vxassist remove mirror testvol' had removed the wrong side of the mirror)
    re-create the sub-disk

    vxmake sd diskt0-06 diskt0,20221805,8390008   (sizes from your saved vxprint –st info!)
    re-create the plex
    vxmake plex testvol-02 sd=diskt0-06
    re-create the volume
    vxmake –Ufsgen vol testvol2 plex=testvol-02 (after this, vxprint shows STATE=EMPTY)
    initialise the volume
    vxvol init clean testvol2 testvol-02 (sets KSTATE=DISABLED; STATE=CLEAN)
    start the volume
    vxrecover –s testvol2 (sets STATE=ACTIVE)

    VX snapshots
    for doing consistent online backups.
    NB to do snapshots, you must have spare disk space on a separate disk (as if you were going to mirror the volume)

    vxassist snapstart robin2
    vxassist snapshot robin2 vsnap01 (vsnap01 is new temporary volume name)
    (optional) fsck /dev/vx/rdsk/vsnap01
    ufsdump 0f /dev/rmt/0 /dev/vx/rdsk/vsnap01

    Uninstalling VXVM
    unmount filesystems, transfer them to non-vxvm disks (e.g. using ufsdump)

    vxassist remove vol vol-name
    vxdg rmdisk disk-name
    vxdctl stop
    vxiod –f set 0 (this stops the 10 or so kernel vxiod threads)