diff --git a/raid/CHANGELOG b/raid/CHANGELOG index eea77778d..1f47a26b0 100644 --- a/raid/CHANGELOG +++ b/raid/CHANGELOG @@ -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. diff --git a/raid/raid-lib.pl b/raid/raid-lib.pl index b8ab1eb06..ae8df84d9 100755 --- a/raid/raid-lib.pl +++ b/raid/raid-lib.pl @@ -168,6 +168,16 @@ else { } } close(MDSTAT); + open(MDSTAT, $config{'mdstat'}); + while(){ + if (/^.*finish=(\S+)min/){ + $md->{'remain'} = $1; + } + if (/^.*speed=(\S+)K/){ + $md->{'speed'} = $1; + } + } + close(MDSTAT); push(@get_raidtab_cache, $md); } diff --git a/raid/view_raid.cgi b/raid/view_raid.cgi index afd94935f..7795a911b 100755 --- a/raid/view_raid.cgi +++ b/raid/view_raid.cgi @@ -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)"); }