Show raid rebuild speed and time left

This commit is contained in:
Jamie Cameron
2010-05-23 12:21:22 -07:00
parent d9e82354b4
commit 340de4c5eb
3 changed files with 14 additions and 1 deletions

View File

@@ -32,3 +32,4 @@ Added a button to remove a detached partition, thanks to Caspar Smit.
Added support for creating EXT4 filesystems.
---- Changes since 1.510 ----
Conversion from RAID 5 to 6 and vice versa is now possible, thanks to Caspar Smit.
When a RAID array is being rebuilt, show the speed and time remaining, thanks to Farid Benamrouche.

View File

@@ -168,6 +168,16 @@ else {
}
}
close(MDSTAT);
open(MDSTAT, $config{'mdstat'});
while(<MDSTAT>){
if (/^.*finish=(\S+)min/){
$md->{'remain'} = $1;
}
if (/^.*speed=(\S+)K/){
$md->{'speed'} = $1;
}
}
close(MDSTAT);
push(@get_raidtab_cache, $md);
}

View File

@@ -81,7 +81,9 @@ if ($raid->{'state'}) {
# Rebuild percent
if ($raid->{'rebuild'}) {
print &ui_table_row($text{'view_rebuild'}, $raid->{'rebuild'}." \%");
print &ui_table_row($text{'view_rebuild'},
$raid->{'rebuild'}." \% (".$raid->{'remain'}." min, ".
$raid->{'speed'}." KBytes/s)");
}