summaryrefslogtreecommitdiffstats
path: root/perl-install/fs/dmraid.pm
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.org>2010-02-04 11:08:58 +0000
committerPascal Terjan <pterjan@mandriva.org>2010-02-04 11:08:58 +0000
commitb431f4af3648a41237d875602bc52cf96de1f9a7 (patch)
treed83c7f3f6a0dceede5fe71e02379a344ad3e56f5 /perl-install/fs/dmraid.pm
parent1f3b18c81054516b7ddfcd6e3de35405778ae9d1 (diff)
downloaddrakx-backup-do-not-use-b431f4af3648a41237d875602bc52cf96de1f9a7.tar
drakx-backup-do-not-use-b431f4af3648a41237d875602bc52cf96de1f9a7.tar.gz
drakx-backup-do-not-use-b431f4af3648a41237d875602bc52cf96de1f9a7.tar.bz2
drakx-backup-do-not-use-b431f4af3648a41237d875602bc52cf96de1f9a7.tar.xz
drakx-backup-do-not-use-b431f4af3648a41237d875602bc52cf96de1f9a7.zip
support ddf1 raid
Diffstat (limited to 'perl-install/fs/dmraid.pm')
-rw-r--r--perl-install/fs/dmraid.pm16
1 files changed, 16 insertions, 0 deletions
diff --git a/perl-install/fs/dmraid.pm b/perl-install/fs/dmraid.pm
index fa06e05e9..68dd98a16 100644
--- a/perl-install/fs/dmraid.pm
+++ b/perl-install/fs/dmraid.pm
@@ -40,10 +40,26 @@ sub check {
}
sub _raid_devices_raw() {
+ # get the real vg names, needed for ddf1, and safer than begins_with for raid10
+ log::l("_raid_devices_raw");
+ my %vgs;
+ my %pv2vg = map {
+ log::l("got: $_");
+ my %l; @l{qw(name size stride level status subsets devs spares)} = split(':');
+ $vgs{$l{name}} = 1 if defined $l{spares};
+ if(/freeing device "(.*)", path "(.*)"/ && defined $vgs{$1}) {
+ log::l("$2 => $1");
+ { $2 => $1 };
+ }
+ } call_dmraid('-d', '-s', '-c', '-c');
map {
chomp;
log::l("got: $_");
my %l; @l{qw(pv format vg level status size)} = split(':');
+ if(defined $l{size} && defined $l{vg} && defined $pv2vg{$l{pv}} && !defined $vgs{$l{vg}}) {
+ log::l("using $pv2vg{$l{pv}} instead of $l{vg}");
+ $l{vg} = $pv2vg{$l{pv}};
+ }
if_(defined $l{size}, \%l);
} call_dmraid('-r', '-c', '-c');
}