diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2020-03-18 10:11:57 +0100 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2020-03-18 15:45:09 +0100 |
commit | 792e0bae67da7aa7f6556eaa72fc03e72e073d51 (patch) | |
tree | b0016a421b9cf75dcc486c1a88bd8921c0eafea4 /perl-install | |
parent | ec7ecea5452326c47a8f1191a25a5b8586c1f2bd (diff) | |
download | drakx-792e0bae67da7aa7f6556eaa72fc03e72e073d51.tar drakx-792e0bae67da7aa7f6556eaa72fc03e72e073d51.tar.gz drakx-792e0bae67da7aa7f6556eaa72fc03e72e073d51.tar.bz2 drakx-792e0bae67da7aa7f6556eaa72fc03e72e073d51.tar.xz drakx-792e0bae67da7aa7f6556eaa72fc03e72e073d51.zip |
(_get_dir_for_online_resize) split it
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/diskdrake/interactive.pm | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index 2c50c6078..0b449a460 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -757,6 +757,19 @@ sub Mount_point_raw_hd { $part->{mntpoint} = $mntpoint; } +#- side-effects: mounts the fs +sub _get_dir_for_online_resize { + my ($part) = @_; + my $dir = "/tmp/tmp_resize_" . $part->{fs_type} . ".$$"; + if ($part->{isMounted}) { + $dir = ($::prefix || '') . $part->{mntpoint}; + } else { + mkdir_p($dir); + fs::mount::mount(devices::make($part->{device}), $dir, $part->{fs_type}); + } + return $dir; +} + sub Resize { my ($in, $hd, $part) = @_; my (%nice_resize); @@ -893,13 +906,7 @@ filesystem checks will be run on your next boot into Microsoft Windows®")); #- happens only with mounted LVM, see above run_program::run_or_die("xfs_growfs", $part->{mntpoint}); } elsif ($nice_resize{btrfs}) { - my $dir = "/tmp/tmp_resize_btrfs.$$"; - if ($part->{isMounted}) { - $dir = ($::prefix || '') . $part->{mntpoint}; - } else { - mkdir_p($dir); - fs::mount::mount(devices::make($part->{device}), $dir, $part->{fs_type}); - } + my $dir = _get_dir_for_online_resize($part); if (!run_program::run(qw(btrfs filesystem resize), $part->{size}*512, $dir)) { $nice_resize{btrfs} = undef; # we just mounted it in order to do online resize but online resize failed: |