The easy way to create swap file just by below cli code, it’s working on Ubuntu Linux,
sudo fallocate -l 10G /swapfile30
sudo fallocate -l 10G /swapfile40
sudo fallocate -l 10G /swapfile50
sudo fallocate -l 10G /swapfile60
sudo fallocate -l 10G /swapfile70
sudo chmod 600 /swapfile30
sudo chmod 600 /swapfile40
sudo chmod 600 /swapfile50
sudo chmod 600 /swapfile60
sudo chmod 600 /swapfile70
sudo mkswap /swapfile30
sudo mkswap /swapfile40
sudo mkswap /swapfile50
sudo mkswap /swapfile60
sudo mkswap /swapfile70
sudo swapon /swapfile30
sudo swapon /swapfile40
sudo swapon /swapfile50
sudo swapon /swapfile60
sudo swapon /swapfile70
echo '/swapfile30 none swap sw 0 0' | sudo tee -a /etc/fstab
echo '/swapfile40 none swap sw 0 0' | sudo tee -a /etc/fstab
echo '/swapfile50 none swap sw 0 0' | sudo tee -a /etc/fstab
echo '/swapfile60 none swap sw 0 0' | sudo tee -a /etc/fstab
echo '/swapfile70 none swap sw 0 0' | sudo tee -a /etc/fstab
