From bf4bf09c58b06d9c3354d92bf4b66852cb0fecc3 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 1 Jul 2005 07:26:00 +0000 Subject: - correctly compute the max size on a VG (bugzilla #16189) - don't verifyParts on lvm --- perl-install/diskdrake/interactive.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'perl-install/diskdrake/interactive.pm') diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index a9f9a25c7..df957ae56 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -700,7 +700,7 @@ sub Mount_point_raw_hd { sub Resize { my ($in, $hd, $part) = @_; my (%nice_resize); - my ($min, $max) = (min_partition_size($hd), partition_table::next_start($hd, $part) - $part->{start}); + my ($min, $max) = (min_partition_size($hd), max_partition_size($hd, $part)); if (maybeFormatted($part)) { # here we may have a non-formatted or a formatted partition @@ -813,7 +813,7 @@ filesystem checks will be run on your next boot into Windows(TM)")); set_isFormatted($part, 1); } else { set_isFormatted($part, 0); - partition_table::verifyParts($hd); + partition_table::verifyParts($hd) if !isLVM($hd); $part->{mntpoint} = '' if isNonMountable($part); #- mainly for ntfs, which we can not format } @@ -1273,6 +1273,14 @@ sub format_raw_hd_info { #- logical partition. sub min_partition_size { $_[0]->cylinder_size + 2*$_[0]{geom}{sectors} } +sub max_partition_size { + my ($hd, $part) = @_; + if (isLVM($hd)) { + $part->{size} + fs::get::vg_free_space($hd); + } else { + partition_table::next_start($hd, $part) - $part->{start}; + } +} sub choose_encrypt_key { my ($in, $options) = @_; -- cgit v1.2.1