summaryrefslogtreecommitdiffstats
path: root/perl-install/diskdrake/interactive.pm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2020-03-18 10:21:58 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2020-03-18 16:51:17 +0100
commitbf84edcafe11e4e1a9bf41bfb82522a4d78c785e (patch)
tree5fbdfc5b25a0e94301220ceaa1e10443603b9056 /perl-install/diskdrake/interactive.pm
parentbc754db56b4cb301cc6167d2e50f36ba446a8d69 (diff)
downloaddrakx-bf84edcafe11e4e1a9bf41bfb82522a4d78c785e.tar
drakx-bf84edcafe11e4e1a9bf41bfb82522a4d78c785e.tar.gz
drakx-bf84edcafe11e4e1a9bf41bfb82522a4d78c785e.tar.bz2
drakx-bf84edcafe11e4e1a9bf41bfb82522a4d78c785e.tar.xz
drakx-bf84edcafe11e4e1a9bf41bfb82522a4d78c785e.zip
factorize online resize
nilfs2 needs a similar process
Diffstat (limited to 'perl-install/diskdrake/interactive.pm')
-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);