for ex, 4096M : dd if=/dev/zero of=/swapfile bs=1M count=4096 chmod 600 /swapfile mkswap /swapfile /sbin/swapon /swapfile