Disks
Initialize disk |
## increase the private region size default 1024 ## change the default of a disk Note: format can be either sliced, simple, cdsdisk or none (see above - Disk Regions) |
Uninitialize disk | vxdiskunsetup -C c2t0d0 |
Disk Information | vxdisk -g <group> list <disk> vxdisk -s list |
Resize a LUN | vxdisk -g <group> resize <disk> length=8G |
Add a disk slice to volboot | vxdctl add disk <device> type=simple |
Add a disk slice | vxdisk –f <device> type=simple |
Add a disk | vxdiskadd c1t0d0 or c1 (all disk on controller) vxdisksetup -i <device> |
Remove a disk totally from VM | vxdisk rm <device> |
Remove a disk from a volume | vxdg -g <group> rmdisk <diskname> |
Remove a disk slice from VM | vxdctl rm disk <device> |
Clear any host ID flags | vxdisk clearimport <disk name> |
Renaming a disk | vxedit -g <disk> rename <old disk name> <new disk name> |
Move disk to different disk group | vxdg move <source dg> <target dg> <disk> Note: you must always have one disk in a disk group, you cannot move a disk that is used by a volume |
Offline a disk |
vxdisk offline <dev name> Note: disk must not be in a disk group |
Online a disk |
vxdisk online <dev name> Note: disk must have a private region otherwise you need to initialise the disk |
Hot spare | vxedit –g <group> set spare=on <disk> |
NoHotUse | vxedit –g <group> set nohotuse=on <disk> |
Turn off failing flag | vxedit -g <group> set failing=off <disk> |
Encapsulate a disk | vxdisk define c0t0d0s0 type=nopriv |
Reattach disk (SAN) |
vxreattach [-br | -c <device>] -b = Background process |
Discover new disks | vxdisk scandisks [new | fabric ] |
Disk Comment | vxedit -g <group> set comment="......." <disk> |
Private region problem |
## Here i am fixing a "online altused" issue but search the web for different issues as there are a number of ways to the same thing, just remember the vxprivutil command ## obtain the disks private region tag 15 ## run the below script ## if now errors reported above and in the file, then dd back to disk ## repeat for any other bad disks |
Disk Group
Create a disk group | vxdg init group <disk>=<device> vxdg init <group> <disk>=<device> cds=off - initialize a non-cds disk group |
Remove a group | vxdg destroy <group> |
Add a disk to a group | vxdg –g <group> adddisk <disk>=<device> |
Remove a disk from a group | vxdg –g <group> rmdisk <disk> |
Replace failed disk |
vxdg -k -g <group> adddisk <disk>=<device> -k = forces vxvm to take media name of the failed disk & assign it to the new disk |
Import a group |
vxdg import <group> |
Import group (clear any flags) |
vxdg import -C <group> -C - clears any exist host flags |
Deport a group | vxdg deport <group> vxdg -n <new-group-name> deport <old_group_name> |
List no hot use on disk | vxdg –g <group> nohotuse |
List spare space on disk | vxdg –g <group> spare |
Display free space | vxdg –g <group> free |
Backup disk group (vxvm 4.0) | vxconfigbackup |
Restore disk group (vxvm 4.0) | vxconfigrestore [-p|-d|-c] |
Diskgroup Version | vxdg list <group> | grep -i version |
Upgrade disk version | vxdg upgrade <group> - upgrade to current version vxdg -T 50 upgrade <group> - upgrade to version 50 vxdg -T 50 init <group> <disk>=<device> - creater new group @ version 50 |
Boot/Default DG | vxdg bootdg vxdg defaultdg vxdctl defaultdg <group> - set defaultdg |
Volume
Adding mirror to root | /etc/vx/bin/vxrootmir <alternate> create rootvol, swap vol, |
Create a simple volume |
vxassist make <volume> <size> <disk> vxassist make <volume> <size> <disk> layout=[stripe-mirror|concat-mirror|mirror-concat|mirror-stripe] stripe-mirror = layered volume |
Mirror a simple volume | vxassist mirror <volume> <disk> vxassist -g <group> remove mirror <vol> !disk01 - remove the disk01 mirror |
Create a stripped volume |
vxassist make <volume> <size> layout=stripe vxassist -g <group> -o ordered make <vol> <size> layout=stripe ncol=3 <disk1> <disk2> <disk3> |
Create mirrored volume with log | vxassist make <volume> <size> layout=mirror, log nmirror=# nlog=# Note: for information about logging see logging section below |
Create a raid volume | vxassist make <volume> <size> layout=raid5 |
Create a raw volume |
vxassist -U <usage_type> make <volume> <size> alloc='<disk>' types: |
Remove a volume |
vxedit –rf rm <volume> Note: you must disable the volume first |
Initializing a volume | vxvol init state <volume> [plex]state=clean,enable,active |
Online Relayout |
vxassist -g <group> relayout <vol> layout=stripe ncol=2 # Display the relayout operation |
Remove a volume off a particular disk | ## either make sure there is a another disk in the group, you can even specify it vxassist -g <group> move <vol> \!<disk> [<disk>] |
Rename a volume | vxedit -g <group> rename <old_vol_name> <new_vol_name> |
Starting a volume | vxvol start <volume> |
Start a disabled volume |
vxrecover –sb <volume> -s = start volume after recovery |
Disable a volume | vxvol -g <group> stop <volume> |
Evacuate a volume | vxevac -g <group> <from-disk> <to-disk> |
Maintenance mode | vxvol maint <volume> |
Not clean | vxmend mirror clean <plex> |
No kernel state | vxplex att <vol_name> <plex> |
Extending a volume size | vxresize <volume> <new length> vxresize -g <group> <volume> +100m - increase the volume by 100Mb |
Shrinking a volume size | vxresize <volume> <new length> vxresize -g <group> <volume> -100m - decrease the volume by 100Mb |
add a DRL log to a volume | vxassist addlog <volume> |
remove a DRL log from a volume | vxassist remove log <volume> |
Extending log size | vxvol set loglen = 2m <volume/log> |
Detering volume size | vxassit -g <group> maxsize layout=mirror - the maximum size you can create a mirror vxassist -g <group> maxgrow <volume> - the maximum size the volume can grow too |
Recover a volume |
Vxmend fix clean <plex> |
Change volumes permissions | vxedit -g <group> set owner=<user> group=<group> mode=<perms> <vol> # to display the permissions ls -l /dev/vx/rdsk/<group> |
Plexs
Creating a plex | vxmake plex <plex> sd =<sub disk name> |
Remove a plex | vxplex –o rm dis <plex> vxplex -g <group> dis <plex> vxedit -g <group> -rf rm <plex> |
Moving a plex | vxplex mv <original plex> <new plex> |
Copying a plex | vxplex cp <volume> <new plex> |
Attaching a plex | vxplex att <volume> <plex> |
Detaching a plex | vxplex det <plex> |
Offlining a plex | vxmend off vol01-02 |
Sub-disks
Creating sub-disk | vxmake sd <sub-disk> <disk>, offset, len |
Removing sub-disk | vxedit rm <sub-disk> |
Moving sub-disk | vxsd mv <old sub-disk> <new sub-disk> |
Associating with a plex | vxmake plex <plex> sd=<sub-disk>, … i.e vxmake plex home-1 sd= disk02-01, disk02-00, disk02-02 |
Dissociating | vxsd dis <sub-disk> |
Splitting | vxsd –s<size> split sd<new sub><newsub2> |
Joining | vxsd join <sub-disk1><subdisk2><new subdisk> |
relocating a sub disk | ## either make sure there is a another disk in the group, you can even specify it vxassist -g <group> move <vol> \!<disk> [<disk>] |
relocating a whole disk sub disks |
vxprint -g rootdg -se 'sd_orig_dmname="disk02"' |
Volume Manager Information
Disks |
|
Display all the physical disks |
vxdisk list |
Display detailed disk info | vxdisk list <disk> |
Check for disk failures | vxstat –g <group>–ff –d |
Disk Group |
|
Display group properties | vxdg list |
Display detailed group info | vxdg list <group> |
vxinfo -p -g <group> | |
Volume |
|
Display volume info | vxprint –Aht <vol> |
Display volume properties | vxprint –vl |
Display unstartable volume | vxinfo -g <group> <vol> |
Check for volume failures | vxstat –g <group>–ff -v |
Plex |
|
Display plex properties | vxprint –vp |
Check for plex failures | vxstat –g <group>–ff -p |
Sub-Disks |
|
Display sub-disk properties | vxprint –st |
Veritas Tasks |
|
Display tasks |
vxtask list States: |
Statistics and Tracing |
|
Iostats | vxstat -g <group> -r –d <disks> - reset all stats on disk vxstat -g <group> -d - display stats vxstat -g <group> -i 1 -d <vol> - display stats every 1 sec intervals for volume vxstat -g <group> -i 10 -c 5 -d - display 5 sets @ 10 secs intervals |
Tracing | vxtrace -d <filename> -o dev,disk <vol> vxtrace -f <filename> -o dev,disk <vol> | more |
Licensing
Add | vxlicinst - versions greater than 3.5 vxlicense -c - versions below 3.5 |
View | vxlicrep - versions greater than 3.5 vxlicense -p - versions below 3.5 |
Paths |
/etc/vx/licenses/lic - versions greater than 3.5 |
Reload new license | vxdctl license init |