Setting Up Swap on RHEL 10

 

Setting Up Swap on RHEL 10

Just created a 2GB swap file on a fresh RHEL 10 system to improve memory management:

fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile swap swap defaults 0 0' >> /etc/fstab

Swap helps prevent out-of-memory issues and keeps your system stable under load — especially on minimal installs or cloud VMs with limited RAM.

Here’s the verification after setup:

root@iamsonukushwaha:~# swapon --show NAME TYPE SIZE USED PRIO /swapfile file 2G 0B -2 root@iamsonukushwaha:~# free -gh total used free shared buff/cache available Mem: 951Mi 387Mi 328Mi 6.8Mi 390Mi 564Mi Swap: 2.0Gi 0B 2.0Gi

Small setup, big impact! 🚀

Popular posts from this blog

Tarana - Music Player