From 0e8b0439a9b3394049065f53c643f5b446e4a419 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 24 Jun 2005 09:36:28 +0000 Subject: handle dmraid device not there, keeping the raw hds --- perl-install/fs/dmraid.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'perl-install/fs') diff --git a/perl-install/fs/dmraid.pm b/perl-install/fs/dmraid.pm index 1a0268014..7166ce12d 100644 --- a/perl-install/fs/dmraid.pm +++ b/perl-install/fs/dmraid.pm @@ -40,16 +40,18 @@ sub pvs_and_vgs() { } sub vgs() { + my @l = pvs_and_vgs(); + my %vg2pv; push @{$vg2pv{$_->{vg}}}, $_->{pv} foreach @l; map { my $dev = "mapper/$_->{vg}"; my $vg = fs::subpart_from_wild_device_name("/dev/$dev"); - add2hash($vg, { media_type => 'hd', prefix => $dev, bus => "dm_$_->{format}" }); - $vg; - } grep { $_->{status} eq 'ok' } uniq_ { $_->{vg} } pvs_and_vgs(); -} + add2hash($vg, { media_type => 'hd', prefix => $dev, bus => "dm_$_->{format}", disks => $vg2pv{$_->{vg}} }); + + #- device should exist, created by dmraid(8) using libdevmapper + #- if it doesn't, we suppose it's not in use + if_(-e "/dev/$dev", $vg); -sub pvs() { - map { $_->{pv} } grep { $_->{status} eq 'ok' } pvs_and_vgs(); + } grep { $_->{status} eq 'ok' } uniq_ { $_->{vg} } @l; } 1; -- cgit v1.2.1