VXVM Tutorial3
VXVM Tutorial3
VXVM(veritas volume manager training) 3 of 10 The vxdg utility performs various diskgroup operations that includes the creation of disk groups, addition of disks in to diskgroup,removing disk from diskgroup.This command performs disk group imports and deports as well.Here we are going to see how create a new diskgroup and adding disks in existing diskgroup.In the end of the article we will see how to backup the diskgroup configuration. In the below output you can see, we have five disks which are in VXVM control. We have brought the disk in to vxvm control using vxdisksetup.
uarena#vxdisk list DEVICE TYPE disk_0 auto:cdsdisk disk_1 auto:cdsdisk disk_2 auto:ZFS disk_3 auto:ZFS disk_4 auto:cdsdisk disk_5 auto:cdsdisk disk_6 auto:cdsdisk DISK GROUP STATUS online online ZFS ZFS online online online
Now you can see we have created new diskgroup UXDG using disk_0 & disk_1 and we have assigned the meaning full name to disks. Task:2-Addition of disk: If you want to add the new disk in to existing diskgroup, bring the disk in to vxvm control using vxdisksetup and add it using below command.
uarena#vxdg -g UXDG adddisk UXDISK3=disk_4 uarena#vxdisk list DEVICE TYPE DISK GROUP disk_0 auto:cdsdisk UXDISK1 UXDG disk_1 auto:cdsdisk UXDISK2 UXDG disk_2 auto:ZFS disk_3 auto:ZFS disk_4 auto:cdsdisk UXDISK3 UXDG disk_5 auto:cdsdisk disk_6 auto:cdsdisk STATUS online online ZFS ZFS online online online
Task:3-Removing the disk: You can remove the disk any time from DG if its not used in any volume.
uarena#vxdg -g UXDG rmdisk UXDISK3 uarena#vxdisk list DEVICE TYPE DISK disk_0 auto:cdsdisk UXDISK1 disk_1 auto:cdsdisk UXDISK2 disk_2 auto:ZFS disk_3 auto:ZFS disk_4 auto:cdsdisk disk_5 auto:cdsdisk disk_6 auto:cdsdisk GROUP UXDG UXDG STATUS online online ZFS ZFS online online online
Task:4-Maximum size of volume: If you want to find out how much size volume we can create from the diskgroup, use the below command.In other word to you can determine the free space of the diskgroup.
uarena#vxassist -g UXDG maxsize Maximum volume size: 284672 (139Mb) uarena#vxassist -g UXDG maxsize layout=mirror Maximum volume size: 10240 (60Mb) uarena#vxassist -g UXDG maxsize layout=stripe Maximum volume size: 284672 (139Mb) uarena#vxdg -g UXDG free DISK DEVICE TAG OFFSET UXDISK1 disk_0 disk_0 0 UXDISK2 disk_1 disk_1 0
FLAGS -
Task:5-Deporting diskgroup: After un-mounting the volumes , you can deport the diskgroup.To see the imported diskgroup
uarena#vxdg list NAME STATE ID UXDG enabled,cds 1364022395.37.sfos uarena#vxdg deport UXDG By default vxdisk output will not show the deported diskgroup tag. uarena#vxdisk list DEVICE TYPE DISK GROUP STATUS disk_0 auto:cdsdisk online disk_1 auto:cdsdisk online disk_2 auto:ZFS ZFS disk_3 auto:ZFS ZFS disk_4 auto:cdsdisk online disk_5 auto:cdsdisk online disk_6 auto:cdsdisk online
Sometimes you may need to use -C flag to import the cluster diskgroup to clear the VCS lock. # vxdg -C import DG_NAME Task:7-Re-Naming the Diskgroup: You cant the rename the diskgroup while its in imported state.In a order to rename the DG, you need to re-import with new name.
uarena#vxdg deport UXDG uarena#vxdg -n NEWDG import UXDG uarena#vxdg list NAME STATE ID NEWDG enabled,cds
1364022395.37.sfos
Task:8-Diskgroup configuration backup/restore: Whenever there is a configuration change in diskgroup, automatically vxvm backup the new configuration under /etc/vx/cbr/bk/
bash-3.00# ls -lrt /etc/vx/cbr/bk total 6 drwxr-xr-x 14 root root 18 Mar 27 19:18 UXDG.1364022395.37.sfos drwxr-xr-x 2 root root 6 Mar 27 21:21 UXDG.1364398489.45.sfos
Since there is no configuration chnages VXVM refuse to take backup.Here i am doing small changes.
# /etc/vx/bin/vxresize -g UXDG oravol1 +20M # /etc/vx/bin/vxconfigbackup Start backing up diskgroup UXDG to /etc/vx/cbr/bk/UXDG.1364474089.57.sfos ... VxVM NOTICE V-5-2-3100 Backup complete for diskgroup: UXDG
Note:Default configuration location will be /etc/vx/cbr/bk/ To take the current configuration to specific location,
# /etc/vx/bin/vxconfigbackup -l /var/tmp Start backing up diskgroup UXDG to /var/tmp/UXDG.1364398489.45.sfos....... VxVM NOTICE V-5-2-3100 Backup complete for diskgroup: UXDG # ls -lrt /var/tmp/UXDG.1364398489.45.sfos total 48473 -rw-r--r-- 1 root root Mar28 17:38 1364398489.45.sfos.diskinfo -rw-r--r-- 1 root root Mar28 17:38 1364398489.45.sfos.cfgrec -rw-r--r-- 1 root root Mar28 17:39 1364398489.45.sfos.binconfig -rw-r--r-- 1 root root Mar28 17:39 1364398489.45.sfos.dginfo
To restore the diskgroup configuration, To pre-commit the changes run the following #/etc/vx/bin/vxconfigrestore -p UXDG To commit the changes after the precommit #/etc/vx/bin/vxconfigrestore -c UXDG To abort the pre-commit: #/etc/vx/bin/vxconfigrestore -d UXDG To confirm that disk group is ok: #vxprint -g UXDG