Skip to content
Snippets Groups Projects
Select Git revision
  • b017d3091599b86a841c6f4f11d0e110bfb45207
  • master default protected
2 results

Linux_lvm.pm

Blame
  • Linux_lvm.pm 6.27 KiB
    #!/usr/bin/perl
    # $Id: Linux_lvm.pm,v 1.1 2014/01/02 11:25:33 gonter Exp $
    
    =pod
    
    =head1 NAME
    
    chfs.pl  --  change filesystem properties
    
    =head1 USAGE
    
    chfs.pl -a size=+I<n>I<S> F<path>
    
    Write the commands necessary to expand the filesystem F<path> by adding
    I<n> units of I<S> (K, M, G, T) bytes (1K= 1024 bytes).
    
    =cut
    
    package Util::Linux_lvm;
    
    use strict;
    
    use Data::Dumper;
    $Data::Dumper::Indent= 1;
    
    my @paths= qw(/usr/sbin /sbin);
    
    my @caller= caller ();
    # print "caller=[",join (':', @caller),"]\n";
    # __PACKAGE__->main if (!defined (@caller) || ($caller[0] eq 'main' && $caller[1] eq '-'));
    __PACKAGE__->main unless (@caller);
    __PACKAGE__->test if (($caller[0] eq 'main' && $caller[1] eq '-'));
    
    sub new
    {
      my $class= shift;
      bless {}, $class;
    }
    
    sub test
    {
      print Dumper (\%main::);
    }
    
    sub main
    {
      my @pgm= split ('/', $0);
      my $pgm= pop (@pgm);
    
      # print "b=[", $pgm, "]\n";
    
         if ($pgm eq 'chfs')    { main_fs1 ('chfs'); }
      elsif ($pgm eq 't_df')    { test_df (); }
      elsif ($pgm eq 't_mount') { test_mount (); }
      elsif ($pgm eq 't_gg1')   { test_gg1 (); }
      elsif ($pgm eq 'tunefs')  { main_tunefs (); }
      else { &usage; }
    }
    
    sub test_mount
    {
      my $fs= &get_mount ();
      print 'fs=', Dumper ($fs), "\n";
    }
    
    sub test_df
    {
      my $fs= &get_df ();
      print 'fs=', Dumper ($fs), "\n";
    }