diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-06-04 11:13:34 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-06-04 11:13:34 +0000 |
commit | c9a35f48ca4ae3f503a2976b2e399eb814407f8f (patch) | |
tree | 84e4df966deae6a972b6f7cad29495e6766486c2 /perl-install/lvm.pm | |
parent | 37d4047e44806051bf7721869791fce9917d04ee (diff) | |
download | drakx-c9a35f48ca4ae3f503a2976b2e399eb814407f8f.tar drakx-c9a35f48ca4ae3f503a2976b2e399eb814407f8f.tar.gz drakx-c9a35f48ca4ae3f503a2976b2e399eb814407f8f.tar.bz2 drakx-c9a35f48ca4ae3f503a2976b2e399eb814407f8f.tar.xz drakx-c9a35f48ca4ae3f503a2976b2e399eb814407f8f.zip |
allow choosing lv name (thanks to Brian Murrell)
Diffstat (limited to 'perl-install/lvm.pm')
-rw-r--r-- | perl-install/lvm.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm index 12c685e97..9b9ce8d58 100644 --- a/perl-install/lvm.pm +++ b/perl-install/lvm.pm @@ -128,9 +128,9 @@ sub lv_delete { sub lv_create { my ($lvm, $lv) = @_; my $list = $lvm->{primary}{normal} ||= []; - my $nb = 1 + max(map { basename($_->{device}) } @$list); - $lv->{device} = "$lvm->{VG_name}/$nb"; - run_or_die('lvcreate', '--size', int($lv->{size} / 2) . 'k', '-n', $nb, $lvm->{VG_name}); + $lv->{lv_name} ||= 1 + max(map { if_($_->{device} =~ /(\d+)$/, $1) } @$list); + $lv->{device} = "$lvm->{VG_name}/$lvm->{lv_name}"; + run_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 $lv->{notFormatted} = 1; $lv->{isFormatted} = 0; |