#!/usr/bin/perl -w ##### + ##### ##### Variables, Path, and Etc... + ##### ##### + ##### $vxass = "/usr/sbin/vxassist"; $vxdg = "/usr/sbin/vxdg"; $vxdisk ="/usr/sbin/vxdisk"; system("clear"); #### Will give you options to choose from for veritas commands + ##### print "This is a simple script which will create a volume.\n"; print " SELECT YOUR CHOICE \n\n"; print "1. Create a volume. \n"; print "2. Make Filesystem. \n"; print "3. Make Disk Group. \n"; print "4. Resizing a Volume. \n"; print "\nSelection: "; chomp($choosen=<STDIN>); ##### Creates A Volume + ##### if($choosen == 1){ print "We will begin Creating a Volume\n"; system("vxdg list"); print "\nWhat is the name of the Disk Group you would like to +add the volume too? \n"; chomp($dg = <STDIN>); print "What do you want the volume to be named?\n"; chomp($vol = <STDIN>); print "How big would you like your volume to be? ex. 100m, 200 +g \n"; chomp($size = <STDIN>); print "What disk will you be using? \n"; system("$vxdisk -g $dg list | awk '{print $3}'"); print "\n\nWhich devices will you be using? \n"; chomp($disks = <STDIN>); print "Will be creating this volume $vol in this Disk G. $dg a +t this size $size \n"; print "Would you like to continue?(y or n): "; chomp($y = <STDIN>); if($y eq "y"){ system("$vxass -g $dg make $vol $size $disks"); }else{ exit; } ##### Creates A Filesystem + ##### }elsif($choosen == 2){ print "We will begin Creating a filesystem\n"; print "What is the name of the volume? \n"; chomp($vol = <STDIN>); print "What is the name of the Disk Group? \n"; chomp($dg = <STDIN>); print "Would you like it to be ufs or vxfs?\n"; chomp($vxfs = <STDIN>); if ($vxfs eq "vxfs"){ print "you will be creating a vx +fs filesystem /dev/vx/rdsk/$dg/$vol... \n"; system("mkfs -F vxfs -o largefiles /dev/vx/rdsk/$dg/$v +ol"); }elsif($vxfs eq "ufs"){ print "you will be creating a +ufs filesystem /dev/vx/rdsk/$dg/$vol... \n"; system("newfs ufs -o largefiles /dev/vx/rdsk/$dg/$vol" +); }else{ exit; } ##### Creates A New Disk Group + ##### }elsif($choosen == 3){print "This will Create a new disk group \n\n\n" +; print "What will be the name of the Disk Group\n"; chomp($dg = <STDIN>); print "Which disk would you like to add?\n"; system("vxdisk list | grep online | grep -"); print "\nPut in the ctd that you would like to use\n"; chomp($disk = <STDIN>); print "Beginning to Create Disk Group $dg\n"; system("vxdg init $dg $disk"); ##### Will Resize A Volume + ##### }elsif($choosen == 4){print "This will resize a volume.\n"; print "What is the name of the Volume? \n"; chomp($vol = <STDIN>); print "What is the name of the disk group that the volume belo +ngs to?\n"; chomp($dg = <STDIN>); print "\n"; system("$vxass -g $dg maxgrow $vol"); print "how much would you like to grow it by? (100m, 2g)\n"; chomp($grow = <STDIN>); print "Are you sure you want to continue?(y or n)\n"; chomp($y = <STDIN>); if($y eq "y"){ print "The filesystem will not be grown if it is 100% +full"; system("$vxass -g $dg growby $vol $size"); }else{ print "exiting....\n"; exit } #open(VFSTAB, "/etc/vfstab"); # while (<VFSTAB>){ # print if /\bvx\b/; # } ##### Exits The Script + ##### }elsif($choosen gt 4){ print "This option isnt available. \n\n\n"; }

In reply to VolumeManagerHelp.pl by JSchmitz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.