• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

UnixArena

  • Home
  • kubernetes
  • DevOps
    • Terraform
    • Jenkins
    • Docker
    • Openshift
      • OKD
    • Ansible engine
    • Ansible Tower
      • AWX
    • Puppet
  • Cloud
    • Azure
    • AWS
    • Openstack
    • Docker
  • VMware
    • vCloud Director
    • VMware-Guests
    • Vcenter Appliance 5.5
    • vC OPS
    • VMware SDDC
    • VMware vSphere 5.x
      • vSphere Network
      • vSphere DS
      • vShield Suite
    • VMware vSphere 6.0
    • VSAN
    • VMware Free Tools
  • Backup
    • Vembu BDR
    • Veeam
    • Nakivo
    • Azure Backup
    • Altaro VMBackup
    • Spinbackup
  • Tutorials
    • Openstack Tutorial
    • Openstack Beginner’s Guide
    • VXVM-Training
    • ZFS-Tutorials
    • NetApp cDot
    • LVM
    • Cisco UCS
    • LDOM
    • Oracle VM for x86
  • Linux
    • How to Articles
    • Q&A
    • Networking
    • RHEL7
  • DevOps Instructor-led Training
  • Contact

VXVM Tutorial3 – Diskgroup Operations

March 23, 2013 By Cloud_Devops 10 Comments

                          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 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

Task:1-Creating the new disk group:

uarena#vxdg init UXDG UXDISK1=disk_0 UXDISK2=disk_1
uarena#vxdisk list
DEVICE TYPE DISK GROUP STATUS
disk_0 auto:cdsdisk UXDISK1 UXDG online
disk_1 auto:cdsdisk UXDISK2 UXDG 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

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 STATUS
disk_0 auto:cdsdisk UXDISK1 UXDG online
disk_1 auto:cdsdisk UXDISK2 UXDG online
disk_2 auto:ZFS - - ZFS
disk_3 auto:ZFS - - ZFS
disk_4 auto:cdsdisk UXDISK3 UXDG online
disk_5 auto:cdsdisk - - online
disk_6 auto:cdsdisk - - online

Task:3-Removing the disk:

You can remove the disk any time from DG if it’s not used in any volume.
uarena#vxdg -g UXDG rmdisk UXDISK3
uarena#vxdisk list
DEVICE TYPE DISK GROUP STATUS
disk_0 auto:cdsdisk UXDISK1 UXDG online
disk_1 auto:cdsdisk UXDISK2 UXDG 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
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 LENGTH FLAGS
UXDISK1 disk_0 disk_0 0 143056 -
UXDISK2 disk_1 disk_1 0 143056 -
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

To find the deported diskgroup disks,

uarena#vxdisk -o alldgs list
DEVICE TYPE DISK GROUP STATUS
disk_0 auto:cdsdisk - (UXDG) online
disk_1 auto:cdsdisk - (UXDG) 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
Task:6–Importing the deported diskgroup:
uarena#vxdg import UXDG
uarena#vxdg list
NAME STATE ID
UXDG enabled,cds 1364022395.37.sfos
uarena#vxdisk list |grep UXDG
disk_0 auto:cdsdisk UXDISK1 UXDG online
disk_1 auto:cdsdisk UXDISK2 UXDG 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 can’t 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
To take current configuration backup,
# /etc/vx/bin/vxconfigbackup
VxVM vxconfigbackup ERROR V-5-2-3694 Configuration Copy for diskgroup UXDG has not changed since last backup (Wed Mar 27 21:21:39 IST 2013). Backup is not necessary.
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
Display the configuration file in readable format:
#cd /etc/vx/cbr/bk/UXDG.1364474089.57.sfos
# cat 1364474089.57.sfos.cfgrec |vxprint -D - -htr
Disk group: UXDG
dg UXDG default default 25000 1364474089.57.sfos
dm UXDISK1 disk_0 auto 65536 143056 -
dm UXDISK2 disk_1 auto 65536 143056 -
v  oravol1   -  ENABLED  ACTIVE   143360   SELECT    -        fsgen
pl oravol1-01 oravol1 ENABLED ACTIVE 143360 CONCAT - RW
sd UXDISK1-01 oravol1-01 UXDISK1 0 143056 0 disk_0 ENA
sd UXDISK2-01 oravol1-01 UXDISK2 0 304 143056 disk_1 ENA
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
Thank you for reading the this.If you have any doubt ,please leave comment.I will get back to you .

Filed Under: Tutorials, VXVM, VXVM-Training

Reader Interactions

Comments

  1. Ananth says

    October 27, 2016 at 8:23 pm

    Hello Sir,

    1)Is it a compulsion to deport the DG and then re-name to a new DG name ??
    2) What will happen to the existing disks in the renamed DG ??
    3)If a filesystem is mounted using a particualr DG and the DG is deported to rename and then again imported with the new DG name,will it not effect the filesystem ??

    Reply
  2. S Laxma Reddy says

    August 18, 2016 at 4:30 pm

    Hi ,

    Its a good tutorial, it would have been a great tutorial If you

    1) had covered what are all the steps do we need to take when we are planning to deport a disk group, especially the disk group which has volume with important data. even though the volumes have important data still we want to deport the disk group.

    2) while importing from remote machine what happens if we don’t use persistent=yes parameter?

    any way a good tutorial. thanks

    Thanks a lot.

    Reply
  3. Ravi Shankar Mittal says

    August 18, 2016 at 8:11 am

    A basic tutorial in nutshell knowledge. Thanks for sharing such a nice document.

    Reply
  4. Naveen says

    May 26, 2016 at 5:43 pm

    Hi Lingeswaran,

    Really good doc . Thank you

    Reply
  5. Pranesh says

    May 16, 2016 at 12:11 pm

    Hi Lingeswaran,

    Nice document on VXVM

    Reply
  6. Pradeep Kumar says

    February 4, 2016 at 2:27 pm

    Hi Lingeswaran,

    Nice tutorial on vxvm.. Is deporting a DG online or offline? Also i need theory on this deporting a DG? Where can i get it? Thanks.

    Reply
  7. Arun says

    March 13, 2014 at 11:44 am

    Thank You sir

    Reply
  8. Lingeswaran R says

    June 8, 2013 at 2:13 am

    Sorry.You can't add disk without specifying diskgroup in vxdg command.

    Reply
  9. jayaprakasan says

    June 6, 2013 at 3:28 pm

    hi boss
    i have one question
    if i add new disk to existing disk group using
    vxdg UXDG adddisk UXDISK4=disk_4 without -g
    what will will happen ?

    Reply
    • Pawan says

      December 26, 2014 at 10:04 pm

      Without -g switch you can’t add new disk to existing DG. You can try in your LAB machine. This is a very good tutorial. Thanks for sharing this.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Follow UnixArena

  • Facebook
  • LinkedIn
  • Twitter

Copyright © 2025 · UnixArena ·

Go to mobile version