Published: 19 Oct 2018 › Updated: 19 Oct 2018
Create Swap file on Cloud VM (AWS, GCloud, or Azure)
Use the commands below to create swap file on a micro instance with a Linux operating system. This creates a 2GB Swap file to help alleviate low system ram. Consequently, this is great for those using micro instances in the cloud that have under 1 GB of memory.
Commands
Run the following from your SSH window
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s
then change fstab (/etc/fstab) so it automatically mounts your swap file on startup
/swapfile none swap sw 0 0
Afterward, check if your swap file is operating properly withtop or htop.
Leave any Questions and Comments below and I will get back to you. I regularly publish on YouTube, Steemit, and christitus.com so if you’d like to see more videos and articles click the subscribe button in the top right.
Posted from my blog: https://www.christitus.com/2017/02/14/create-swap-file/
Leave Create Swap file on Cloud VM (AWS, GCloud, or Azure) to:
Read more #technology posts
Best Posts From Chris Titus
We have not curated any of christitus's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Chris Titus
- Resize LVM Partition | Fedora 29 | Step by Step Guide
- Grant Full Access to all Public Folders for a user in Exchange
- Force active directory sync to Office 365 with Azure ADSync
- Create Swap file on Cloud VM (AWS, GCloud, or Azure)
- Cloud migration hosting in Google, Amazon, or Microsoft
- Launching a startup program to run as administrator
- Troubleshooting Nagios 4 Core Installation
- Changing file permissions using PowerShell
- Commiting Changes to Docker images and containers
- No System Reserved Partition, Boot device not found, corrupt BCD / MBR