Collapse
Announcement
Collapse
No announcement yet.
Steps to create swap file on Centos Server
Collapse
X
-
Hi Neha,
Here, I'll consider that you need to create a Swap space of 4 GB as as a reference and you may follow below steps to do so.
Connect to the server as root user.
1. Check total disk space available on the server
Code:df -h
Code:fallocate -l 4G /root/4GB.swap
Code:dd if=/dev/zero of=/root/4GB.swap bs=1024 count=4048576
Code:mkswap /root/4GB.swap
Code:chmod 600 /root/4GB.swap
Code:swapon /root/4GB.swap
Code:vi /etc/fstab
Code:/root/4GB.swap swap swap defaults 0 0
Code:mount -a
Code:free -m
Leave a comment:
-
Steps to create swap file on Centos Server
Can you please guide me through the steps to create swap file on Centos Server?
Tags: None
Leave a comment: