summaryrefslogtreecommitdiffstats
path: root/rescue/restore-image.sh
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-11-12 10:17:45 +0000
committerOlivier Blin <oblin@mandriva.com>2008-11-12 10:17:45 +0000
commit93d56a9c7b120b8d92ace566efdf3bd7cd076864 (patch)
tree75fe763d802621fe8b25baa4871d9d969275a71d /rescue/restore-image.sh
parent82fa5713050f1b4f955216d0997600cccca40c33 (diff)
downloaddrakx-93d56a9c7b120b8d92ace566efdf3bd7cd076864.tar
drakx-93d56a9c7b120b8d92ace566efdf3bd7cd076864.tar.gz
drakx-93d56a9c7b120b8d92ace566efdf3bd7cd076864.tar.bz2
drakx-93d56a9c7b120b8d92ace566efdf3bd7cd076864.tar.xz
drakx-93d56a9c7b120b8d92ace566efdf3bd7cd076864.zip
handle swap creation without fs expand
Diffstat (limited to 'rescue/restore-image.sh')
-rwxr-xr-xrescue/restore-image.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/rescue/restore-image.sh b/rescue/restore-image.sh
index 87b8070bf..c5fa5726e 100755
--- a/rescue/restore-image.sh
+++ b/rescue/restore-image.sh
@@ -165,14 +165,14 @@ function expand_fs()
disk=/dev/$root
main_part=/dev/${root}1
swap_part=/dev/${root}2
- #part_sectors=$(sfdisk -d $disk | perl -lne 'm|^'$main_part'\b.*,\s*size\s*=\s*(\d+)\b| and print($1), exit')
- #part_blocks=$((part_sectors/2))
main_part_sectors=
if [ -n "$SWAP_BLOCKS" ]; then
if [ -n "$EXPAND_FS" ]; then
total_blocks=$(sfdisk -s $disk)
main_part_blocks=$((total_blocks-SWAP_BLOCKS))
main_part_sectors=$((main_part_blocks*2))
+ else
+ main_part_sectors=$(sfdisk -d $disk | perl -lne 'm|^'$main_part'\b.*,\s*size\s*=\s*(\d+)\b| and print($1), exit')
fi
fi
if [ -n "$EXPAND_FS" ]; then