LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-19-2010, 10:01 AM   #1
bellskar
LQ Newbie
 
Registered: Sep 2010
Posts: 7

Rep: Reputation: 0
Swap Space Problem


The host is on WHM VPS.
Distro: CentOS 5.5

I am having trouble with No SWAP Space available on the machine. And I want to set it up. I've tried searching a lot but no solution I found specific to this problem. Only some where I found to fix/repare the file system according to my scenario of findings in the machine.

Following is the information till now I have found in the machine while trying to get a fix. But only the deeper I could go and found nothing to resolve.
Code:
[~]# free -m
             total       used       free     shared    buffers     cached
Mem:          1024        176        847          0          0          0
-/+ buffers/cache:        176        847
Swap:            0          0          0
I, then, followed a tutorial to create/increase the swap file. Following is what I reached to..
According to the instructions I checked with the command "swapon -s" and got following output
Code:
[~]# swapon -s
Filename                                Type            Size    Used    Priority

[~]#
Apparently I didn't see any thing in the above detail. But I continued on as per the tutorial that goes down.
Code:
[~]# dd if=/dev/zero of=/extraswap bs=1M count=2048
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 16.5224 seconds, 130 MB/s

[~]# mkswap /extraswap
Setting up swapspace version 1, size = 2147479 kB

[~]# swapon /extraswap
swapon: /extraswap: Operation not permitted
Unfortunately, the "swapon" command failed with the error "Operation not permitted". I also tried the above steps after performing "swapoff -a" just to make sure. But it resulted the same output.

I also got some thing about to check with the "fdisk -l". but following is what it resulted
Code:
[~]# fdisk -l
cannot open /proc/partitions

[~]#
After getting the above error. I tried to check the file "partitions" in /proc. And I didn't see any "partitions" file there.
Code:
[~]# ls /proc
./      15843/  19551/  23993/  26386/  5620/        loadavg  sys/
../     15844/  19552/  24241/  26393/  5816/        locks    sysrq-trigger
1/      15845/  19621/  24362/  26417/  5848/        meminfo  sysvipc/
11556/  15900/  19622/  26071/  26451/  cmdline      modules  uptime
11557/  15960/  19623/  26104/  27952/  cpuinfo      mounts   user_beancounters
15831/  17627/  19624/  26133/  31833/  devices      net/     version
15840/  17691/  22140/  26313/  31834/  filesystems  self     vmstat
15841/  17692/  23765/  26340/  31841/  fs/          stat     vz/
15842/  17741/  23767/  26353/  31842/  kmsg         swaps
[~]#
I am not able to do any thing else to increase the Swap file. I'd really need help for that purpose.

Thanks in advance..
Regards,
 
Old 09-19-2010, 10:31 AM   #2
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 101Reputation: 101
I'm not familiar with VPS but maybe you cannot create swap in virtual environment (OpenVZ?).
 
Old 09-19-2010, 11:46 AM   #3
bellskar
LQ Newbie
 
Registered: Sep 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks for your comment. I am not sure about which Virtual Environment WHM is using. but on the other hand I do have a setup on VMware on my local computer with same version of CentOS virtually on VMware and it's good with every thing as it supposed to be.

I guess on WHM, it's "virtuozzo" as it is mentioned on the header as following
Code:
WHM 11.26.8
CENTOS 5.5 i686 virtuozzo
After your comment I considered to search about the fact you mentioned that VPS may cause an issue for it. I got the following reference on a website (I can't currently post links as I have to reach 15 posts for that. So I can tell that I searched google for "swap space in linux virtuozzo" and the 3rd link in the result was redirecting to a website comparing "VMware and virtuozzo")
Quote:
Finally, a hardware-based virtual server like VMware offers something an OS-based virtual environment does not and cannot offer—virtual memory. Virtual memory, called swap in Unix or page file in Windows, allows your applications to use an assigned piece of disk space as working memory when necessary to avoid crashing. Because all container environments share an operating system core, containers don’t have independent access to swap. Using VMware, your hosting provider can give you swap space or a paging file as large as that available on a physical server.
So what an answer would be now?
 
Old 09-19-2010, 12:00 PM   #4
tommylovell
Member
 
Registered: Nov 2005
Distribution: Raspbian, Debian, Ubuntu
Posts: 380

Rep: Reputation: 103Reputation: 103
Hmmm. Works on my Fedora system on bare metal, so you appear to be doing nothing wrong.
It's odd that your dd and mkswap succeed but the swapon fails.

This post, http://forum.openvz.org/index.php?t=msg&goto=412&
had this solution
Quote:
OK was able to resolve this, turns out my VPS was not defined to have enough resources, this has been resolved.
Knowing nothing about vps, I don't know if this is helpful.

Here is from my system:
Code:
[root@athlonz ~]# dd if=/dev/zero of=/extraswap bs=1M count=2048
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 23.367 s, 91.9 MB/s

[root@athlonz ~]# mkswap /extraswap
Setting up swapspace version 1, size = 2097148 KiB
no label, UUID=542a2d9b-e1c1-4932-b070-8395a2b6877a

[root@athlonz ~]# swapon /extraswap

[root@athlonz ~]# swapon -s
Filename                                Type            Size    Used    Priority
/dev/mapper/vgz00-lvz00                 partition       1048568 4       -1
/extraswap                              file            2097144 0       -2
 
Old 09-19-2010, 12:39 PM   #5
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 101Reputation: 101
Quote:
Originally Posted by bellskar View Post
I guess on WHM, it's "virtuozzo" as it is mentioned on the header as following
Code:
WHM 11.26.8
CENTOS 5.5 i686 virtuozzo
OK, Virtuozzo was built on top of OpenVZ: http://wiki.openvz.org/Virtuozzo
Quote:
Originally Posted by bellskar View Post
After your comment I considered to search about the fact you mentioned that VPS may cause an issue for it. I got the following reference on a website (I can't currently post links as I have to reach 15 posts for that. So I can tell that I searched google for "swap space in linux virtuozzo" and the 3rd link in the result was redirecting to a website comparing "VMware and virtuozzo")
So what an answer would be now?
http://dedicatedhostingweb.org/the-t...e-vs-virtuozzo

The answer (maybe) is: http://forum.openvz.org/index.php?t=msg&goto=9834&
 
Old 09-19-2010, 01:37 PM   #6
bellskar
LQ Newbie
 
Registered: Sep 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by tommylovell View Post
Hmmm. Works on my Fedora system on bare metal, so you appear to be doing nothing wrong.
It's odd that your dd and mkswap succeed but the swapon fails.

This post, http://forum.openvz.org/index.php?t=msg&goto=412&
had this solution


Knowing nothing about vps, I don't know if this is helpful.

Here is from my system:
Code:
[root@athlonz ~]# dd if=/dev/zero of=/extraswap bs=1M count=2048
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 23.367 s, 91.9 MB/s

[root@athlonz ~]# mkswap /extraswap
Setting up swapspace version 1, size = 2097148 KiB
no label, UUID=542a2d9b-e1c1-4932-b070-8395a2b6877a

[root@athlonz ~]# swapon /extraswap

[root@athlonz ~]# swapon -s
Filename                                Type            Size    Used    Priority
/dev/mapper/vgz00-lvz00                 partition       1048568 4       -1
/extraswap                              file            2097144 0       -2
Thanks. Yes! the same work well on my local machine running having the same version of CentOS in VMware (hosted on Windows).

It must be the issue with the "virtuozzo", I guess now. But don't know how can it be allowed on VPS, as your referenced link about Oracle, he got it fixed from his host perhaps.

Last edited by bellskar; 09-19-2010 at 02:06 PM.
 
Old 09-19-2010, 01:41 PM   #7
bellskar
LQ Newbie
 
Registered: Sep 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by quanta View Post
Well I couldn't understand a lot of terms used in the referenced thread on openvz you linked as an answer. But what I could get from that thread is also that the issue is actually with "virtuozzo", right?

But what could be the workaround any way...?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with swap space dwhitney67 Linux - General 4 10-08-2007 05:20 PM
Problem with swap space during SUSE-10.2 installation kris.c Linux - Distributions 5 08-10-2007 11:19 PM
how much swap space is needed; how to increase swap space? johnpaulodonnell Linux - Newbie 5 03-23-2007 03:20 AM
swap-space fstab problem MarkGraham Linux - Newbie 3 12-06-2002 11:23 AM
swap-space fstab problem MarkGraham Linux - Newbie 0 12-05-2002 07:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration