Improve RAID naming, fix layouts and add confirmation before removing a disk - thanks to Caspar Smit
This commit is contained in:
+18
-7
@@ -21,13 +21,13 @@ index_program=Command to run when problems are detected
|
||||
index_programnone=Don't run any
|
||||
index_monitor=Monitoring enabled?
|
||||
|
||||
linear=Concatenated (Linear)
|
||||
raid0=Striped (RAID0)
|
||||
raid1=Mirrored (RAID1)
|
||||
raid4=Parity (RAID4)
|
||||
raid5=Redundant (RAID5)
|
||||
raid6=Dual Redundant (RAID6)
|
||||
raid10=Striped and Mirrored (RAID10)
|
||||
linear=Linear (Concatenated)
|
||||
raid0=RAID0 (Striped)
|
||||
raid1=RAID1 (Mirrored)
|
||||
raid4=RAID4 (Dedicated Parity)
|
||||
raid5=RAID5 (Distributed Parity)
|
||||
raid6=RAID6 (Dual Distributed Parity)
|
||||
raid10=RAID10 (Striped and Mirrored)
|
||||
blocks=blocks
|
||||
|
||||
create_title=Create RAID Device
|
||||
@@ -57,6 +57,12 @@ create_nogroup=None (use own spares only)
|
||||
create_oldgroup=Existing group
|
||||
create_newgroup=New group
|
||||
create_enewgroup=Missing or non-alphnumeric spare group name
|
||||
create_n2_layout=2 Near Copies
|
||||
create_f2_layout=2 Far Copies
|
||||
create_o2_layout=2 Offset Copies
|
||||
create_n3_layout=3 Near Copies
|
||||
create_f3_layout=3 Far Copies
|
||||
create_o3_layout=3 Offset Copies
|
||||
|
||||
view_title=RAID Device
|
||||
view_header=RAID device options
|
||||
@@ -150,4 +156,9 @@ delete_title=Delete RAID Array
|
||||
delete_rusure=Are you sure you want to delete the RAID array $1, which uses $2 of disk space?
|
||||
delete_ok=Yes, Delete It
|
||||
delete_eidx=No RAID array selected!
|
||||
|
||||
remove_title=Remove Partition from RAID Array
|
||||
remove_rusure=Are you sure you want to remove partition $2 of RAID array $1?
|
||||
remove_ok=Yes, Remove It
|
||||
remove_eidx=No RAID array selected!
|
||||
__norefs=1
|
||||
|
||||
@@ -172,6 +172,11 @@ else {
|
||||
{ 'name' => 'chunk-size',
|
||||
'value' => $2 });
|
||||
}
|
||||
elsif (/^\s+Layout\s+:\s*(.*)/) {
|
||||
push(@{$md->{'members'}},
|
||||
{ 'name' => 'parity-algorithm',
|
||||
'value' => $1 });
|
||||
}
|
||||
}
|
||||
close(MDSTAT);
|
||||
local $lastdev;
|
||||
|
||||
+6
-1
@@ -70,7 +70,12 @@ if ($lvl == 10) {
|
||||
print &ui_table_row($text{'create_parity'},
|
||||
&ui_select("layout", $layout,
|
||||
[ [ '', $text{'default'} ],
|
||||
'n2', 'o2', 'f2' ]));
|
||||
[ 'n2', $text{'create_n2_layout'} ],
|
||||
[ 'f2', $text{'create_f2_layout'} ],
|
||||
[ 'o2', $text{'create_o2_layout'} ],
|
||||
[ 'n3', $text{'create_n3_layout'} ],
|
||||
[ 'f3', $text{'create_f3_layout'} ],
|
||||
[ 'o3', $text{'create_o3_layout'} ] ]));
|
||||
}
|
||||
|
||||
# Chunk size
|
||||
|
||||
+24
-5
@@ -81,11 +81,30 @@ elsif ($in{'grow'}) {
|
||||
}
|
||||
elsif ($in{'remove'}) {
|
||||
# Remove a disk from a RAID set
|
||||
&lock_raid_files();
|
||||
&remove_partition($old, $in{'rdisk'});
|
||||
&unlock_raid_files();
|
||||
&webmin_log("remove", undef, $old->{'value'}, { 'disk' => $in{'rdisk'} } );
|
||||
&redirect("");
|
||||
if (!$in{'confirm'}) {
|
||||
# Ask first!
|
||||
&ui_print_header(undef, $text{'remove_title'}, "");
|
||||
|
||||
print "<center>\n";
|
||||
print &ui_form_start("save_raid.cgi");
|
||||
print &ui_hidden("remove", 1);
|
||||
print &ui_hidden("rdisk", $in{'rdisk'});
|
||||
print &ui_hidden("idx", $in{'idx'});
|
||||
print &text('remove_rusure', "<tt>$old->{'value'}</tt>",
|
||||
"<tt>$in{'rdisk'}</tt>"),"<p>\n";
|
||||
print &ui_form_end([ [ "confirm", $text{'remove_ok'} ] ]);
|
||||
print "</center>\n";
|
||||
|
||||
&ui_print_footer("", $text{'index_return'});
|
||||
}
|
||||
else {
|
||||
# Really do it
|
||||
&lock_raid_files();
|
||||
&remove_partition($old, $in{'rdisk'});
|
||||
&unlock_raid_files();
|
||||
&webmin_log("remove", undef, $old->{'value'}, { 'disk' => $in{'rdisk'} } );
|
||||
&redirect("");
|
||||
}
|
||||
}
|
||||
elsif ($in{'remove_det'}) {
|
||||
# Remove detached disk(s) from a RAID set
|
||||
|
||||
+2
-2
@@ -49,8 +49,8 @@ $super = &find_value('persistent-superblock', $raid->{'members'});
|
||||
print &ui_table_row($text{'view_super'},
|
||||
$super ? $text{'yes'} : $text{'no'});
|
||||
|
||||
# Parity method
|
||||
if ($lvl eq '5') {
|
||||
# Layout
|
||||
if (($lvl eq '5') || ($lvl eq '6') || ($lvl eq '10')) {
|
||||
$layout = &find_value('parity-algorithm', $raid->{'members'});
|
||||
print &ui_table_row($text{'view_parity'}, $layout || $text{'default'});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user