summaryrefslogtreecommitdiffstats
path: root/perl-install/diskdrake
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/diskdrake')
-rw-r--r--perl-install/diskdrake/interactive.pm19
1 files changed, 14 insertions, 5 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index 898f1de58..511a2660b 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -779,7 +779,7 @@ sub _set_min_size_from_avail_space {
sub Resize {
my ($in, $hd, $part) = @_;
- my (%nice_resize);
+ my (%nice_resize, $online_resize);
my $low_part = $part;
if (isLUKS($part)) {
@@ -830,10 +830,15 @@ sub Resize {
$min = $part->{size}; #- ensure the user can only increase
$nice_resize{xfs} = 1;
} elsif ($part->{fs_type} eq 'btrfs') {
+ $online_resize = $part->{fs_type};
+ }
+
+ if ($online_resize) {
write_partitions($in, $hd) or return;
- $nice_resize{btrfs} = 1;
+ $nice_resize{$online_resize} = 1;
_set_min_size_from_avail_space($part, \$min);
}
+
#- make sure that even after normalizing the size to cylinder boundaries, the minimun will be saved,
#- this save at least a cylinder (less than 8Mb).
$min += partition_table::raw::cylinder_size($hd);
@@ -910,10 +915,14 @@ filesystem checks will be run on your next boot into Microsoft Windows®"));
} elsif ($nice_resize{xfs}) {
#- happens only with mounted LVM, see above
run_program::run_or_die("xfs_growfs", $part->{mntpoint});
- } elsif ($nice_resize{btrfs}) {
+ } elsif ($online_resize) {
my $dir = _get_dir_for_online_resize($part);
- if (!run_program::run(qw(btrfs filesystem resize), $part->{size}*512, $dir)) {
- $nice_resize{btrfs} = undef;
+ my @cmd;
+ if ($nice_resize{btrfs}) {
+ @cmd = (qw(btrfs filesystem resize), $part->{size}*512, $dir);
+ }
+ if (!run_program::run(@cmd)) {
+ $nice_resize{$part->{fs_type}} = undef;
# we just mounted it in order to do online resize but online resize failed:
if (!$part->{isMounted}) {
fs::mount::umount($dir);