Solved

Swap and NFS on Linux

Posted on 1997-06-04
11
280 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

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

This program is used to assist in finding and resolving common problems with wireless connections.
This article is in regards to the Cisco QSFP-4SFP10G-CU1M cables, which are designed to uplink/downlink 40GB ports to 10GB SFP ports. I recently experienced this and found very little configuration documentation on how these are supposed to be confi…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses
Course of the Month4 days, 18 hours left to enroll

636 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