Solved

Swap and NFS on Linux

Posted on 1997-06-04
11
263 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
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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Some sers suddenly getting error popup msg 28 94
Nimble Storage 3 109
Samba Question 11 80
Alot of sessions on a PC is generated 3 14
Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
I had an issue with InstallShield not being able to use Computer Browser service on Windows Server 2012. Here is the solution I found.
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…
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…

828 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