in reply to Get # of 512 byte blocks
#!/usr/bin/perl -T use strict; use warnings; use CGI qw/:standard/; # Clean up our UNIX environment # for more infor read perldoc perlsec $ENV{'PATH'} = '/bin:/usr/bin'; delete @ENV{qw(IFS CDPATH ENV BASH_ENV)}; my ($x,$pp,$mb,$fs,@MSG); print header,start_html; print "<h3><center><tt>AIX 512 byte block calculator</center></h3>\n", +br,hr,br; print start_form; print p,"From an AIX commandline type lsvg \<vgname>\n",br; print "You should see output looking something like the following:\n", +br; print p,"<pre> VOLUME GROUP: rootvg VG IDENTIFIER: 000345df7dda4 +98a VG STATE: active PP SIZE: 32 megabyte(s +) VG PERMISSION: read/write TOTAL PPs: 1084 (34688 m +egabytes) MAX LVs: 256 FREE PPs: 797 (25504 me +gabytes) LVs: 10 USED PPs: 287 (9184 meg +abytes) OPEN LVs: 8 QUORUM: 1 TOTAL PVs: 2 VG DESCRIPTORS: 3 STALE PVs: 0 STALE PPs: 0 ACTIVE PVs: 1 AUTO ON: yes MAX PPs per PV: 1016 MAX PVs: 32 </pre>",br; print p,"The fields we are interested in here are <b>PP SIZE</b>, and +<b>FREE PPs</b>\n",br; print "Enter the PP SIZE and the number of MB (Mega Bytes) you want to + enlarg your system by, below.\n",br; print "Enter the name of your filesystem in the final textfield and hi +t submit.\n",br; print "The AIX command that you will need to enter at the command line + as the root user will be displayed.\n",br; print p,"Physical Partition Size in MB\n",br; print textfield('PP'),br; print p,"Size to grow FS by in MB\n",br; print textfield('MB'),br; print p,"AIX Filesystem name\n",br; print textfield('FS'),p,submit; $pp=param('PP'); $mb=param('MB'); $fs=param('FS'); if ( $pp && $mb ) { print p,"<b>chfs -a size=+"; $x = ( $mb <= $pp ) ? print 2 * (1024 * $pp) : print (2 * (1024 * $mb)) - (2 * $pp); print " /$fs</b></tt>\n"; } else { print "",br; } print br,end_html;
|
|---|