diff --git a/aws/aws_ec2_ebs_docker_host/provision-swap.sh b/aws/aws_ec2_ebs_docker_host/provision-swap.sh index 96cd743..8435a8f 100644 --- a/aws/aws_ec2_ebs_docker_host/provision-swap.sh +++ b/aws/aws_ec2_ebs_docker_host/provision-swap.sh @@ -12,8 +12,8 @@ SWAPPINESS=$2 echo "Setting up a swap file (size: $SWAP_FILE_SIZE, swappiness: $SWAPPINESS)..." -# Create the swap file -sudo fallocate -l ${SWAP_FILE_SIZE} /swapfile +# Create the swap file using dd +sudo dd if=/dev/zero of=/swapfile bs=1M count=${SWAP_FILE_SIZE} # Only root should be able to access to this file sudo chmod 600 /swapfile