San Francisco

dave spink toolset


VxFS TASKS:

CREATE FS DEPORT DG IMPORT DG REPLACE DRIVE
INCREASE FS EXTEND STRIPE DECOM VERIFY DMP
REMOVE MIRROR RENAME DG COMMANDS


CREATE FILE SYSTEM

Get disks under Veritas Control.

# syminq	**check you have disks
# devfsadm
# vxdctl initdmp
# vxdctl enable
# vxdisk -o alldgs -e list
# /usr/sbin/vxdisk -f init emcpowerXXXs2

If you have problems getting the disk under VX control ensure any old entries are removed.

# mydisk=emcpower14a
# vxdisk rm $mydisk
# vxddladm rmforeign pathname=/dev/dsk/$mydisk
# vxddladm rmforeign pathname=/dev/rdsk/$mydisk

Create a disk group and add an additional disk into the group. Alternatively "vxdiskadd cXtXdX cXtXdX.."

# vxdg init $mydg vol01=cXtXdX
# vxdg -g $mydg adddisk vol02=cXtXdX

Create sub-disks (these are like partitions of disk, but from public region). Alternatively "vxassist -g $mydg make vol01 200m"

# vxmake -g $mydg sd vol01-01 vol01 len=100m
# vxmake -g $mydg sd vol02-01 vol02 len=100m

Create a striped plex from the sub-disks.

# vxmake -g $mydg plex plex01 layout=stripe ncolumn=2 stwidth=64k sd=vol01-01,vol02-01

Create a volume attaching the plexes to it.

# vxmake -g $mydg -U fsgen vol vol01 plex=plex01

Start the volume, create and mount file system.

# vxvol -g $mydg startall
# /opt/VRTS/bin/mkfs -F vxfs -o bsize=8192,largefiles /dev/vx/rdsk/$mydg/vol01
# mkdir /mytest
# mount /dev/vx/dsk/$mydg/vol01 /mytest


DEPORT DISK GROUP

Review vfstab to determine mount points, then unmount.

# cat /etc/vfstab
# umount $myfs

Stop volumes and check they stopped.

# vxvol -g $mydg stopall 
# vxinfo -g $mydg

Deport disk groups.

# vxdg deport $mydg


IMPORT DISK GROUP

Let Veritas rescan and check vtoc.

# vxdctl enable

Import disk group.

# vxdg -C import $mydg

Start volume, run vxrecover if needed.

# vxrecover -b -s -g $mydg  ***if needed
# vxvol -g $mydg startall

Check and mount file system.

# fsck -F vxfs -o full,nolog -y /dev/vx/dsk/$mydg/${myvol}
# mount -F vxfs /dev/vx/dsk/$mydg/${myvol} ${mymount}


REPLACE DRIVE

A reminder of steps to complete when replacing a failed drive.

  1. Veritas to check structure of controllers
  2. Test disk activity - format / analyse / read
  3. Rremove mirrors
  4. Remove disk
  5. Take disk out
  6. Insert disk
  7. Re-mirror in correct order


INCREASE FILE SYSTEM

Increasing a file system using vxassist.

# modinfo | grep vx
# df -k | grep vol04
# vxprint -htg d1pr0001-appp01dg vol04
# vxprint -ht -g d1pr0001-appp01dg
# vxassist -g d1pr0001-appp01dg growto vol04 11g appp07dg
# df -k
# vxprint -htg d1pr0001-appp01dg vol04
# /usr/lib/fs/vxfs/fsadm -F vxfs -b 11g /oracle/app/data04
# fstyp -v /dev/vx/rdsk/d1pr0001-appp01dg/vol04
# vxprint -htg d1pr0001-appp01dg vol04


EXTEND STRIPE

Extending a stripe from 3 disks to 4 disks, note need additional 5 disk spare.

# nohup vxassist -g d1pr0004-testdg relayout vol02 layout=stripe ncol=4 disk01 disk02 disk03 disk04 &
# vxtask list


DECOM

To remove a disk / volume from veritas control.

# vi /etc/vfstab	***comment the volume(s) you're destroying out of vfstab
# umount $myfs

Stop and remove volume.

# vxvol -g $mydg stop $myvol
# vxedit -rf rm $myvol

Remove the disk(s) the volume was on from the disk group ( up to the last disk ).

# vxdg -g $mydg rmdisk dmdiskname01

Remove the the disk(s) from VXVM control.

# vxdisk rm c1t1d51s2

If you wish do get rid of the disk group (in order to recover the last disk), you must destroy the disk group.

# vxdg destroy $mydg

Remove the last disk.

# vxdisk rm c2t7d9s2

If you're removing the disks be sure to clean up.

# devsfadm -Cv
# disks
# vxdctl enable


VERIFY DMP TEST

Start I/O to the Veritas Volume and identify the CLARiion or Symmetrix devices under the volume.

# vxprint -v

Choose one of the devices and determine if all paths are active.

# vxdisk list device

Determine the controller that is sending I/O.

# iostat -xn

Disconnect the cable path to host HBA or block port. Verify that the path choosen is disabled.

# vxdisk list device

Verify that I/O is still running.

# iostat -xn


REMOVE MIRROR

Remove veritas mirrors from boot environment disk (rootmirror).

# vxprint -ht | grep swapvol
.. vxprint check other volumes
# vxassist -g rootdg remove mirror swapvol alloc=rootdisk
# vxassist -g rootdg remove mirror rootvol alloc=rootdisk
# vxassist -g rootdg remove mirror var alloc=rootdisk
# vxassist -g rootdg remove mirror opt alloc=rootdisk

Remove the boot environment disk from Veritas control.

# /usr/sbin/vxdg -g rootdg rmdisk rootmirror
# /etc/vx/bin/vxdiskunsetup -C c0t1d0


RENAME DG and VOLUMES

Stop all volumes in the disk group and deport.

# vxvol -g $mydg stopall
# vxdg deport $mydg

To import the disk group, $mydg, and rename it as $mynewdg.

# vxdg -n $mynewdg import $mydg
# vxdg list 

Recover the disk group by the new dg name.

# vxrecover -g $mynewdg -sb

Rename each volume and mount file system.

# vxedit -g $mynewdg rename oldvol01 san01
# vxedit -g $mynewdg rename oldvol02 san02
# vi vfstab	*** update your mount points and remount the volumes
# mount -F vxfs /dev/vx/dsk/$mynewdg/${myvol} ${mymount}