diff options
author | Pascal Terjan <pterjan@mandriva.org> | 2010-04-30 13:46:51 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mandriva.org> | 2010-04-30 13:46:51 +0000 |
commit | 84dc43637ffed98c10f3d536f44099eabdb0bd07 (patch) | |
tree | 56517510e434af4d2a8833f9a57403f717f625f7 | |
parent | 5a477d971beb009195ed4cb45233ebb0e8a82440 (diff) | |
download | drakx-84dc43637ffed98c10f3d536f44099eabdb0bd07.tar drakx-84dc43637ffed98c10f3d536f44099eabdb0bd07.tar.gz drakx-84dc43637ffed98c10f3d536f44099eabdb0bd07.tar.bz2 drakx-84dc43637ffed98c10f3d536f44099eabdb0bd07.tar.xz drakx-84dc43637ffed98c10f3d536f44099eabdb0bd07.zip |
fix resize of active encrypted volumes
-rw-r--r-- | perl-install/NEWS | 1 | ||||
-rw-r--r-- | perl-install/diskdrake/interactive.pm | 18 | ||||
-rw-r--r-- | perl-install/install/NEWS | 1 |
3 files changed, 14 insertions, 6 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index 241576eff..44093b17a 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,5 +1,6 @@ - diskdrake: o fix the crypto mountpoint checks for the create case + o fix resize of active encrypted volumes Version 13.22 - 29 April 2010 diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index 51c25703c..535de67ec 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -756,7 +756,13 @@ sub Mount_point_raw_hd { sub Resize { my ($in, $hd, $part) = @_; my (%nice_resize); - my ($min, $max) = (min_partition_size($hd), max_partition_resize($hd, $part)); + my $low_part = $part; + + if (isLUKS($part)) { + $low_part = find { $_->{dm_name} eq $part->{dmcrypt_name} } partition_table::get_normal_parts($hd); + } + + my ($min, $max) = (min_partition_size($hd), max_partition_resize($hd, $low_part)); if (maybeFormatted($part)) { # here we may have a non-formatted or a formatted partition @@ -832,8 +838,8 @@ sub Resize { $part->{size} == $size and return; my $oldsize = $part->{size}; - $part->{size} = $size; - $hd->adjustEnd($part); + $low_part->{size} = $part->{size} = $size; + $hd->adjustEnd($low_part); undef $@; my $_b = before_leaving { $@ and $part->{size} = $oldsize }; @@ -842,10 +848,10 @@ sub Resize { my ($write_partitions) = @_; if (isLVM($hd)) { - lvm::lv_resize($part, $oldsize); + lvm::lv_resize($low_part, $oldsize); } else { - partition_table::will_tell_kernel($hd, resize => $part); - partition_table::adjust_local_extended($hd, $part); + partition_table::will_tell_kernel($hd, resize => $low_part); + partition_table::adjust_local_extended($hd, $low_part); partition_table::adjust_main_extended($hd); write_partitions($in, $hd) or return if $write_partitions && %nice_resize; } diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index a9d32f32c..f91df8316 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,5 +1,6 @@ - diskdrake: o fix the crypto mountpoint checks for the create case + o fix resize of active encrypted volumes Version 13.22 - 29 April 2010 |