diff options
-rwxr-xr-x | rescue/restore-image.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rescue/restore-image.sh b/rescue/restore-image.sh index 425057113..ddb12f5e8 100755 --- a/rescue/restore-image.sh +++ b/rescue/restore-image.sh @@ -177,8 +177,10 @@ function expand_fs() sfdisk -d $disk | sed -e "\|$main_part| s/size=.*,/size= $main_part_sectors,/" | sfdisk -f $disk e2fsck -fy $main_part resize2fs $main_part - parted $disk -- mkpartfs primary linux-swap ${main_part_sectors}s -1s yes - mkswap -L swap $swap_part + if [ -n "$SWAP_BLOCKS" ]; then + parted $disk -- mkpartfs primary linux-swap ${main_part_sectors}s -1s yes + mkswap -L swap $swap_part + fi fi } |