Create a swap space using file in RHEL or Centos

$ sudo dd if=/dev/zero of=/swapfile bs=1M count=1024  $ sudo mkswap /swapfile  $ sudo chmod 600 /swapfile  $ sudo swapon /swapfile  $ sudo vim /etc/fstab  

Add this line to fstab:

swap        /swapfile   swap    defaults        0   0  

Popular posts from this blog

Shrink you container size up to 95%.

alma linux: dnf Module yaml error: Unexpected key in data