diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/diskdrake/interactive.pm | 3 | ||||
-rw-r--r-- | perl-install/lvm.pm | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index e4b01a88f..a22d54e6b 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -488,6 +488,9 @@ sub Create { $part->{size} = $part->{maxsize}; fs::type::suggest_fs_type($part, 'ext3'); } + if (isLVM($hd)) { + lvm::suggest_lv_name($hd, $part); + } #- update adjustment for start and size, take into account the minimum partition size #- including one less sector for start due to a capacity to increase the adjustement by diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm index 93c174daa..4499b9a1f 100644 --- a/perl-install/lvm.pm +++ b/perl-install/lvm.pm @@ -128,14 +128,19 @@ sub lv_delete { @$list = grep { $_ != $lv } @$list; } -sub lv_create { +sub suggest_lv_name { my ($lvm, $lv) = @_; my $list = $lvm->{primary}{normal} ||= []; $lv->{lv_name} ||= 1 + max(map { if_($_->{device} =~ /(\d+)$/, $1) } @$list); +} + +sub lv_create { + my ($lvm, $lv) = @_; $lv->{device} = "$lvm->{VG_name}/$lv->{lv_name}"; lvm_cmd_or_die('lvcreate', '--size', int($lv->{size} / 2) . 'k', '-n', $lv->{lv_name}, $lvm->{VG_name}); $lv->{size} = get_lv_size($lv->{device}); #- the created size is smaller than asked size set_isFormatted($lv, 0); + my $list = $lvm->{primary}{normal} ||= []; push @$list, $lv; } |