Link to home
Start Free TrialLog in
Avatar of Victor Kimura
Victor KimuraFlag for Canada

asked on

creating swapfile on Centos 5.9 linux

Hi,

I need more memory so I was reading this page:
https://www.linux.com/news/software/applications/8208-all-about-linux-swap-space

#free -m
             total       used       free     shared    buffers     cached
Mem:          1024       1024          0          0          0          0
-/+ buffers/cache:       1024          0
Swap:            0          0          0

Open in new window


A couple of questions:
(1)
I ran this:

dd if=/dev/zero of=/swapfile bs=1024 count=2048576

the above command ran fine.

But this command gives me a "command not found" error:
mkswap /swapfile

Also, I don't have the command:
swapon -s

(2)
If I create the swapfile then will it free my physical RAM?

(3)
Are there any other considerations I need to make so nothing breaks or happens?

Thank you and Father bless<><
SOLUTION
Avatar of Seth Simmons
Seth Simmons
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Victor Kimura

ASKER

Ok, thank you all! =)

So I shouldn't use swap at all then? I was going to just test and see what the performance will be like. How do I undo the swapfile after the test? What are the commands to unswap the file or partition?

@gheist, just curious how do I find out how which device is the swap partition? I'm on a VDS from gd hosting. Currently, Centos 5.9.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I get this with fdisk:


root@ip-184-168-116-73 [/home/myultrat/public_html/l4]# fdisk -l
bash: fdisk: command not found
root@ip-184-168-116-73 [/home/myultrat/public_html/l4]# /sbin/fdisk -l
cannot open /proc/partitions

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yeah, it's a VDS with godaddy. Anyone suggest a better VDS that doesn't have restrictions? A friend recommended mochhosting.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@gheist, wow, those are really cheap. Are there some good tutorials on compcache setup? Tried looking but there doesn't seem to be that much info on it. I'm running Centos 5.9 but RHEL is similar I would think.
Bless you all! =)
On RHEL6 you can use compcache as an indication when swapping occurs.
RHEL 5, CentOS 5 , Oracle Linux 5 , Scientific Linux Boron do not fall in RedHat v6 category by any means.
@gheist, ok, thanks! Are there tutorials on compcache? How does one view it and if there is something we need it make it active or does it come standard?