Contents
Create a Linux Swap File.
Swap is a space on a disk that is used when the amount of physical RAM memory is full.
When a Linux system runs out of RAM, inactive pages are moved from the RAM to the swap space.
Swap space can take the form of either a dedicated swap partition or a swap file.
How do you extend a swap?
How to Extend Swap Space using Swap file in Linux
- Below are the Steps to extend Swap Space using Swap File in Linux.
- Step:1 Create a swap file of size 1 GB using below dd Command.
- Step:2 Secure the swap file with permissions 644.
- Step:3 Enable the Swap Area on the file (swap_file)
- Step:4 Add the swap file entry in the fstab file.
How do I enable swap space in Linux?
How to add swap space in linux
- adding swap partition. adding swap volume.
- Run the fdisk or parted utility to identify disks with sufficient unused (unpartitioned) disk space.
- Run the command mkswap against the device/partition created earlier using fdisk/parted.
- To check swap usage, you can use any one of the utilities below:
- 2. /
- top.
- vmstat.