summaryrefslogtreecommitdiffstats
path: root/perl-install/diskdrake/interactive.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/diskdrake/interactive.pm')
-rw-r--r--perl-install/diskdrake/interactive.pm21
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: