Mageia Bugzilla – Attachment 11991 Details for
Bug 26707
drakconf crashed with mdadm array
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Patch to handle RAID components created on raw disk devices
fsedit.patch (text/plain), 1.69 KB, created by
Martin Whitaker
on 2020-11-16 00:42:38 CET
(
hide
)
Description:
Patch to handle RAID components created on raw disk devices
Filename:
MIME Type:
Creator:
Martin Whitaker
Created:
2020-11-16 00:42:38 CET
Size:
1.69 KB
patch
obsolete
>diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm >index e53648a37..d209b0196 100644 >--- a/perl-install/fsedit.pm >+++ b/perl-install/fsedit.pm >@@ -82,11 +82,11 @@ sub recompute_loopbacks { > } > > sub raids { >- my ($hds) = @_; >+ my ($hds, $raw_hds) = @_; > > my @parts = fs::get::hds_fstab(@$hds); > >- my @l = grep { isRawRAID($_) } @parts or return []; >+ my @l = grep { isRawRAID($_) } ( @parts, @$raw_hds ) or return []; > > log::l("looking for raids in " . join(' ', map { $_->{device} } @l)); > >@@ -197,6 +197,20 @@ sub get_hds { > foreach my $hd (@drives) { > $hd->{readonly} = $flags->{readonly}; > >+ #- We only create RAID components in disk partitions, but users may have used >+ #- mdadm directly to create them on raw disk devices. Detect that now, before >+ #- looking for a partition table (which is likely to fail badly - mga#26707). >+ if (my $type = fs::type::type_subpart_from_magic($hd)) { >+ if (isRawRAID($type)) { >+ #- Add the necessary information to the raw device to allow the RAID >+ #- array to be properly characterised in diskdrake. >+ put_in_hash($hd, $type); >+ $hd->{size} = $hd->{totalsectors}; >+ push @raw_hds, $hd; >+ next; >+ } >+ } >+ > eval { partition_table::raw::test_for_bad_drives($hd) if !$flags->{no_bad_drives} }; > if (my $err = $@) { > log::l("test_for_bad_drives returned $err"); >@@ -310,7 +324,7 @@ Do you agree to lose all the partitions? > } > > #- detect raids before LVM allowing LVM on raid >- my $raids = raids(\@hds); >+ my $raids = raids(\@hds, \@raw_hds); > my $all_hds = { %{ fs::get::empty_all_hds() }, hds => \@hds, raw_hds => \@raw_hds, lvms => [], raids => $raids }; > > $all_hds->{lvms} = [ lvms($all_hds) ];
diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index e53648a37..d209b0196 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -82,11 +82,11 @@ sub recompute_loopbacks { } sub raids { - my ($hds) = @_; + my ($hds, $raw_hds) = @_; my @parts = fs::get::hds_fstab(@$hds); - my @l = grep { isRawRAID($_) } @parts or return []; + my @l = grep { isRawRAID($_) } ( @parts, @$raw_hds ) or return []; log::l("looking for raids in " . join(' ', map { $_->{device} } @l)); @@ -197,6 +197,20 @@ sub get_hds { foreach my $hd (@drives) { $hd->{readonly} = $flags->{readonly}; + #- We only create RAID components in disk partitions, but users may have used + #- mdadm directly to create them on raw disk devices. Detect that now, before + #- looking for a partition table (which is likely to fail badly - mga#26707). + if (my $type = fs::type::type_subpart_from_magic($hd)) { + if (isRawRAID($type)) { + #- Add the necessary information to the raw device to allow the RAID + #- array to be properly characterised in diskdrake. + put_in_hash($hd, $type); + $hd->{size} = $hd->{totalsectors}; + push @raw_hds, $hd; + next; + } + } + eval { partition_table::raw::test_for_bad_drives($hd) if !$flags->{no_bad_drives} }; if (my $err = $@) { log::l("test_for_bad_drives returned $err"); @@ -310,7 +324,7 @@ Do you agree to lose all the partitions? } #- detect raids before LVM allowing LVM on raid - my $raids = raids(\@hds); + my $raids = raids(\@hds, \@raw_hds); my $all_hds = { %{ fs::get::empty_all_hds() }, hds => \@hds, raw_hds => \@raw_hds, lvms => [], raids => $raids }; $all_hds->{lvms} = [ lvms($all_hds) ];
View Attachment As Raw
Actions:
View
Attachments on
bug 26707
: 11991