diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-01-29 12:25:51 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-01-29 12:25:51 +0000 |
commit | edde4114b1aa035443271f52e87c1b71530b7401 (patch) | |
tree | b5ebf0acc3a3bb6a4a049c27142b434870a24256 /perl-install/diskdrake/interactive.pm | |
parent | 3b8ff8daaaa524813ef41de7f15be13fab5759b1 (diff) | |
download | drakx-edde4114b1aa035443271f52e87c1b71530b7401.tar drakx-edde4114b1aa035443271f52e87c1b71530b7401.tar.gz drakx-edde4114b1aa035443271f52e87c1b71530b7401.tar.bz2 drakx-edde4114b1aa035443271f52e87c1b71530b7401.tar.xz drakx-edde4114b1aa035443271f52e87c1b71530b7401.zip |
dumpe2fs call cleanup
Diffstat (limited to 'perl-install/diskdrake/interactive.pm')
-rw-r--r-- | perl-install/diskdrake/interactive.pm | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index 4406775db..f53e00d58 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -642,17 +642,16 @@ sub Resize { $max = min($max, $nice_resize{fat}->max_size); } elsif (isExt2($part) || isThisFs('ext3', $part)) { write_partitions($in, $hd) or return; - $nice_resize{ext2} = devices::make($part->{device}); - my $r = `dumpe2fs $nice_resize{ext2} 2>/dev/null`; + my $dev = devices::make($part->{device}); + my $r = run_program::get_stdout('dumpe2fs', $dev); $r =~ /Block count:\s*(\d+)/ and $block_count = $1; $r =~ /Free blocks:\s*(\d+)/ and $free_block = $1; $r =~ /Block size:\s*(\d+)/ and $block_size = $1; log::l("dumpe2fs $nice_resize{ext2} gives: Block_count=$block_count, Free_blocks=$free_block, Block_size=$block_size"); if ($block_count && $free_block && $block_size) { - $min = max($min, ($block_count - $free_block) * $block_size / 512); - $max = min($max, $block_count * $block_size / 512); - } else { - delete $nice_resize{ext2}; + $min = max($min, ($block_count - $free_block) * ($block_size / 512)); + $max = min($max, $block_count * ($block_size / 512)); + $nice_resize{ext2} = $dev; } } elsif (isThisFs('ntfs', $part)) { write_partitions($in, $hd) or return; |