Site icon UnixArena

SCRIPT:To calculate VXVM’s vxprint values & vxdisk size

VXVM script

We have seen how to calculate the vxprint and vxdisk values manually in the last post.But in  very busy work schedule, its very difficult to spend  time for calculating those values.I have developed the bash shell script(works for solaris) which will give you the volume size ,plex size,Disk size and sub-disk size (GB’s) of specific diskgroup in seconds.Adding to that this script will report the  Diskgroup size and free space in the diskgroup.The only thing you have to do is copy the script and make it executable.Once you have started the script ,it will prompt for diskgroup name.After entering the diskgroup name,just select the object to to find the size of it and enter the object name.

You can download the Script here .

Environment details:
Operating system:Solaris 10
Veritas volume manager :6.0
bash-3.00# vxdg list
NAME         STATE           ID
UADG         enabled,cds          1368807817.12.sfos
bash-3.00# vxprint -hv
Disk group: UADG

TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
v  vol1         fsgen        ENABLED  204800   -        ACTIVE   -       -
pl vol1-01      vol1         ENABLED  204800   -        ACTIVE   -       -
sd DISK1-01     vol1-01      ENABLED  143056   0        -        -       -
sd DISK2-01     vol1-01      ENABLED  61744    143056   -        -       -

bash-3.00# vxdisk list |grep UADG
disk_4       auto:cdsdisk    DISK1        UADG         online
disk_5       auto:cdsdisk    DISK2        UADG         online
disk_6       auto:cdsdisk    DISK3        UADG         online


Usage of the script :
Download the script to and copy to the server.Make the script to executable and run it.

# ls -lrt |grep vxprint_size_details.sh
-rwx------   1 root     root        3876 May 20 00:21 vxprint_size_details.sh
bash-3.00# ./vxprint_size_details.sh
Enter the diskgroup name: UADG
Diskgroup UADG size is = .20 GB
Free space/Unallocated space in diskgroup UADG is = 109.55 MB
------------------------------------------------
To know the size of volume/plex/subdisks;continue
------------------------------------------------

Enter a number 1=SUBDISK,2=PLEX,3=VOLUME,4=DISK > 1
Enter the Subdisk Name:DISK1-01
The Subdisk DISK1-01 size is=.06 GB

Enter a number 1=SUBDISK,2=PLEX,3=VOLUME,4=DISK > 1
Enter the Subdisk Name:DISK2-01
The Subdisk DISK2-01 size is=.02 GB

Enter a number 1=SUBDISK,2=PLEX,3=VOLUME,4=DISK > 2
Enter the Plex Name:vol1-01
The plex vol1-01 size is=.09 GB

Enter a number 1=SUBDISK,2=PLEX,3=VOLUME,4=DISK > 3
Enter the Volume Name:vol1
The volume vol1 size is=.09 GB

Enter a number 1=SUBDISK,2=PLEX,3=VOLUME,4=DISK > 4
Enter the Veritas Disk Name:disk_4
The size of the disk disk_4=.06 GB

Enter a number 1=SUBDISK,2=PLEX,3=VOLUME,4=DISK > 4
Enter the Veritas Disk Name:disk_6
The size of the disk disk_6=.06 GB

Enter a number 1=SUBDISK,2=PLEX,3=VOLUME,4=DISK > ^C


You can stop the script by just pressing control+c .

To get the details of another diskgroup, just stop the script and start it.
If you enter incorrect values or incorrect objects names,you will get the below error.

bash-3.00# ./vxprint_size_details.sh
Enter the diskgroup name: testdg
----------------------------------------------------------------------------------------------
Diskgroup testdg is not imported in sfos ;Thank you for using UnixArena's Vxprint_size.sh script
----------------------------------------------------------------------------------------------
bash-3.00# ./vxprint_size_details.sh
Enter the diskgroup name: UADG
Diskgroup UADG size is = .20 GB
Free space/Unallocated space in diskgroup UADG is = 109.55 MB
------------------------------------------------
To know the size of volume/plex/subdisks;continue
------------------------------------------------

Enter a number 1=SUBDISK,2=PLEX,3=VOLUME,4=DISK > 6
--------------------------------------------------------------------------------------
Please enter the correct option;Thank you for using UnixArena's Vxprint_size.sh script
--------------------------------------------------------------------------------------

Enter a number 1=SUBDISK,2=PLEX,3=VOLUME,4=DISK > 1
Enter the Subdisk Name:arena
---------------------------------------------------------------
Sub-disk arena is not part of UADG or incorrect sub-diskname
---------------------------------------------------------------

Enter a number 1=SUBDISK,2=PLEX,3=VOLUME,4=DISK > 2
Enter the Plex Name:unixarena
-----------------------------------------------------
Plex unixarena is not part of UADG or incorrect Plex name
-----------------------------------------------------

Enter a number 1=SUBDISK,2=PLEX,3=VOLUME,4=DISK > 3
Enter the Volume Name:UA
-----------------------------------------------------------
Volume UA is not part of UADG or incorrect Volume name
-----------------------------------------------------------

Enter a number 1=SUBDISK,2=PLEX,3=VOLUME,4=DISK > 4
Enter the Veritas Disk Name:UADISK
-----------------------------------------------------------
The entered disk is not part of UADG or incorrect disk name
-----------------------------------------------------------

Enter a number 1=SUBDISK,2=PLEX,3=VOLUME,4=DISK > ^C
bash-3.00#


Hope this helps.Thank you for visiting. Please leave your valuable feedback.

Let me know if you have any doubt,I will get back to you.

Exit mobile version