Posts

Showing posts from April, 2020

How to create Swap file Rhel 8 / Centos 8

Image
Creating a swap file in Rhel 8 / Centos 8 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. In most cases when running Linux on a virtual machine a swap partition is not present so our only option is to create a swap file. inspect active swap space: ·         cat /proc/swaps ·         free -h Free -h this command will show you all the used and free space of RAM and Swap area. Creating a swap file Create an empty file: ·         # dd if=/dev/zero of=/swapfile bs=1M count=1024 ·         Syntax: dd if=<source file name> of=<target file name> [Options] ·         bs: Block Size describes how much data will be read and written at one time. ·         if: The Input File is the source of the data. ·         of: The Output File is the destination for al