Skip to content
WJunction - Webmaster Forum

Swap memory (CentOS 5)

Status
Not open for further replies.
via shell:

# Do file and give it the name swap
dd if=/dev/zero of=/home/swap bs=1024 count=262144

# This file is converted to swap
mkswap /home/swap

# Take away permisions
chmod go-rwx /home/swap

# Activate Memory Swap
swapon /home/swap

After that, when you type over Shell "free -m" you will see that you have a memory Swap 256MB
Number "262144" In the first command is in KB. That number you change depending on how much you want to have swap memory.

I forgot to put something. Before the server restarts must edit the file: "fstab"
The file is located on: " etc/fstab " (for CentOS 5).

Must be put into file this line:
/home/swap swap swap defaults 0 0

... and save it.
 
Status
Not open for further replies.

About the author

J
Active Member · Joined
Forums, Internet, Upload, Download, Riping
537
Messages
55
Reactions
28
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom