Solved

Swap and NFS on Linux

Posted on 1997-06-04
11
258 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
  • 6
  • 2
  • 2
  • +1
11 Comments
 

Expert Comment

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

Author Comment

by:HarryF1
Comment Utility
That was what I wrote!! Exactly THIS does not work!
0
 

Author Comment

by:HarryF1
Comment Utility
Edited text of question
0
 

Expert Comment

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

Author Comment

by:HarryF1
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Expert Comment

by:tryx
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you - this patch solved the problem!
0

Featured Post

NetScaler Deployment Guides and Resources

Citrix NetScaler is certified to support many of the most commonly deployed enterprise applications. Deployment guides provide in-depth recommendations on configuring NetScaler to meet specific application requirements.

Join & Write a Comment

Let’s list some of the technologies that enable smooth teleworking. 
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now