blink: Blink RAID device md? blinks all the devices in the RAID.

This commit is contained in:
Ole Tange 2013-02-19 13:35:48 +01:00
parent 453802d183
commit c1d8d958d2

View file

@ -163,11 +163,24 @@ GetOptions(
"s|all-slots|allslots" => \$::opt_allslots, "s|all-slots|allslots" => \$::opt_allslots,
); );
my @more_args = ();
if(@ARGV) { if(@ARGV) {
for(@ARGV) { for(@ARGV) {
s:/dev/::g; s{/dev/}{}g;
if(/^md/) {
# RAID device. Try to find the matching physical devices
my $md = $_;
for my $line (grep /^$md :/, `cat /proc/mdstat`) {
# md1 : active raid6 sdat[14](S) sdx[13] sds[12](S) sdc[6](S) sdb[0] sdm[9] sdk[7] sdaa[10] sdi[5] sdh[4]
while($line =~ s/(\S+)\[//) {
push @more_args, $1;
} }
} }
}
}
}
push @ARGV,@more_args;
if(not ($::opt_on or $::opt_off or $::opt_toggle or if(not ($::opt_on or $::opt_off or $::opt_toggle or
$::opt_alldetected or $::opt_allslots or @ARGV)) { $::opt_alldetected or $::opt_allslots or @ARGV)) {