Changeset 2542 in MondoRescue
- Timestamp:
- Jan 9, 2010, 4:40:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/mr/lib/MondoRescue/LVM.pm
r2541 r2542 137 137 138 138 my $OUTPUT = shift; 139 my $lvm; 139 140 140 141 my ($lvmver,$lvmcmd) = mr_lvm_check(); 141 142 return(0) if ($lvmver == 0); 142 143 143 print $OUTPUT "LVM:$lvmver ";144 print $OUTPUT "LVM:$lvmver\n"; 144 145 145 146 # Analyze the existing physical volumes 146 open(LVM,$lvmcmd."pvdisplay -c |") || mr_exit(-1,"Unable to execute ".$lvmcmd."pvdisplay -c"); 147 #open(LVM,$lvmcmd."pvdisplay -c |") || mr_exit(-1,"Unable to execute ".$lvmcmd."pvdisplay -c"); 148 open(LVM,$lvmcmd."pvs --noheadings --nosuffix --units m --separator : |") || mr_exit(-1,"Unable to execute ".$lvmcmd."pvs"); 147 149 while (<LVM>) { 150 s/^[\s]*//; 151 my ($pv,$vg,$foo,$foo2,$size,$foo3) = split(/:/); 152 $lvm->{$vg}->{'pv'}[$lvm->{$vg}->{'pvnum'}] = $pv; 153 $lvm->{$vg}->{'pvnum'}++; 154 $lvm->{$vg}->{$pv}->{'size'} = $size; 148 155 print $OUTPUT "PV:$_"; 149 156 } … … 151 158 152 159 # Analyze the existing volume groups 153 open(LVM,$lvmcmd."vgdisplay -c |") || mr_exit(-1,"Unable to execute ".$lvmcmd."vgdisplay -c"); 160 #open(LVM,$lvmcmd."vgdisplay -c |") || mr_exit(-1,"Unable to execute ".$lvmcmd."vgdisplay -c"); 161 open(LVM,$lvmcmd."vgs --noheadings --nosuffix --units m --separator : |") || mr_exit(-1,"Unable to execute ".$lvmcmd."vgs"); 154 162 while (<LVM>) { 163 s/^[\s]*//; 155 164 print $OUTPUT "VG:$_"; 156 165 } … … 158 167 159 168 # Analyze the existing logical volumes 160 open(LVM,$lvmcmd."lvdisplay -c |") || mr_exit(-1,"Unable to execute ".$lvmcmd."lvdisplay -c"); 169 #open(LVM,$lvmcmd."lvdisplay -c |") || mr_exit(-1,"Unable to execute ".$lvmcmd."lvdisplay -c"); 170 open(LVM,$lvmcmd."lvs --noheadings --nosuffix --units m --separator : |") || mr_exit(-1,"Unable to execute ".$lvmcmd."lvs"); 161 171 while (<LVM>) { 172 s/^[\s]*//; 162 173 print $OUTPUT "LV:$_"; 163 174 } 164 175 close(LVM); 165 return($lvm ver);176 return($lvm); 166 177 } 167 178
Note:
See TracChangeset
for help on using the changeset viewer.