Solved

Swap and NFS on Linux

Posted on 1997-06-04
11
270 Views
Last Modified: 2013-12-23
Hello,

I'm on Linux machines and run into the following problem:
I want to run a diskless X-Terminal which runs several other services as well. Therefore it needs a little swap space which I want to provide via NFS and which I can't get to work.

I did the following (as described in man mkswap and of course I am root when doing this):

$ dd if=/dev/zero of=swapfile bs=1024 count=8192
$ mkswap swapfile 8192
$ sync
$ swapon swapfile

Everything went fine except the swapon command. It complains about a wrong argument. In the syslog I get the following lines:

Jun  3 10:09:05 host kernel: rw_swap_page: bad swap file
Jun  3 10:09:05 host last message repeated 3 times
Jun  3 10:09:05 host kernel: Unable to find swap-space signature

How can I get the swapfile working?

Harry
0
Comment
Question by:HarryF1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
  • 2
  • +1
11 Comments
 

Expert Comment

by:james_zhang
ID: 1582120
1. You should be root to turn on swap
2. use swapon /dir_name/swapfile
0
 

Author Comment

by:HarryF1
ID: 1582121
That was what I wrote!! Exactly THIS does not work!
0
 

Author Comment

by:HarryF1
ID: 1582122
Edited text of question
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:tryx
ID: 1582123
Does the procedure work on non-NFS filesystems.
This might be a first step in solving your problem.
0
 

Author Comment

by:HarryF1
ID: 1582124
Yes, it does. Swap on local drives is no problem but as I have to use the terminal without HDD I can't use it.

0
 

Expert Comment

by:tryx
ID: 1582125
Something else you could try is perform all but the last step on the NFS server, and to only do the swapon on the diskless station. (the sync you perform doesn't sync the disk on the NFS server, I suppose)
0
 

Author Comment

by:HarryF1
ID: 1582126
I already tried this. I created the file on the server and just did a swapon file on the client. The result was the same.

0
 
LVL 1

Expert Comment

by:strobert
ID: 1582127
what linux version are you using?  I think there is a swap over NFS patch floating out somewhere, I'll see if I can find it.  It might be included in 2.1.x, but I am pretty sure such support isn't in 2.0.x
0
 

Author Comment

by:HarryF1
ID: 1582128
I'm running 2.0.30. There is a patch? Any idea where I can find it?
0
 
LVL 1

Accepted Solution

by:
strobert earned 200 total points
ID: 1582129
the URL for swap over NFS (2.0.x patch):
http://www.linuxhq.com/patch/20-p0530.html

www.linuxhq.com basically collects almost every kernel patch... good place to look.
0
 

Author Comment

by:HarryF1
ID: 1582130
Thank you - this patch solved the problem!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
I had an issue with InstallShield not being able to use Computer Browser service on Windows Server 2012. Here is the solution I found.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question