Re-designed the module's main page to use tabs, and added an option to show volumes and groups in tables (with more information) instead of using icons.
Converted all user interface code to use the new Webmin UI library.
Fixed the command used to move data to another physical volume under LVM 2.
+---- Changes since 1.410 ----
+The percentage of a snapshot's blocks used is now shown on the Edit Snapshot page.
[ map { $_->{'name'} } grep { !$_->{'is_snap'} } @lvs ]);
}
print &ui_table_row($text{'lv_snapof'}, $snapsel);
+
+ # Show snapshot percentage used
+ if ($lv->{'snapusage'}) {
+ print &ui_table_row($text{'lv_snapusage'},
+ $lv->{'snapusage'}."%");
+ }
}
elsif ($stat[2]) {
# Display current permissons and allocation method
&nice_size($free*1024));
print &ui_table_row($text{'lv_free'},
- ($total ? 100 * $free / $total : 0)." %");
+ int($total ? 100 * $free / $total : 0)." %");
}
# Show extents on PVs
lv_free=Free percentage
lv_freedisk=Free space
lv_pvs=Physical volumes allocated
+lv_snapusage=Snapshot use percentage
mkfs_title=Create Filesystem
mkfs_desc=This form allows you to build a new $2 ($1) filesystem on logical volume $3. All existing data will be erased.
$lv->{'is_snap'} = $p{'access'} == 5;
$lv->{'stripes'} = $p{'stripes'};
push(@rv, $lv);
+
+ # For snapshots, use the lvdisplay command to get usage
+ if ($lv->{'is_snap'}) {
+ local $out = &backquote_command(
+ "lvdisplay ".quotemeta($lv->{'device'}).
+ " 2>/dev/null");
+ if ($out =~/Allocated\s+to\s+snapshot\s+([0-9\.]+)%/i) {
+ $lv->{'snapusage'} = $1;
+ }
+ }
}
closedir(DIR);
}
elsif (/Stripes\s+(\d+)/) {
$lv->{'stripes'} = $1;
}
+ elsif (/Allocated\s+to\s+snapshot\s+([0-9\.]+)%/i) {
+ $lv->{'snapusage'} = $1;
+ }
}
close(DISPLAY);
@rv = grep { $_->{'vg'} eq $_[0] } @rv;