From 167fc711a1c9190ba6deb54dd1d7d9fdf84122c3 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sat, 3 Mar 2001 21:32:25 +0000 Subject: small fixes for LVM --- perl-install/fsedit.pm | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'perl-install/fsedit.pm') diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index 99db9f20f..03328f9e7 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -84,25 +84,24 @@ sub hds { my $type = typeOfPart($_->{device}); $_->{type} = $type if $type > 0x100; } - - if (my @lvms = grep { isLVM($_) } partition_table::get_normal_parts($hd)) { - require lvm; - foreach (@lvms) { - my $name = lvm::get_vg($_) or next; - my ($lvm) = grep { $_->{LVMname} eq $name } @hds; - if (!$lvm) { - $lvm = bless { disks => [], LVMname => $name, level => 'linear' }, 'lvm'; - lvm::update_size($lvm); - lvm::get_lvs($lvm); - push @lvms, $lvm; - } - $_->{lvm} = $name; - push @{$lvm->{disks}}, $_; + push @hds, $hd; + } + if (my @pvs = grep { isLVM($_) } map { partition_table::get_normal_parts($_) } @hds) { + #- otherwise vgscan won't find them + devices::make($_->{device}) foreach @pvs; + require lvm; + foreach (@pvs) { + my $name = lvm::get_vg($_) or next; + my ($lvm) = grep { $_->{LVMname} eq $name } @hds; + if (!$lvm) { + $lvm = bless { disks => [], LVMname => $name, level => 'linear' }, 'lvm'; + lvm::update_size($lvm); + lvm::get_lvs($lvm); + push @lvms, $lvm; } + $_->{lvm} = $name; + push @{$lvm->{disks}}, $_; } - - - push @hds, $hd; } \@hds, \@lvms; } -- cgit v1.2.1