diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-06-29 05:17:35 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-06-29 05:17:35 +0000 |
commit | 116cfea31e53a6037f1894508c934aac1ef49bd4 (patch) | |
tree | ed1b6840d508f483d03494a0b125abacbc6dbd7b | |
parent | 35bc9a0d7e11829c01a912e50332580891f10fa5 (diff) | |
download | drakx-116cfea31e53a6037f1894508c934aac1ef49bd4.tar drakx-116cfea31e53a6037f1894508c934aac1ef49bd4.tar.gz drakx-116cfea31e53a6037f1894508c934aac1ef49bd4.tar.bz2 drakx-116cfea31e53a6037f1894508c934aac1ef49bd4.tar.xz drakx-116cfea31e53a6037f1894508c934aac1ef49bd4.zip |
{mntpoint} is not set, so take the last ext3 partition as being /home
-rwxr-xr-x | rescue/partimage_whole_disk | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/rescue/partimage_whole_disk b/rescue/partimage_whole_disk index 5c5ce214a..a35c374ca 100755 --- a/rescue/partimage_whole_disk +++ b/rescue/partimage_whole_disk @@ -53,15 +53,19 @@ sub save_all { my $part_list = [ partition_table::get_normal_parts($hd) ]; foreach (@$part_list) { - $_->{saved} = !member($_->{fs_type}, 'ntfs', 'vfat', 'swap') && $_->{mntpoint} ne '/home'; - if ($_->{saved}) { - run_or_die(@partimage_cmd, - '-V', 0, '--nombr', '--nodesc', '--nocheck', '-b', '-o', - 'save', devices::make($_->{device}), "$dir/$_->{device}"); - } - if ($_->{mntpoint} eq '/home') { - $_->{size} = min($_->{size}, 1024 * 1024 * 2); # not greater than 1GB - } + $_->{saved} = !member($_->{fs_type}, 'ntfs', 'vfat', 'swap'); + } + + #- shrink and don't save the last ext3 partition (which is the /home partition) + if (my $part = find { isTrueLocalFS($_) } reverse @$part_list) { + $part->{size} = min($part->{size}, 1024 * 1024 * 2); # not greater than 1GB + $part->{saved} = 0; + } + + foreach (grep { $_->{saved} } @$part_list) { + run_or_die(@partimage_cmd, + '-V', 0, '--nombr', '--nodesc', '--nocheck', '-b', '-o', + 'save', devices::make($_->{device}), "$dir/$_->{device}"); } save_part_list($dir, $hd->{geom}, $part_list); } @@ -155,7 +159,7 @@ sub rest_all { partition_table::raw::compute_nb_cylinders($hd->{geom}, $hd->{totalsectors}); #- grow the last ext3 partition - if (my $part = find { $_->{fs_type} eq 'ext3' } reverse @{$h{part_list}}) { + if (my $part = find { isTrueLocalFS($_) } reverse @{$h{part_list}}) { $part->{ratio} = 1; } |