Changeset 2149 in MondoRescue for devel/mindi/sbin/mranalyze-lvm
- Timestamp:
- Feb 16, 2009, 5:50:07 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/mindi/sbin/mranalyze-lvm
r2119 r2149 15 15 use Data::Dumper; 16 16 use English; 17 use File::Basename;18 use File::Copy;19 use File::stat;20 use File::Temp qw(tempdir);21 use POSIX qw(strftime);22 17 use lib qw (lib); 23 18 use ProjectBuilder::Base; 24 19 use ProjectBuilder::Distribution; 20 use MondoRescue::Base; 21 use MondoRescue::Mindi::LVM; 25 22 26 23 =pod … … 137 134 138 135 # -------------------------------- main ----------------------------------- 139 my ($lvmver,$lvmcmd) = mr_lvm_check();140 141 136 # Where to send the output 142 137 my $OUTPUT = \*STDOUT; … … 146 141 } 147 142 148 print $OUTPUT "LVM:$lvmver";143 my $ret = mr_lvm_analyze($OUTPUT); 149 144 150 # Analyze the existing physical volumes 151 open(LVM,"$lvmcmd pvdisplay -c |") || mr_exit(-1,"Unable to execute $lvmcmd pvdisplay -c"); 152 while (<LVM>){153 print $OUTPUT "PV:$_";145 if ($ret == 0) { 146 pb_log(1,"No LVM handling") 147 } else { 148 pb_log(1,"LVM v$lvmver Structure Analyzed") 154 149 } 155 close(LVM); 156 157 # Analyze the existing volume groups 158 open(LVM,"$lvmcmd vgdisplay -c |") || mr_exit(-1,"Unable to execute $lvmcmd vgdisplay -c"); 159 while (<LVM>) { 160 print $OUTPUT "VG:$_"; 161 } 162 close(LVM); 163 164 # Analyze the existing logical volumes 165 open(LVM,"$lvmcmd lvdisplay -c |") || mr_exit(-1,"Unable to execute $lvmcmd lvdisplay -c"); 166 while (<LVM>) { 167 print $OUTPUT "LV:$_"; 168 } 169 close(LVM); 170 150 close($OUTPUT); 171 151 mr_exit(0,undef); 172 173 sub mr_exit {174 175 my $code = shift;176 my $msg = shift;177 178 close(OUTPUT);179 print $msg."\n" if ((defined $msg) and ($pbdebug >= 0));180 die "ERROR returned\n" if ($code < 0);181 print "No LVM handling\n" if (($code > 0) and ($pbdebug >= 0));182 exit($code);183 }
Note:
See TracChangeset
for help on using the changeset viewer.