Skip to content

Commit

Permalink
mxraid_assemble: adapt to larger arrays
Browse files Browse the repository at this point in the history
- increase the proposed chunksize (this needs testing!)
 - extend M-nameing scheme up to 'Mz'
 - ennoble 16TB Seagate X18 harddisks
  • Loading branch information
thomas committed Oct 12, 2021
1 parent c157c49 commit 2666853
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions mxraid/mxraid_assemble
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ if ($opts{n}) {

my ($entry, $cnt, $size) = ('', 0, 0);
my ($level, $num_wanted, $match) = (6, 16, undef);
my $chunk_size = 512;
my $chunk_size = 2048; # this is experimental
my $dev_no = 0;
my @mounts = split m/\n/, `cat /proc/self/mounts`;
my @candidates;
Expand Down Expand Up @@ -200,7 +200,7 @@ if ($opts{n}) {
print "# NOTE: $msg\n";
}

if ($opts{n} !~ m/^[CDM][\da-f]\d{3}$/) {
if ($opts{n} !~ m/^[CDM][\da-z]\d{3}$/) {
my $msg = "label '$opts{n}' doesn't follow the CDM scheme.";
$msg = $color->t_red($msg) unless $opts{m};
print "# NOTE: $msg\n";
Expand All @@ -221,7 +221,7 @@ if ($opts{n}) {
$size /= 1024**4; # TB


# 100TB -> 512k, 50TB -> 256k
# 300TB -> 2048k (?), 200TB -> 1024k, 100TB -> 512k, 50TB -> 256k
while ( $size/$chunk_size < 0.115 and $chunk_size > 64) {
$chunk_size/=2;
}
Expand Down Expand Up @@ -450,7 +450,7 @@ exit;

@rec = split m/\s+/, $_;

if ($rec[0] !~ m/[CDM][\da-f]\d{3}:/) {
if ($rec[0] !~ m/[CDM][\da-z]\d{3}:/) {
warn "# NOTE: raid name not in expected format (bad key '$rec[0]' at line $lines).\n" if $self->{verbose} >= 1;
next;
}
Expand Down Expand Up @@ -518,7 +518,7 @@ exit;
my $self = shift;
my %tmp;
for (keys %{$self->{db}}) {
my ($cat,$size,$num) = $_ =~ m/([CDM])([\da-f])(\d{3})/;
my ($cat,$size,$num) = $_ =~ m/([CDM])([\da-z])(\d{3})/;
next unless defined $num;
$cat = '(C/M)' if $cat ne 'D';
if (exists $tmp{"$cat$size"} and $tmp{"$cat$size"} > $num) {
Expand Down Expand Up @@ -546,6 +546,7 @@ exit;
ST8000NM001A => sub {substr $_[0], 0, 8},
ST1000NM0045 => sub {substr $_[0], 0, 8},
ST14000NM002G => sub {substr $_[0], 0, 8},
ST16000NM004J => sub {substr $_[0], 0, 8},
);
}

Expand Down

0 comments on commit 2666853

Please sign in to comment.