From d8ebe36acd6b20cb92bf9a6c534091c68d53a252 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 29 Jan 2003 11:36:13 +0000 Subject: ntfsresize feature added (not tested!) --- perl-install/diskdrake/interactive.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'perl-install/diskdrake') diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index 95a7920bc..4406775db 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -654,6 +654,14 @@ sub Resize { } else { delete $nice_resize{ext2}; } + } elsif (isThisFs('ntfs', $part)) { + write_partitions($in, $hd) or return; + my $dev = devices::make($part->{device}); + my $r = run_program::get_stdout('ntfsresize', '-i', $dev); + if ($r =~ /minimal size: (\d+) KiB/) { + $min = $r * 2; + $nice_resize{ntfs} = $dev; + } } elsif (isThisFs("reiserfs", $part)) { write_partitions($in, $hd) or return; if (defined(my $free = fs::df($part))) { @@ -707,6 +715,9 @@ sub Resize { my $s = int($part->{size} / ($block_size / 512)); log::l("resize2fs $nice_resize{ext2} to size $s in block of $block_size bytes"); run_program::run("resize2fs", "-pf", $nice_resize{ext2}, $s); + } elsif ($nice_resize{ntfs}) { + log::l("ntfs resize to $part->{size} sectors"); + run_program::run_or_die('ntfsresize', '-f', '-s' . $part->{size}/2 . "Ki", devices::make($part->{device})); } elsif ($nice_resize{reiserfs}) { log::l("reiser resize to $part->{size} sectors"); run_program::run("resize_reiserfs", "-f", "-q", "-s" . $part->{size}/2 . "K", devices::make($part->{device})); -- cgit v1.2.1