problem when adding swap file

Support for webhosts that use CentOS
Post Reply
pjwelsh
Posts: 2598
Joined: 2007/01/07 02:18:02
Location: Central IL USA

Re: problem when adding swap file

Post by pjwelsh » 2011/01/20 03:59:58

You may be wanting to use "mkswap" then "swapon".

pjwelsh
Posts: 2598
Joined: 2007/01/07 02:18:02
Location: Central IL USA

Re: problem when adding swap file

Post by pjwelsh » 2011/01/20 16:34:20

You should run "man mkswap" and then "man swapon" and then maybe ask questions :-P

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

problem when adding swap file

Post by gerald_clark » 2011/01/20 16:39:49

The OP's problem is that he is missing /dev/zero.

This device node is created in the /dev/ directory at boot.
If this node is still missing after a reboot, then there is a serious problem

User avatar
AlanBartlett
Forum Moderator
Posts: 9323
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: problem when adding swap file

Post by AlanBartlett » 2011/01/20 17:55:05

As a purely temporary solution --

[code]
[b]mknod /dev/zero c 1 5[/b]
[/code]

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: problem when adding swap file

Post by pschaff » 2011/01/20 23:00:49

Welcome to the CentOS fora. Reading [url=https://www.centos.org/modules/newbb/viewforum.php?forum=47]FAQ & Readme First[/url] is recommended for new users.

[quote]
A7med_Baraka wrote:
...
when i checked /dev there is no file names zero ??!!

any help ASAP plz[/quote]

As Gerald said, if you have no /dev/zero then something is seriously wrong. Please give us a bit more background including the information suggested by [url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=25128&forum=47]How to provide information about your system[/url] and anything that may be peculiar about the history or behavior of the system.

Also, as explained in [url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=14274&forum=47]Readme First[/url], you are encouraged [i][b]not[/b][/i] to use texting abbreviations such as "plz"

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: problem when adding swap file

Post by pschaff » 2011/01/21 15:45:56

[quote]
A7med_Baraka wrote:
...
any suggest ??[/quote]
Please [re]read [url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=25128&forum=47]How to provide information about your system[/url] and provide the output file from [b]./getinfo.sh disk[/b] .

Edit:
[quote]
A7med_Baraka wrote:
for your notice i am trying to apply this on VPS, is this maybe make any problem ??
[/quote]
That is a good possibility.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: problem when adding swap file

Post by pschaff » 2011/01/21 17:33:05

Did you not see a section similar to the following on the terminal output?[code]
########################
Results are in the file:
* /tmp/basedata.K13135 *
########################
[/code]

If not, then please run the following commands and provide the output:[code]
uname -rmi
rpm -qa \*-release\*
cat /etc/redhat-release
cat /etc/fstab
[/code]
Edit: One more question. Did you run swapon as root?

Post Reply

Return to “CentOS 5 - Webhosting Support”