\n";
if ($stat[2]) {
print " | $text{'lv_name'} | \n";
print "$lv->{'name'} | \n";
print "$text{'lv_size'} | \n";
print "",&nice_size($lv->{'size'}*1024)," | \n";
}
else {
print " | $text{'lv_name'} | \n";
print " | \n";
print "$text{'lv_size'} | \n";
print " kB | \n";
}
print " | $text{'lv_petotal'} | \n";
print "",&text('lv_petotals', $vg->{'pe_alloc'}, $vg->{'pe_total'}),
" | \n";
print "$text{'lv_pesize'} | \n";
print "$vg->{'pe_size'} kB | \n";
if ($in{'lv'}) {
print " | $text{'lv_device'} | \n";
print "$lv->{'device'} | \n";
print "$text{'lv_status'} | \n";
if (!@stat) {
print $text{'lv_notused'};
}
else {
$msg = &device_message(@stat);
print $msg;
}
print " | \n";
}
if ($lv->{'is_snap'}) {
print " | $text{'lv_snapof'} | \n";
if ($in{'lv'}) {
# Show which LV this is a snapshot of
local @snapof = grep { $_->{'size'} == $lv->{'size'} &&
$_->{'has_snap'} } @lvs;
if (@snapof == 1) {
print "$snapof[0]->{'name'}";
}
else {
print "$text{'lv_nosnap'}";
}
}
else {
# Allow selection of snapshot source
print "\n";
}
print " | \n";
}
elsif ($stat[2]) {
# Display current permissons and allocation method
print " | $text{'lv_perm'} | \n";
print "",$text{"lv_perm".$lv->{'perm'}}," | \n";
print "$text{'lv_alloc'} | \n";
print "",$text{"lv_alloc".$lv->{'alloc'}}," | \n";
}
else {
# Allow editing of permissons and allocation method
print " | $text{'lv_perm'} | \n";
printf " %s\n",
$lv->{'perm'} eq 'rw' ? 'checked' : '', $text{'lv_permrw'};
printf " %s | \n",
$lv->{'perm'} eq 'r' ? 'checked' : '', $text{'lv_permr'};
print "$text{'lv_alloc'} | \n";
printf " %s\n",
$lv->{'alloc'} eq 'y' ? 'checked' : '', $text{'lv_allocy'};
printf " %s | \n",
$lv->{'alloc'} eq 'n' ? 'checked' : '', $text{'lv_allocn'};
}
if (!$in{'lv'} && !$lv->{'is_snap'}) {
# Allow selection of striping
print " | $text{'lv_stripe'} | \n";
printf " %s\n",
$text{'lv_nostripe'};
print "\n";
print &text('lv_stripes', ""),
" | \n";
}
elsif (!$lv->{'is_snap'}) {
# Show current striping
print " | $text{'lv_stripe'} | \n";
if ($lv->{'stripes'} > 1) {
print &text('lv_stripes', $lv->{'stripes'});
}
else {
print $text{'lv_nostripe'};
}
print " | \n";
}
# Show free disk space
if (@stat && $stat[2]) {
($total, $free) = &mount::disk_space($stat[1], $stat[0]);
print " | $text{'lv_freedisk'} | \n";
print &nice_size($free*1024)," | \n";
print "$text{'lv_free'} | \n";
printf "%d %%\n", $total ? 100 * $free / $total : 0;
print " | \n";
}
# Show extents on PVs
if ($in{'lv'}) {
@pvinfo = &get_logical_volume_usage($lv);
if (@pvinfo) {
@pvs = &list_physical_volumes($in{'vg'});
print " | $text{'lv_pvs'} | \n";
foreach $p (@pvinfo) {
print " , \n" if ($p ne $pvinfo[0]);
($pv) = grep { $_->{'name'} eq $p->[0] } @pvs;
print "{'name'}'>$pv->{'name'} ";
print &nice_size($p->[1]*$pv->{'pe_size'}*1024),"\n";
}
print " | \n";
}
}
print " |