linux Change Swap size on a running linux machine davide Jul 10, 2017 Make all swap off sudo swapoff -a Resize the swapfile sudo dd if=/dev/zero of=/swapfile bs=1M count=1024 Make swapfile usable sudo mkswap /swapfile Make swapon again sudo swapon /swapfile