Unable to create swap disk in ec2, getting error 'dd: memory exhausted by input buffer of size 1073741824 bytes (1.0 GiB)'

To create swap memory in Ec2 I am using the command sudo dd if=/dev/zero of=/swapfile bs=1G count=2 but getting Error

dd: memory exhausted by input buffer of size 1073741824 bytes (1.0 GiB)

How to fix it, and what is the issue here?

You can use following command instead.

sudo dd if=/dev/zero of=/swapfile bs=1M count=2000

It may fix your issue

Log in to reply