How To Create a Swap File to Increase Swap Memory On OCI Linux Instances
How to increase the amount of swap space on a Linux system by creating a new swap file.
Use root user privileges when running any commands in the following steps.
Note
Confirm there is enough space on the root file system (rootfs) for both the new swap file you intend to create and for any other applications, logs, or other files you intend to locate on the rootfs. You can do this by running the "df" command and reviewing the output.
1) Create a new directory on the current file system for the new swap file:
# mkdir /swap
2) Create the new swap file in the new directory (this example creates a 2Gb sized file):
Tagged:
0